I have Silverlight application that is using an embedded font. The font works as expected 98% of the time. However, some of the time the font never loads. I don't get any errors, it just rend开发者_JAVA技巧ers all text in a fall back font. Has anyone else run into this? Any ideas on what could be causing it?
Ran into the same issue. Assuming you have the font file set as a 'Resource' and 'Do not copy option' under build options. Here is what fixed it in my project.
When the font file was referenced directly, it would work about 75% of the time...
FontFamily="./Folder/FontFile.TTF#Font Name"
For class libraries the syntax is different, once I switched to using this syntax the font always loaded.
FontFamily="AssembyName;component/Folder/FontFile.TTF#Font Name"
In my project, if you select the font using in the property settings for the control using Visual Studio, it defaulted to option 1, which was unreliable.
精彩评论