DirectWrite API Reference
DirectWrite is a text rendering and formatting API that provides high-performance, high-quality text rendering suitable for user interfaces, documents, and other display scenarios. It offers advanced typography features and integrates seamlessly with other Windows graphics technologies.
Core Interfaces
Explore the fundamental interfaces that form the backbone of DirectWrite functionality.
IDWriteFactory
The factory object is the primary entry point for creating other DirectWrite objects, such as text formats, text layout objects, and more.
CreateTextFormatCreateTypographyCreateRenderingParams
IDWriteTextFormat
Represents the formatting of a block of text, including font properties, paragraph alignment, and text wrapping.
GetFontFamilyNameGetFontWeightGetFontSizeGetParagraphAlignmentGetTextAlignment
IDWriteTextLayout
An object that represents a paragraph of text with layout properties applied. It can be used to draw text and query layout information.
DrawDetermineTextBoundsHitTestTextPosition
IDWriteGlyphRun
Represents a run of glyphs that share the same font, orientation, and other properties. This is a fundamental unit for rendering.
fontFacefontEmSizeglyphCountglyphIndicesglyphAdvances
Typography and Advanced Features
Leverage DirectWrite's powerful typography features for sophisticated text rendering.
IDWriteTypography
Represents a set of OpenType typography features that can be applied to text.
AddFontFeatureAddFontVariation
OpenType Features
DirectWrite supports a wide range of OpenType features, including:
- Ligatures (
DWRITE_FONT_FEATURE_TAG_LIGATURES) - Stylistic sets (
DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET) - Swashes (
DWRITE_FONT_FEATURE_TAG_SWASH) - Contextual alternates (
DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES)
Rendering and Measurement
Understand how to render text and obtain accurate layout metrics.
IDWriteTextRenderer
An abstract interface that you implement to draw text using DirectWrite. You typically implement this in conjunction with Direct2D.
DrawGlyphRunDrawUnderlineDrawStrikethrough