Re: Using local font file (.ttf) in asp.net GDI+ app.
- From: Alexey Smirnov <alexey.smirnov@xxxxxxxxx>
- Date: Sat, 20 Oct 2007 04:59:48 -0700
On Oct 20, 1:54 pm, Alexey Smirnov <alexey.smir...@xxxxxxxxx> wrote:
On Oct 20, 1:45 pm, deeh...@xxxxxxxxx wrote:
Hi,
I am trying to use a special font in an GDI+ application. The font
file is located in my root folder.
The following code does not work but might explain what I am trying to
do...
Font f = new Font(Server.MapPath("somefont.ttf"), 200);
Thank you for your time.
Regards,
Hensson
Font.Font(String, Single) Constructor has a family name as a first
parameter, not a file namehttp://msdn2.microsoft.com/en-us/library/164w6x6z.aspx
P.S.
If you would need to load a font from the file, try following:
PrivateFontCollection p = new PrivateFontCollection();
p.AddFontFile(Server.MapPath("somefont.ttf"));
FontFamily ff= privateFontCollection.Families[0];
Font f = new Font(ff, 200);
.
- Follow-Ups:
- Re: Using local font file (.ttf) in asp.net GDI+ app.
- From: Alexey Smirnov
- Re: Using local font file (.ttf) in asp.net GDI+ app.
- References:
- Using local font file (.ttf) in asp.net GDI+ app.
- From: deehen0
- Re: Using local font file (.ttf) in asp.net GDI+ app.
- From: Alexey Smirnov
- Using local font file (.ttf) in asp.net GDI+ app.
- Prev by Date: Re: Using local font file (.ttf) in asp.net GDI+ app.
- Next by Date: Re: Using local font file (.ttf) in asp.net GDI+ app.
- Previous by thread: Re: Using local font file (.ttf) in asp.net GDI+ app.
- Next by thread: Re: Using local font file (.ttf) in asp.net GDI+ app.
- Index(es):
Relevant Pages
|