Compartir a través de


IXRTextElement::GetFontWeight (Compact 2013)

3/28/2014

This method retrieves the top-level font weight for this text element.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetFontWeight(
    __out XRFontWeight* pFontWeight
) = 0;

Parameters

  • pFontWeight
    [out] Pointer to an XRFontWeight enumerated type that indicates the top-level font weight for the text element.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

The value of pFontWeight applies only to fonts that already exist in a font family. It does not programmatically create alternative weights, except when a family contains a regular weight and no bold weight. In this case, XAML for Windows Embedded simulates a bold weight by increasing the width of the strokes using a two-dimensional graphic algorithm.

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

When you use this method in the derived class IXRRun, specifying a different font weight value for a <Run> element in the source XAML overrides this top-level setting.

.NET Framework Equivalent

System.Windows.Documents.TextElement.FontWeight

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRTextElement
IXRTextElement::SetFontWeight