Click or drag to resize
CanvasTextFormatFontFamily Property
Specifies the font family name (Arial, Times New Roman, etc.)

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public string FontFamily { get; set; }

Property Value

Type: String

The FontFamily property recognizes three styles of family name:

A font family name of a font that's installed on the system.
Specifies a font family that's contained in a font package (such as a TTF file) that's distributed with the application. The applicationUri must begin with either ms-appx:// or ms-appdata://.
As for applicationUri above, the filename is treated as a URI that starts with ms-appx:///.

Passing in an applicationUri which is well-formed, but doesn't correspond to a valid font file will still succeed. It's equivalent to having no FontFamily specified. To be stricter and test that the font file was loaded and supported, create a CanvasFontSet and verify that its Fonts count is at least one.

See Also