6

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.

Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
Jakob Lithner
  • 4,225
  • 6
  • 38
  • 59

3 Answers3

7

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)

Jakob Lithner
  • 4,225
  • 6
  • 38
  • 59
  • 1
    Assuming that works technically... is it legal? I was under the impression that this font was owned by Microsoft and not freely redistributable. – PatrickV Feb 10 '15 at 20:53
4

First of all thanks a lot to @Jakob Lithner and other contributors.

-> I'm testing my wpf application on a win 7 PC which didn't support some of my unicode characters. As suggested, I created a Resources>Fonts folder inside my c#-project and copied the font seguisym.ttf inside (added as a "resource"; "copy if newer").

FontFamily="pack://application:,,,/<NameOfMyC#ProjectInSolution>;component/Resources/Fonts/seguisym.ttf#Segoe UI Symbol"

The only change with respect to the solution of Mr. Linthner is that I didn't rename the font, and prepended the font-filename to "#Segoe UI Symbol"

Kind regards from Belgium!

1

The path you've given is relative to the control you're using TextBlock in. If you want to reference fonts from project root folder, you should use this:

<TextBlock FontFamily="pack://application:,,,/_Resources/#Segoe UI Symbol">
Erti-Chris Eelmaa
  • 25,338
  • 6
  • 61
  • 78
  • Thanks for suggestion. It does not work. Before I also tried something similar with relative path "../_Resources/#Segoe UI Symbol" without success. The strange thing is that I now tried another font, and both syntaxes worked!!! So the issue is just with this particular font! What is wrong with "Segoe UI Symbol"??? It is definitely extended in different Windows versions. The same font file is different in version and size between Windows 7, 8, 8.1. When properly installed in Windows all symbols are accessible, but not when referenced as resource ... – Jakob Lithner Jan 12 '15 at 19:23
  • @JakobLithner, I don't think such font **name** exists. Try "#Segoe UI Symbol Regular" – Erti-Chris Eelmaa Jan 12 '15 at 20:15
  • It is definitely named "Segoe UI Symbol". When using the font installed the normal way it works fine. – Jakob Lithner Jan 12 '15 at 21:36
  • When searching more specificly on this particular font I realize I am not the only one with this problem. Unfortunateley there seems to be no solution. http://stackoverflow.com/questions/17283626/segoe-ui-symbol-5-9-on-windows-7 http://stackoverflow.com/questions/21527494/segoe-ui-symbol-windows-7 http://stackoverflow.com/questions/27629556/wpf-application-not-picking-up-segoe-ui-symbol-font – Jakob Lithner Jan 12 '15 at 21:37
  • Ah! Glad you got help. I've embedded Segoe UI fonts successfully the last time I did it in commercial app, but I never had to embed the "Segoe UI Symbol" specifically. Good to know. You might want to also outline the details **why** this happens - if you know of course. – Erti-Chris Eelmaa Jan 13 '15 at 10:48