Compartilhar via


IXRTextElement::GetFontStretch (Compact 2013)

3/28/2014

This method retrieves a value that indicates how much a font is condensed or expanded on the screen.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetFontStretch(
    __out XRFontStretch* pFontStretch
) = 0;

Parameters

  • pFontStretch
    [out] Pointer to an XRFontStretch enumerated type that indicates how much the font is condensed or expanded on the screen.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

Font stretch describes how much a font form stretches compared to its usual aspect ratio. The aspect ratio is the original width-to-height ratio specified for the glyphs in the font. The font stretch value applies to fonts that exist in a font family. It does not cause programmatic stretching of glyphs.

Note   The value of pFontStretch might not be used for the font stretch during rendering because of font fallback. (For information about font fallback, see the Remarks section in IXRTextBlock::GetFontFamily). For example, if the font stretch XRFontStretch_ExtraExpanded is specified, but XRFontStretch_Normal is the closest font stretch available, the value of pFontStretch is still XRFontStretch_ExtraExpanded.

When you use the IXRTextElement::GetFontStretch method in the derived class IXRRun, you can specify a different font stretch value for a <Run> element in the source XAML for your application to override this top-level setting.

.NET Framework Equivalent

System.Windows.Controls.TextElement.FontStretch

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRTextElement
IXRTextElement::SetFontStretch