0
votes

I've used both TTF and OTF custom fonts many times in UWP apps without issue, but in this case, I have an OTF font that will not work in my app.

I have a test app that has one page with only the text on it, like this:

<TextBlock Text="Testing" FontFamily="ms-appx:///Assets/Fonts/customfont.otf#font name" FontSize="30"/>

The font file is located at that location in my project and the #fontname is the same one that shows in Windows Font Viewer.

I've tried converting the OTF to TTF, but it didn't change anything.

I've installed the OTF font on my Windows System and I can use the font in MS Word and other programs and it looks correct.

This is a professional font provided by a company that sells high quality fonts.

I've run out of trouble shooting tactics on this. Anything else I should try?

1
I had the same problem once. and the solution many gave me was to try to add an other font. some fonts just dont "work" with vs. but depends on what version of visual studio you are using. - berg96
I've added 5 different custom fonts to this test app...all work, except this one. Very frustrating. I'm using VS 2015 Update 3...all the latest. - Scott
Custom font file itself is very important here, you can refer to the answer in this case, it may help. - Grace Feng
That worked Grace. Thank you! - Scott
Nice to know, you're welcome! - Grace Feng

1 Answers

0
votes

What font are you using? Sometimes the #Font Name does not equal what is seen in the Windows Font Viewer. I have a database of the values that I use with my app Font Lounge. I'll try looking up the value.

--

Just saw that you figured it out - font weight is not part of the #Font Name as the #Font Name refers to the family only.