Share via


IXRTextElement::GetFontFamily (Compact 2013)

3/28/2014

This method retrieves the preferred top-level font family for the text in this text element.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetFontFamily(
    __out BSTR* pFontFamily
) = 0;

Parameters

  • pFontFamily
    [out] Pointer to a string that describes the preferred top-level font family.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

A font family is a set of typefaces that share the same family name (for example, "Times New Roman") yet differ in features. These feature differences typically include font style, such as italic, and font weight, such as bold.

If you set a font (either in XAML or C++) that is not supported, XAML for Windows Embedded attempts to use a fallback font instead. If none is supported, it uses the default composite font. XAML for Windows Embedded uses the default fallback font family "Windows Embedded Compact User Interface" as the composite font. This font is defined as a composite font whose file name is "WindowsEmbeddedCompactUserInterface.CompositeFont". Also note that if you want to set a font using the pFontFamily string or use the font fallback feature for that font, you must include the catalog item for that font in the OS design. For more information, see Fonts Catalog Items and Sysgen Variables.

When multiple font families are specified, the second and successive families serve as fallback families to use if the primary family is unavailable or not applicable. To specify multiple font families, use the following syntax:

fontFamilyName[,fallbackFontFamilyName]

In this syntax, fontFamilyName specifies the primary font, and fallbackFontFamilyName specifies an optional fallback font. More than one fallback font can be specified. Use commas to separate each font family string. To avoid ambiguity, if a font family contains a comma (,) in the name, each single comma in a font family reference must be replaced with a double comma (,,).

The font family that you specify for a text element must be included in the font file that you set for the text control in a previous call to IXRTextBlock::SetFontSource or IXRTextBox::SetFontSource.

.NET Framework Equivalent

System.Windows.Documents.TextElement.FontFamily

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRTextElement
IXRTextElement::SetFontFamily