Table of Contents

Class AtlasGroupBuilder

Namespace
KernSmith.Atlas
Assembly
KernSmith.dll

Packs rects from multiple independent glyph sources into a single shared IAtlasPacker pass, then splits the resulting placements back out per source so each can feed its own BmFontModel build.

public static class AtlasGroupBuilder
Inheritance
AtlasGroupBuilder
Inherited Members

Remarks

Id/Id is usually a Unicode codepoint, so two sources (e.g. a primary font and a shadow variant with the same character set) will typically collide on id. This builder mangles each source's ids into a composite id before calling Pack(IReadOnlyList<GlyphRect>, int, int), then restores the original id when splitting results back out. The mangling is entirely internal — callers only ever see original ids.

Methods

Pack(IAtlasPacker, IReadOnlyList<GroupSource>, int, int)

Packs all sources' rects into one shared atlas, then splits the placements back out per source, keyed by each source's own original id.

public static (PackResult Shared, IReadOnlyDictionary<string, IReadOnlyDictionary<int, GlyphPlacement>> PlacementsByTag) Pack(IAtlasPacker packer, IReadOnlyList<AtlasGroupBuilder.GroupSource> sources, int maxWidth, int maxHeight)

Parameters

packer IAtlasPacker

The packer to use for the single combined pack call.

sources IReadOnlyList<AtlasGroupBuilder.GroupSource>

The tagged glyph-rect sources to pack together.

maxWidth int

Max page width in pixels.

maxHeight int

Max page height in pixels.

Returns

(PackResult Shared, IReadOnlyDictionary<string, IReadOnlyDictionary<int, GlyphPlacement>> PlacementsByTag)

The shared PackResult from the single combined pack, plus a placement dictionary per source tag (keyed by that source's original id, with Id restored to the original id).