Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - How do I embed and then use a font inside a WPF web application?

 
 
Old 03-16-2006   #1 (permalink)
Philippe Lavoie


 
 

How do I embed and then use a font inside a WPF web application?

Hi

I'd like to embed a barcode font,
http://www.squaregear.net/fonts/free3of9.shtml

and then use it inside my application.

I'm marking the font as a resource then I try to use it as follows

<Glyphs x:Name="BarCodeInfo" UnicodeString="*1223123*"
FontUri="pack://application:,,,/Images\FREE3OF9.TTF"
FontRenderingEmSize="12"/>


Needless to say that the above doesn't seem to product much results...

Please help me out, there doesn't seem to be many examples of this on
the web.

Phil

My System SpecsSystem Spec
Old 03-20-2006   #2 (permalink)
Chris Han [MSFT]


 
 

RE: How do I embed and then use a font inside a WPF web application?

Hi Philippe,
Here's a link to the SDK article which describes how to do this:
http://windowssdk.msdn.microsoft.com/library/

I noticed you used Glyphs, this is a low level API, would TextBlock work
better for your scenario?

Thanks,
Chris

"Philippe Lavoie" wrote:

> Hi
>
> I'd like to embed a barcode font,
> http://www.squaregear.net/fonts/free3of9.shtml
>
> and then use it inside my application.
>
> I'm marking the font as a resource then I try to use it as follows
>
> <Glyphs x:Name="BarCodeInfo" UnicodeString="*1223123*"
> FontUri="pack://application:,,,/Images\FREE3OF9.TTF"
> FontRenderingEmSize="12"/>
>
>
> Needless to say that the above doesn't seem to product much results...
>
> Please help me out, there doesn't seem to be many examples of this on
> the web.
>
> Phil
>

My System SpecsSystem Spec
Old 03-20-2006   #3 (permalink)
Philippe Lavoie


 
 

Re: How do I embed and then use a font inside a WPF web application?

I think you truncated the link

And I do not care about Glyphs that much. However, TextBlock only had a
'Font-Family' property, which isn't an URI. I assumed, I couldn't use
one embedded inside the application.

Phil

Chris Han [MSFT] wrote:
> Hi Philippe,
> Here's a link to the SDK article which describes how to do this:
> http://windowssdk.msdn.microsoft.com/library/
>
> I noticed you used Glyphs, this is a low level API, would TextBlock work
> better for your scenario?
>
> Thanks,
> Chris
>
> "Philippe Lavoie" wrote:
>
>
>>Hi
>>
>>I'd like to embed a barcode font,
>>http://www.squaregear.net/fonts/free3of9.shtml
>>
>>and then use it inside my application.
>>
>>I'm marking the font as a resource then I try to use it as follows
>>
>><Glyphs x:Name="BarCodeInfo" UnicodeString="*1223123*"
>>FontUri="pack://application:,,,/Images\FREE3OF9.TTF"
>>FontRenderingEmSize="12"/>
>>
>>
>>Needless to say that the above doesn't seem to product much results...
>>
>>Please help me out, there doesn't seem to be many examples of this on
>>the web.
>>
>>Phil
>>

My System SpecsSystem Spec
Old 03-21-2006   #4 (permalink)
Chris Han [MSFT]


 
 

Re: How do I embed and then use a font inside a WPF web applicatio

Yes you can actually use relative uris with FontFamily, but you have to
specify a '#' to indicate where the uri ends and where the font family begins:
FontFamily="/Fonts/#Cool Font"

Sorry for truncating...
http://windowssdk.msdn.microsoft.com...4460865286.asp

That should work if not it's under
WPF-->Documents-->Typography-->Fonts-->Packaging Fonts

hope that helps philippe,
Chris

"Philippe Lavoie" wrote:

> I think you truncated the link
>
> And I do not care about Glyphs that much. However, TextBlock only had a
> 'Font-Family' property, which isn't an URI. I assumed, I couldn't use
> one embedded inside the application.
>
> Phil
>
> Chris Han [MSFT] wrote:
> > Hi Philippe,
> > Here's a link to the SDK article which describes how to do this:
> > http://windowssdk.msdn.microsoft.com/library/
> >
> > I noticed you used Glyphs, this is a low level API, would TextBlock work
> > better for your scenario?
> >
> > Thanks,
> > Chris
> >
> > "Philippe Lavoie" wrote:
> >
> >
> >>Hi
> >>
> >>I'd like to embed a barcode font,
> >>http://www.squaregear.net/fonts/free3of9.shtml
> >>
> >>and then use it inside my application.
> >>
> >>I'm marking the font as a resource then I try to use it as follows
> >>
> >><Glyphs x:Name="BarCodeInfo" UnicodeString="*1223123*"
> >>FontUri="pack://application:,,,/Images\FREE3OF9.TTF"
> >>FontRenderingEmSize="12"/>
> >>
> >>
> >>Needless to say that the above doesn't seem to product much results...
> >>
> >>Please help me out, there doesn't seem to be many examples of this on
> >>the web.
> >>
> >>Phil
> >>

>

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
embed BG sound Live Mail
drag and drop inside application Vista General
change permission on all files inside a folder or hundreds of file inside a folder Vista security
get whole session output from inside C# application PowerShell
Trouble With Search application inside vista Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46