IDWriteTextAnalyzer1::GetBaseline method (dwrite_1.h)

Retrieves the given baseline from the font.

Syntax

HRESULT GetBaseline(
                 IDWriteFontFace        *fontFace,
                 DWRITE_BASELINE        baseline,
                 BOOL                   isVertical,
                 BOOL                   isSimulationAllowed,
                 DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
  [in, optional] WCHAR const            *localeName,
  [out]          INT32                  *baselineCoordinate,
  [out]          BOOL                   *exists
);

Parameters

fontFace

Type: IDWriteFontFace*

The font face to read.

baseline

Type: DWRITE_BASELINE

A DWRITE_BASELINE-typed value that specifies the baseline of interest.

isVertical

Type: BOOL

Whether the baseline is vertical or horizontal.

isSimulationAllowed

Type: BOOL

Simulate the baseline if it is missing in the font.

scriptAnalysis

Type: DWRITE_SCRIPT_ANALYSIS

Script analysis result from AnalyzeScript.

Note  You can pass an empty script analysis structure, like this DWRITE_SCRIPT_ANALYSIS scriptAnalysis = {};, and this method will return the default baseline.
 

[in, optional] localeName

Type: const WCHAR*

The language of the run.

[out] baselineCoordinate

Type: INT32*

The baseline coordinate value in design units.

[out] exists

Type: BOOL*

Whether the returned baseline exists in the font.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If the baseline does not exist in the font, it is not considered an error, but the function will return exists = false. You may then use heuristics to calculate the missing base, or, if the flag simulationAllowed is true, the function will compute a reasonable approximation for you.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header dwrite_1.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteTextAnalyzer1