0
votes

Is there a way to use an OpenType font on Windows Phone 7 Silverlight application? I want to use Lobster which is only available AFAIK in OpenType format. It renders in Blend but not when I deploy to the emulator.

I have included the .otf file in my project and set the Properties to 'Content' and 'Copy If Newer'.

This website found a solution for .ttf fonts, but the technique specified does not work for OpenType. Is OpenType not supported by Windows Phone? I find this hard to believe given that MS part invented the format!

3

3 Answers

1
votes

Windows Phone requires your fonts to be TrueType (.ttf). OpenType (.otf) is not supported.

1
votes

There may be some confusion on the term "OpenType". OpenType is a broad description of the format which actually includes 2 "flavors" for describing the font's outlines: TrueType and CFF (A form of Adobe PostScript).

A font with a .otf extension is most definitely an OpenType font, and usually means that it includes CFF outlines.

But a TrueType font is, in most cases, generally considered an OpenType font as well, since the OpenType format is actually a superset of both TrueType and CFF flavors.

Regarding Lobster in particular: as a test, I added that font to my Google Webfonts collection, and clicked "Download Collection". The resulting file was a .ttf, and as such, should be usable in Windows Phone as Den Delimarsky's answer points out. How are you getting a .otf version of this file? And is it truly a CFF file, or just a TrueType file with a .otf extension?

Also note that you may be able to obtain the TrueType/.TTF directly from the Google Font Directory though doing so through a browser currently seems to be a bit wonky.

1
votes

you need to add it to the project, set build action to content and enter a uri that links to it in the FontFamily property with the hash tag:

Add it to the project

Set to Build Action 'CONTENT'

Add Uri to property

Example of FontFamily:

FontFamily="fonts/Lobster.ttf#Lobster"