开发者

Font management and installation in Silverlight

Is there a way to detect if a font has fall back in the list of desired fonts, s开发者_开发知识库o that they can be dynamically downloaded and installed in the system?


Silverlight does support font fallback in the FontFamily property -- just comma-seperate the list of fallback fonts. You can also include fonts which you have embedded in your assembly (no need to install fonts).

Unfortunately, there is no way to download a font only if it is required using XAML alone, but the MSDN reference does suggest a code approach.

FontSource

Rather than specify a FontFamily as a URI in XAML, you can also specify a FontSource in code. This gives you more options for packaging or obtaining a font file. Basically you obtain a stream of either a font file or a zip of font files, and set FontSource using that stream. This is equivalent to specifying a URI portion of a FontFamily value, and makes that font file available to the object. All you need to do now is specify a fontFamilyName to reference one of the specific families in the current FontSource value.

http://msdn.microsoft.com/en-us/library/system.windows.media.fontfamily(v=vs.95).aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜