How to specify FontFamily if a font is added to another Silverlight library?

I created the Silverlight class library "HindiFont" and added the font "LM.ttf" (specified BuildAction=Resource) to it. Now I want to use this font in my main application "main.xap". I also use application library caching, so HindiFont.zip is created. So, how do I use the font that I specified in HindiFont.zip.

I tried the following combinations, but no one works.

<TextBlock x:Name="tDisplay" FontFamily="LM.TTF#MyName" ></TextBlock>

<TextBlock x:Name="tDisplay" FontFamily="HindiFont.dll;LM.TTF#MyName" ></TextBlock>

<TextBlock x:Name="tDisplay" FontFamily="HindiFont.zip;LM.TTF#MyName" ></TextBlock>

So let me know how to solve this problem.

+3
source share
1 answer

You need to specify it as a component and without "LM.TTF", for example:

<TextBlock x:Name="tDisplay" FontFamily="YourAppName;component/HindiFont.zip;#MyName"/>

, , "Fonts", :

"/YourAppName;component/Fonts/HindiFont.zip;#MyName"

+2

Source: https://habr.com/ru/post/1757088/


All Articles