Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Font class, external font files question

Reply
Thread Tools

Font class, external font files question

 
 
Karl Hungus
Guest
Posts: n/a
 
      02-04-2004

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


 
Reply With Quote
 
 
 
 
Karl Hungus
Guest
Posts: n/a
 
      02-04-2004
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swing Font, it's Java Font? ot native? how install new font? mttc Java 2 07-03-2009 07:29 PM
Create references to external scipt files from within an external script file Mellow Crow Javascript 6 11-04-2005 01:16 PM
How to get the text in html tag.like<div...><font...>Text</font></ =?Utf-8?B?Tmlja3k=?= ASP .Net 2 02-20-2005 03:03 PM
JavaRE 1.4.2 font alias in /lib/font.properties (Linux) Nick Spinel Java 0 07-25-2003 08:28 AM
physical font specified but true type font file not available Michael Glavitsch Java 1 07-15-2003 07:09 PM



Advertisments