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. Advertising

  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. Advertising

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. =?Utf-8?B?Tmlja3k=?=
    Replies:
    2
    Views:
    716
    Matt Berther
    Feb 20, 2005
  2. E11
    Replies:
    1
    Views:
    4,788
    Thomas Weidenfeller
    Oct 12, 2005
  3. Scott Allen
    Replies:
    8
    Views:
    10,949
    Scott Allen
    May 2, 2004
  4. mttc
    Replies:
    2
    Views:
    2,408
    Roedy Green
    Jul 3, 2009
  5. Mellow Crow
    Replies:
    6
    Views:
    420
    Richard Cornford
    Nov 4, 2005
Loading...

Share This Page