DirectWrite Interfaces Reference
This section provides detailed reference information for the interfaces used in the DirectWrite API.
IDWriteFactory
Represents the DirectWrite factory object, which is used to create other DirectWrite objects such as font collections, font mappers, text formats, and text layouts.
Methods
CreateFontCollection
CreateFontFamily
CreateFontFace
CreateFontMapper
CreateGdiFontFallback
CreateNumberSubstitution
CreateRenderingParams
CreateTextAnalysisSession
CreateTextFormat
CreateTextLayout
GetSystemFontCollection
GetSystemFontFallback
GetSystemFontFallbackForFont
RegisterFontCollectionLoader
UnregisterFontCollectionLoader
Remarks
The IDWriteFactory interface is the primary entry point for the DirectWrite API. You obtain an instance of this interface by calling the DWriteCreateFactory function.
IDWriteTextFormat
Represents the properties of text, such as font face, font size, locale, and text alignment.
Methods
SetFontFamilyName
SetFontWeight
SetFontStyle
SetFontStretch
SetFontSize
SetLocaleName
SetTextAlignment
SetParagraphAlignment
SetWordWrapping
SetTextTrimming
SetFontCollection
SetInlineObject
GetFontFamilyName
GetFontWeight
GetFontStyle
GetFontStretch
GetFontSize
GetLocaleName
GetTextAlignment
GetParagraphAlignment
GetWordWrapping
GetTextTrimming
GetFontCollection
GetInlineObject
Remarks
An IDWriteTextFormat object defines how a block of text should be formatted. It's used when creating a text layout.
IDWriteTextLayout
Represents a block of text that has been formatted according to a specified text format and layout options. It is used for rendering text.
Methods
SetMaxWidth
SetMaxHeight
SetFontCollection
SetFontFamily
SetFontWeight
SetFontStyle
SetFontStretch
SetFontSize
SetUnderline
SetStrikethrough
SetDrawingEffect
SetInlineObject
SetTypography
SetGlyphShaping
SetPairKerning
SetCharacterSpacing
SetWordSpacing
SetLineSpacing
SetIncrementalTab
SetTabStops
SetTextAlignment
SetParagraphAlignment
SetParagraphAlignment
SetVerticalTextAlignment
SetReadingDirection
SetFlowDirection
SetFirstLinePrimaryAlignment
SetLastLinePrimaryAlignment
SetDefaultTextAlignment
SetTrim
SetTextShadow
SetOpticalAlignment
SetVerticalGlyphOrientation
SetDigitShapes
SetDigitSubstitution
SetLocale
SetBreakAlignment
SetWrap
SetLineBreakCues
SetTrailingSpaces
SetTrailingHyphen
SetParagraphSpacing
SetLineSpacingMethod
SetClusterMap
SetItalicAngle
SetAutoFit
SetBidirectionalOverride
SetNumberSubstitution
SetOpticalAlignment
SetLayoutBounds
SetTruncation
SetTabStops
GetInlineObject
GetMaxWidth
GetMaxHeight
GetFontCollection
GetFontFamily
GetFontWeight
GetFontStyle
GetFontStretch
GetFontSize
GetUnderline
GetStrikethrough
GetDrawingEffect
GetInlineObject
GetTypography
GetGlyphShaping
GetPairKerning
GetCharacterSpacing
GetWordSpacing
GetLineSpacing
GetIncrementalTab
GetTabStops
GetTextAlignment
GetParagraphAlignment
GetParagraphAlignment
GetVerticalTextAlignment
GetReadingDirection
GetFlowDirection
GetFirstLinePrimaryAlignment
GetLastLinePrimaryAlignment
GetDefaultTextAlignment
GetTrim
GetTextShadow
GetOpticalAlignment
GetVerticalGlyphOrientation
GetDigitShapes
GetDigitSubstitution
GetLocale
GetBreakAlignment
GetWrap
GetLineBreakCues
GetTrailingSpaces
GetTrailingHyphen
GetParagraphSpacing
GetLineSpacingMethod
GetClusterMap
GetItalicAngle
GetAutoFit
GetBidirectionalOverride
GetNumberSubstitution
GetOpticalAlignment
GetLayoutBounds
GetTruncation
GetTabStops
Remarks
The IDWriteTextLayout interface provides rich capabilities for measuring and drawing text, including line breaking, word wrapping, alignment, and applying various formatting effects.
IDWriteTypography
Represents typographic features like stylistic sets, ligatures, and alternates.
Methods
SetFontFeature
GetFontFeature
GetFontFeatureCount
Remarks
Use IDWriteTypography to control advanced typographic features of a font.
IDWriteGlyphRunAnalysis
Analyzes a glyph run to determine geometric properties and optimize rendering.
Methods
GetGlyphAdvances
GetGlyphPlacements
GetAlphaBlend
GetPixelSnappingBehavior
GetScaleX
GetScaleY
GetVerticalGlyphOrientation
Remarks
This interface is typically used internally by DirectWrite or by advanced rendering applications to gain fine-grained control over glyph rendering.