JayJay
JayJay

Reputation: 1068

Cannot read True Type Font FIle in my WPF APplication!

i'm developing a project in Wpf with Vista Sp1 on my laptop ,in this project i add some True Type Font that Windows Xp did not get and when i debug my project on Windows XP i cannot see the True Font File,so i wish add in my project those fonts as resources but i cannot work out this step. I followed all advices of MSDN but not luck...for example i added a Font File "INFROMAN.TTF" (this Font is a original Font File of Vista and stays in this directory C:Windows/Font) and in the textBlock i declare this line:

<TextBlock FontFamily="./Font/#INFROMAN"> Test.... </TextBlock>

but i cannot see the right font. Do you have any advice how i can add those True FOnt FIle as Resource in my project so when i run my project on the WIndows XP i can see the right fonts???

Thanks for your attention.

Cheers

Upvotes: 2

Views: 1286

Answers (1)

JayJay
JayJay

Reputation: 1068

I work out this stupid error in simple way:)

When i declare the directory of the Font Style i should insert the original name as Window nominate it and not the name as Visual Studio denominate it for example : in my case i added in my project the Font Style"Informal Roman" so in XAML i need to write down as follow:

<TextBlock FontFamily="/Font/#Informal Roman"> TEST.....</TextBlock>

and not the name that Visual Studio denominate in my project :

 <TextBlock FontFamily="/Font/#INFROMAN"> TEST.....</TextBlock>

Have a good work.

Cheers

Upvotes: 1

Related Questions