Built-in font with composite name is not displayed

3

I am embedding some fonts in my WPF application but some are not displayed.

Fonts are in the / Fonts folder in the application root and their properties are set to Resource.

Usage like this:

<TextBlock FontFamily="pack://application:,,,/Fonts/#Pericles"   />

<TextBlock FontFamily="pack://application:,,,/Fonts/#Pericles Light"   />

In this case, " #Pericles " whose name is simple, displays normally. Already " #Pericles Light " that has compound name, does not display. Although several examples I have found suggest this form, I believe there must be some escape character for the spaces in the font name. Is it?

    
asked by anonymous 02.08.2014 / 18:40

1 answer

1

One solution is to add the source file name:

<TextBlock FontFamily="pack://application:,,,/Fonts/PERICL.TTF#Pericles Light"   />
    
03.08.2014 / 05:51