Table of Contents

Class GlyphPathCollection

Namespace
SixLabors.ImageSharp.Drawing.Text
Assembly
SixLabors.ImageSharp.Drawing.dll

A geometry + paint container for a single glyph, preserving painted layer boundaries.

public sealed class GlyphPathCollection
Inheritance
GlyphPathCollection
Inherited Members

Properties

Bounds

Gets an axis-aligned bounding box of the entire glyph in device space.

public RectangleF Bounds { get; }

Property Value

RectangleF

LayerCount

Gets the number of layers.

public int LayerCount { get; }

Property Value

int

Layers

Gets a read-only list of layer descriptors preserving paint, fill rule and path spans.

public IReadOnlyList<GlyphLayerInfo> Layers { get; }

Property Value

IReadOnlyList<GlyphLayerInfo>

PathList

Gets a read-only view of all individual paths in z-order.

public IReadOnlyList<IPath> PathList { get; }

Property Value

IReadOnlyList<IPath>

Paths

Gets the flattened geometry for the glyph (all paths in z-order). This is equivalent to concatenating all layer spans.

public IPathCollection Paths { get; }

Property Value

IPathCollection

Methods

GetLayerPaths(int)

Gets a PathCollection view of a single layer's geometry.

public PathCollection GetLayerPaths(int layerIndex)

Parameters

layerIndex int

The zero-based layer index.

Returns

PathCollection

A path collection comprising only that layer's span.

ToPathCollection(Func<GlyphLayerInfo, bool>?)

Creates a PathCollection containing only the paths from layers that satisfy predicate. Useful to project to monochrome.

public PathCollection ToPathCollection(Func<GlyphLayerInfo, bool>? predicate = null)

Parameters

predicate Func<GlyphLayerInfo, bool>

A filter deciding whether to keep a layer.

Returns

PathCollection

A new PathCollection with the selected paths.

Transform(Matrix4x4)

Transforms the glyph using the specified matrix.

public GlyphPathCollection Transform(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The transform matrix.

Returns

GlyphPathCollection

A new GlyphPathCollection with the matrix applied to it.