Table of Contents

Namespace SixLabors.Fonts

Classes

Font

Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.

FontCollection

Represents a collection of font families.

FontCollectionExtensions

Extension methods for IFontCollection.

FontDescription

Provides basic descriptive metadata for the font.

FontException

Base class for exceptions thrown by this library.

FontFamilyNotFoundException

Exception for detailing missing font families.

FontGlyphMetrics

Represents a glyph metric from a particular font face.

FontMetrics

Represents a font face with metrics, which is a set of glyphs with a specific style (regular, italic, bold etc).

FontPalette

Selects the CPAL color palette used to resolve COLR glyph colors and optionally replaces individual palette entries.

A palette index outside the range defined by the font selects the default palette (index 0), and overrides still apply, matching the CSS font-palette behavior. Overrides apply in order, so a later override of the same entry replaces an earlier one, and overrides whose entry index lies outside the font's palette entry range are ignored.

GlyphMissingException

Exception for detailing missing font families.

GlyphOptions

Provides configuration options for rendering a glyph by id.

HorizontalMetrics

Represent the metrics of a font face specific to horizontal text.

InvalidFontFileException

Exception font loading can throw if it encounters invalid data during font loading.

InvalidFontTableException

Exception font loading can throw if it encounters invalid data during font loading.

KnownVariationAxes

Defines the registered design-variation axis tags for variable fonts. These tags are used with FontVariation to control font design axes. https://learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg

LayoutModeExtensions

Extensions to LayoutMode.

LineLayout

Represents one laid-out line from a TextBlock.

LineLayoutEnumerator

Walks a TextBlock one laid-out line at a time.

MissingFontTableException

Exception font loading can throw if it finds a required table is missing during font loading.

SystemFontFallbackResolver

Resolves fallback font families from the fonts installed on the current machine using the operating system's character-to-font matching service. Results depend on the machine's installed fonts: the same input can resolve different families, or none, on different machines.

SystemFonts

Provides a collection of fonts.

TextBlock

Represents text prepared for repeated line layout, measurement, and rendering.

TextDecorationOptions

Represents overrides for the geometry of a single text decoration line, allowing a TextRun to replace the values that would otherwise be derived from the font metrics.

TextMeasurer

Encapsulates logic for laying out and then measuring text properties.

TextMetrics

Encapsulates the full set of measurement results for laid-out text.

TextOptions

Provides configuration options for rendering and shaping text.

TextRun

Represents a run of text spanning a series of graphemes within a string.

TextShaper

Encapsulates logic for shaping text into a positioned glyph stream.

TextShapingBuffer

A reusable, caller-owned buffer holding text, the properties it is shaped under, and the glyphs shaping produces. Text and properties are set on the buffer, the buffer is shaped, and the glyphs are read back from it. Each shaping call replaces the glyphs.

VerticalMetrics

Represent the metrics of a font face specific to vertical text.

Structs

CaretPosition

Represents a caret line in laid-out text.

ClipBounds

Represents a rectangular clipping region as axis-aligned bounds in the design space of the glyph source together with the transform that maps that space to the rendering surface.

FontFamily

Defines a group of type faces having a similar basic design and certain variations in styles.

FontMatch

Represents a font family and style matched for a character.

FontPaletteOverride

Replaces the color of a single palette entry when a FontPalette is applied. An override whose Index lies outside the font's palette entry range is ignored.

FontRectangle

Stores a set of four single precision floating points that represent the location and size of a rectangle.

FontVariation

Represents a single variation axis setting for a variable font, consisting of a four-character tag and a value.

Glyph

Represents a font-specific glyph at the point size used for layout and rendering.

GlyphColor

Provides access to the color details for the current glyph.

GlyphMetrics

Represents one laid-out glyph entry in final layout order.

GraphemeMetrics

Represents one coalesced grapheme in final layout order.

LineMetrics

Encapsulates measured metrics for a single laid-out text line.

ShapedGlyph

Represents a single shaped glyph: the result of substitution and positioning, before line breaking.

TextHit

Represents a hit-tested grapheme position in laid-out text.

TextPlaceholder

Represents an atomic inline placeholder with caller-supplied dimensions.

WordMetrics

Represents the positioned metrics for one Unicode word-boundary segment.

Interfaces

IFontCollection

A readable and writable collection of fonts.

IFontFallbackResolver

Resolves a font family for code points that no configured font can shape. The shaping pipeline consults the resolver only after Font and every FallbackFontFamilies entry have attempted the text, and at most once per distinct unresolved code point per shaping operation.

IMetricsHeader

Defines the contract for the metrics header of a font face.

IReadOnlyFontCollection

Represents a readonly collection of fonts.

IReadOnlySystemFontCollection

Represents a readonly collection of Operating System fonts.

Enums

CaretMovement

Specifies a caret movement operation within laid-out text.

CaretPlacement

Specifies an absolute caret placement within a laid-out text scope.

ColorFontSupport

Specifies which color font formats are enabled for layout and rendering.

DecorationPositioningMode

Defines how text decorations (underline, overline, strikethrough) are positioned relative to font metrics.

FontStyle

The font styles

FontWeight

Identifies the visual weight of a font on the OpenType and CSS weight scale.

GlyphLayoutMode

Provides enumeration for the various layout mode of an individual glyph within a body of text.

GlyphType

Represents the various versions of a glyph records.

HintingMode

Defines modes to determine how to apply hinting. The use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid.

HorizontalAlignment

Horizontal alignment modes.

KerningMode

Kerning is the contextual adjustment of inter-glyph spacing. This property controls metric kerning, kerning that utilizes adjustment data contained in the font.

LayoutMode

Defines modes to determine the layout direction of text.

TextAlignment

Text alignment modes.

TextAttributes

Provides enumeration of various text attributes.

TextBaseline

Specifies which reference line of laid-out text is placed at Origin along the block flow axis, and equivalently which line rides the path when text follows one. Values match the CSS dominant-baseline and HTML canvas textBaseline vocabulary.

TextBidiMode

Specifies how bidirectional text is resolved.

TextDecorationSkipInk

Identifies whether underline and overline decorations are interrupted where they would otherwise cross glyph ink, mirroring the CSS text-decoration-skip-ink property. Strikethrough decorations always cross the ink regardless of this setting.

TextDecorations

Provides enumeration of various text decorations.

TextDirection

Specifies the writing direction for text.

TextEllipsis

Specifies ellipsis behavior when laid-out text is limited to a maximum number of lines.

TextHyphenation

Specifies hyphenation marker behavior when text breaks at hyphenation opportunities.

TextInteractionMode

Specifies how text interaction positions are modeled for laid-out text.

TextJustification

Text justification modes.

TextPlaceholderAlignment

Specifies how an inline placeholder is aligned against surrounding text.

VerticalAlignment

Vertical alignment modes.

WordBreaking

Defines modes to determine when line breaks should appear when words overflow their content box.