web metrics
Embed a font - Technoeuphoria!

Embed a font

If you want to embed a font into your Silverlight applications, add the font into your project:

image

Set the Build Action file property to embedded resource:

image

Use the following code snippet to use the font as a font source for your components:

Assembly ass = Assembly.GetExecutingAssembly();
Stream stream = ass.GetManifestResourceStream("EmbeddedResource.Font.pricedow.ttf");
this.test.FontSource = new FontSource(stream);
this.test.FontFamily = new FontFamily("Pricedown");

XAML looking something like:

<Grid x:Name="LayoutRoot" Background="White">
    <Canvas>
        <TextBlock x:Name="test" FontFamily="annifont.ttf#Annifont" Text="grand theft auto IV" FontSize="30"/>    
    </Canvas>
    
</Grid>

And the result:

image

Published Saturday, July 26, 2008 9:07 AM by jocelyn
Filed under: ,

Comments

# re: Embed a font

SRCDAJ  <a href="tyogxjclylfp.com/.../a>, [url=http://nlkqqvejdrpf.com/]nlkqqvejdrpf[/url], [link=http://sspsdidpzalb.com/]sspsdidpzalb[/link], http://acqqhyrqkrgs.com/

Thursday, October 02, 2008 1:59 AM by svumlzgyr

Leave a Comment

(required) 
(required) 
(optional)
(required)