b

blu

Saturday, 29 December 2012

Embedding Custom Fonts in XAML

Embedding Custom Fonts in XAML



Adding custom font to Any control in Silverlight/WPF.

  • Add fonts to fonts directory in your Application(Web/Desktop)
  • In the Font-family Field just refer Fontfilename#FontName.
 <TextBox HorizontalAlignment="Left" Height="84" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="314" Margin="5,42,-169,0" Grid.Row="1" FontFamily="tullyshandregular.ttf#TullysHand" Grid.Column="1" FontSize="18"/>

syntax:   FontFamily="fontfile.ttf#fontname".


How to find font name->just double click on ttf file,  first line will have fontname.

OUTPUT:

No comments:

Post a Comment