Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a WPF application where I use icons from the font "Segoe UI Symbol". But when deploying to Windows 7 I realize the icons are missing because the font is updated in Windows 8.

I tried to embed font in WPF application as a resource following these instructions: http://msdn.microsoft.com/en-us/library/ms753303.aspx But it does not work.

Initially I had:

<TextBlock FontFamily="Segoe UI Symbol">

which works fine on Windows 8 computer. Then I added seguisym.ttf to directory "_Resources" and then use:

<TextBlock FontFamily="./_Resources/#Segoe UI Symbol">

This does not work on neither Windows 8 or Windows 7! I tried different settings for BuildAction: Resource, Embedded Resource and Content, but none of them work.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
353 views
Welcome To Ask or Share your Answers For Others

1 Answer

I finally found a way to use the newer version of "Segoe UI Symbol" even when older version is installed (i.e. on Windows 7). This approach works also in ClickOnce installation and requires no bootstrapping.

I guess the problem is caused by a name conflict with a font already loaded in Windows. So I renamed the newer version to avoid the conflict. It works.

1) Download utility program Typograf from this link: http://www.neuber.com/typograph/
2) Open directory where you have a copy of your font file
3) Click on font in list
4) Click Properties button in bar
5) Click Rename button, specify a new name (I chose "SegoeDynamic") and select where to save the new file
6) Add the new font file to your Visual Studio project directory (my directory is "/_Resources")
7) Use relative path or root path as you wish when referencing the font dynamically

 <TextBlock FontFamily="../_Resources/#SegoeDynamic">
 <TextBlock FontFamily="pack://application:,,,/_Resources/#SegoeDynamic">

Please observe that "Segoe UI Symbol" is released in several versions where each version adds more symbols. I have discovered at least the following:

Windows 7: 5.01 ( 823kb)

Windows 8: 5.90 (1660kb)

Windows 8.1: 6.09 (1740kb)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...