Font class, external font files question

Discussion in 'ASP .Net' started by Karl Hungus, Feb 4, 2004.

  1. Karl Hungus

    Karl Hungus Guest

    Is there a way to use truetype fonts not installed on the system, but
    existing as a file on the server? For example, if I have a true type file in
    the same directory as my aspx file, can I use that to replace this
    constructor somehow:
    Font fontBanner = new Font("verdana", 35, FontStyle.Regular);

    Im using gdi+ with asp.net (c#) to generate some simple images

    Thanks in advace
     
    Karl Hungus, Feb 4, 2004
    #1
    1. Advertisements

  2. Karl Hungus

    Karl Hungus Guest

    Answered my own question:

    String fontStr = Server.MapPath("KROE0553.TTF");
    PrivateFontCollection pfc = new PrivateFontCollection();
    pfc.AddFontFile(fontStr);

    FontFamily fontFam = new FontFamily("kroeger 05_53", pfc);
    Font fontBanner = new Font(fontFam, 35, FontStyle.Regular);




    > Is there a way to use truetype fonts not installed on the system, but
    > existing as a file on the server? For example, if I have a true type file

    in
    > the same directory as my aspx file, can I use that to replace this
    > constructor somehow:
    > Font fontBanner = new Font("verdana", 35, FontStyle.Regular);
    >
    > Im using gdi+ with asp.net (c#) to generate some simple images
    >
    > Thanks in advace
     
    Karl Hungus, Feb 4, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    5,789
    Thomas Weidenfeller
    Oct 12, 2005
  2. Scott Allen
    Replies:
    8
    Views:
    11,411
    Scott Allen
    May 2, 2004
  3. christopher diggins
    Replies:
    16
    Views:
    1,061
    Pete Becker
    May 4, 2005
  4. Joseph Turian
    Replies:
    5
    Views:
    871
  5. Marsel
    Replies:
    5
    Views:
    436
    Randy Webb
    Oct 17, 2007
  6. mttc
    Replies:
    2
    Views:
    2,712
    Roedy Green
    Jul 3, 2009
  7. Mellow Crow
    Replies:
    6
    Views:
    709
    Richard Cornford
    Nov 4, 2005
  8. Marsel
    Replies:
    11
    Views:
    289
    Robert Larsen
    Oct 17, 2007
Loading...