FontUri Property
Collapse the table of content
Expand the table of content

Glyphs.FontUri Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the location of the font used for rendering the glyphs.

Namespace:  System.Windows.Documents
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public Uri FontUri { get; set; }
<Glyphs FontUri="uriString"/>

Property Value

Type: System.Uri
The URI source of the font. The default is null.

Dependency property identifier field: FontUriProperty

The URI you specify must use the same scheme as the hosting HTML page. Usually you specify the font by using a relative URI path. The starting location for the relative reference is the HTML page that contains the current Windows Phone. You cannot set an explicit file: location for FontUri. Backslashes (\)are not permitted in Windows Phone URIs; always use forward slashes (/). The number sign (#) in FontUri specifies a font offset within a TrueType collection, overriding its usual HTML meaning. You can specify a cross-domain source for FontUri if this is allowed by the source server configuration.

NoteNote:

Any font specified by FontUri must reside in a font file or zip file of fonts that is embedded in a DLL as a resource.

FontUri supports fonts in the OTF and TTF formats. FontUri also supports obfuscated fonts. Obfuscated fonts are an XPS concept implemented by Microsoft technologies that use the XPS document format. You can produce an XPS document that contains the necessary obfuscated subsetted font, rename the XPS document to have a .zip extension, and then extract the obfuscated font as a part. The part name will be a GUID. The obfuscated font file must have an .odttf or .odttc file extension, and you cannot change the file name.

If you use obfuscated fonts in this way, make sure that the XPS document that produces the obfuscated font has UnicodeString content within the XPS content that matches what you specify as the value of the UnicodeString property. Depending on your document save options, the XPS obfuscated font is typically drastically subsetted and will only include glyph mappings for the Unicode information from that XPS document.

FontUri also supports TTC (TrueType Collection) fonts. You can index a specific font face offset in the collection using the format collectionname.ttc#n where n is the index within the collection. You can omit "#0" if you intend to reference the first font face in the collection.

NoteNote:

As with most types of software, font files are licensed, rather than sold, and licenses that govern the use of fonts vary from vendor to vendor. As a developer it is your responsibility to ensure that you have the required license rights for any font you embed within a document or application, or otherwise redistribute.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_NETWORKING

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2016 Microsoft