How to specify FontFamily if font added in another Silverlight library?
I have created a Silverlight Class Library "HindiFont" and added a "LM.ttf" font in it (specified BuildAction=Resource
) . Now I want to use this font in my main application "main.xap". I am aslo using Application library caching so there are HindiFont.zip created. So how I use the font which I have specified in HindiFont.zip.
I have tried below combinations but no one are working.
<TextBlock x:Name="tDisplay" FontFamily="LM.TTF#MyName" ></TextBlock>
<TextBlock x:Nam开发者_开发知识库e="tDisplay" FontFamily="HindiFont.dll;LM.TTF#MyName" ></TextBlock>
<TextBlock x:Name="tDisplay" FontFamily="HindiFont.zip;LM.TTF#MyName" ></TextBlock>
So please let me know how to resolve this issue.
You need to specify it as a component and without the "LM.TTF", like this:
<TextBlock x:Name="tDisplay" FontFamily="YourAppName;component/HindiFont.zip;#MyName"/>
If you have your fonts in a sub-directory like one named "Fonts", just use that inside:
"/YourAppName;component/Fonts/HindiFont.zip;#MyName"
精彩评论