Using custom fonts in apps is great. It can add some visual interest, draw attention to some specific text, serve as a way of handling multiple images or icons, and it can enable the consistent representation of brand identity.
There are a few gotchas for getting the font to display correctly in a Windows app, such as having the wrong build action, or trying to use a file which does not support embedding and these are quite well documented in various blog posts around the web.
After much head scratching, I finally found the cause of another reason a font may not display properly.
Here's the issue summed up in one image.
Here's what's going on.
When a custom FontFamily is specified it is done in two parts. The first is the name of the file and the second is the name of the font family. It should be quite simple and if you add the font to your project you can use Visual Studio (or Blend) to select the font from the dropdown list and it will set this for you.
Here's the gotcha.
On Windows, there is a way to specify multiple font families in a single file and a way to specify which is preferred. It seems the VS/Blend font selector does not handle preferred families correctly. Specifically, it appears to use the family name regardless of whether a preferred family is defined. I was using (as in the screenshot above) a corporate font that contained a single family but had a different value specified for the preferred family name. For the font to be correctly displayed it's necessary to use the preferred family value but this is not what was set by the tool. It's simple enough to change this in the XAML if you know what's up.
Identifying this was a challenge.
I normally use TTFEdit to explore the internals of font files but this doesn't have the clearest of interfaces. While investigating I discovered dp4 Font Viewer and this did help make it easier to see some of the less obvious properties of the file.
There's probably a little more subtlety to the actual issue and I'm not interested enough to read the TTF spec to see the full extent of what could be going on but hopefully, this is enough to help you if your font is not being used and you can't see why not.
شركة تنظيف بالدمام
ReplyDeleteشركة تنظيف فلل بالدمام
شركة تنظيف شقق بالدمام
شركة تسليك مجاري بالدمام
شركة مكافحة حشرات بالدمام
شركة كشف تسربات المياة بالدمام
شركة مكافحة النمل الابيض بالخبر
شركة مكافحة النمل الابيض بالقطيف
شركة مكافحة النمل الابيض بالاحساء
شركة كشف تسربات المياة بالخبر
شركة كشف تسربات المياة بالقطيف
شركة كشف تسربات المياة بالجبيل
شركة كشف تسربات المياة بتبوك
شركة كشف تسربات المياة بالباحة
ReplyDeleteشركة تنظيف بالخبر
شركة تنظيف بالجبيل
شركة تنظيف بالاحساء
شركة تنظيف بالقطيف
شركة نقل عفش بالقطيف
شركة تنظيف خزانات بالقطيف
شركة تسليك مجاري بالجبيل
شركة تسليك مجاري بالقطيف
شركة تسليك مجاري بالخبر
شركة تسليك مجاري بالباحة
شركة تسليك مجاري بجدة
شركة تسليك مجاري بالباحة
شركة تسليك مجاري ببقيق
شركة تسليك مجاري بالطائف
شركة تسليك مجاري بالخفجي
شركة تسليك مجاري بعنك-سيهات
شركة تسليك مجاري بالنعيرية
شركة تنظيف منازل بتبوك
ReplyDeleteشركة تنظيف بتبوك
شركة تنظيف شقق بتبوك
شركة تنظيف خزانات بتبوك
شركة رش مبيدات بتبوك
شركة نقل عفش بتبوك
شركة تسليك مجاري بتبوك
شركة كشف تسربات المياه بتبوك
شركة مكافحة حشرات بالخبر
شركة مكافحة حشرات بالدمام
شركة مكافحة حشرات بالدمام
شركة مكافحة حشرات
شركة مكافحة حشرات بالجبيل
شركة مكافحة حشرات بالقطيف
شركة مكافحة حشرات بالاحساء
شركة مكافحة حشرات بالدمام
شركة رش مبيدات بالدمام
ReplyDeleteشركة رش مبيدات بالاحساء
شركة رش مبيدات بالقطيف
شركة المثالية للتنظيف
شركة المثالية لمكافحة الحشرات
شركة المثالية للتنظيف بالدمام
شركة المثالية للتنظيف بالخبر
شركة المثالية لمكافحة الحشرات بالدمام
شركة المثالية لمكافحة الحشرات بالخبر
Thanks for sharing the information. It is very useful for my future. keep sharing
ReplyDeletemonkey go happy 3| play mahjong| yahtzee with buddies| defend your nuts 2 | superfighters 2 game | happy wheels demo| cat mario 4 | bloons tower defense 5