DirectWrite API Reference

This section provides detailed reference information for the DirectWrite API, covering interfaces, structures, enumerations, and functions used for high-quality typography in Windows.

Interfaces

IDWriteFactory

interface IDWriteFactory : IUnknown

The factory object is the entry point for DirectWrite. It's used to create other DirectWrite objects, such as text formats, text layouts, and renderers.

Remarks: Create this object using DWriteCreateFactory.

IDWriteTextFormat

interface IDWriteTextFormat : IUnknown

Represents the text formatting information, such as font family, font size, font weight, font style, and paragraph alignment.

IDWriteTextLayout

interface IDWriteTextLayout : IDWriteTextAnalysisSink

Represents a block of text that is analyzed and laid out, enabling rich text formatting and complex script shaping.

IDWriteGlyphRunAnalysis

interface IDWriteGlyphRunAnalysis : IUnknown

Provides information about a glyph run, such as its font face, rendering mode, and transformations.

IDWriteTextRenderer

interface IDWriteTextRenderer : IUnknown

An abstract interface implemented by the application to receive drawing commands for rendering text.

Structures

DWRITE_FONT_METRICS

struct DWRITE_FONT_METRICS

Contains font-wide metrics. These metrics are logical values that do not depend on the specific device or scaling factor.

DWRITE_TEXT_RANGE

struct DWRITE_TEXT_RANGE

Specifies a range of characters within a text string.

DWRITE_RECT

struct DWRITE_RECT

Specifies a rectangular area using the coordinates of the top-left and bottom-right corners.

Enumerations

DWRITE_FONT_WEIGHT

enum DWRITE_FONT_WEIGHT

Specifies the weight (boldness) of a font.

DWRITE_FONT_STYLE

enum DWRITE_FONT_STYLE

Specifies the style of a font (normal, italic, or oblique).

DWRITE_TEXT_ALIGNMENT

enum DWRITE_TEXT_ALIGNMENT

Specifies the horizontal text alignment relative to the layout box.