Compartir a través de


FontUri

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the Uniform Resource Identifier (URI) that represents the location of the font that is used for rendering the Glyphs.

<object FontUri="string"  .../>
value = object.FontUri
object.FontUri = value

Property Value

Type: string

A value that represents the URI source of the font.

This property is read/write. The default value is null.

Managed Equivalent

FontUri

Remarks

The URI you specify must use the same scheme as the hosting HTML page. Generally, the best practice for specifying the URI is to use a relative URI path. The starting location for the relative reference (when using the JavaScript API, and setting source to a XAML page) is the HTML page that contains the current Silverlight plug-in. Setting a cross-domain URI or explicit file: scheme for FontUri is not permitted; a downloader error is thrown. Also, backslashes (\) in Silverlight URIs are not permitted; always use forward slashes (/). An additional URI consideration for FontUri is that the hash sign (#) has a special meaning that overrides its usual HTML meaning; the hash is used to target a font offset within a TrueType collection.

FontUri supports fonts in the .otf and .ttf formats.

FontUri supports obfuscated fonts, which are implemented by Microsoft technologies that use XML Paper Specification (XPS) as a document format. You can produce an XPS document that contains the necessary obfuscated subsetted font, rename the XPS document so that it can be recognized as a zip package, and then extract the obfuscated font as a part. The part name will be a GUID. Changing the name of the obfuscated font file/part is not supported and must conform to the XPS obfuscation scheme. In addition, obfuscated fonts must have the .odttf or .odttc file extension.

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 Glyph UnicodeString. 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 TrueType Collection (TTC) fonts. Using this mode, you can index a specific font face offset in the collection, in 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.

Applies To

Glyphs

See Also

Reference