Table of Contents

Class StaticFontAtlas

Namespace
Icy.Rendering.Fonts
Assembly
IcyUI.dll

Represents a read-only texture atlas for static fonts.

public class StaticFontAtlas : IFontAtlas
Inheritance
StaticFontAtlas
Implements
Inherited Members
Extension Methods

Constructors

StaticFontAtlas(IReadOnlyList<ITexture>, FrozenDictionary<StyledGlyphDefinition, FontGlyph>)

Initializes a new instance of the StaticFontAtlas class.

public StaticFontAtlas(IReadOnlyList<ITexture> textures, FrozenDictionary<StyledGlyphDefinition, FontGlyph> glyphs)

Parameters

textures IReadOnlyList<ITexture>

The pre-rendered texture pages.

glyphs FrozenDictionary<StyledGlyphDefinition, FontGlyph>

The glyphs to store in the atlas.

Properties

Glyphs

Gets all glyphs stored in the atlas.

public IReadOnlyDictionary<StyledGlyphDefinition, FontGlyph> Glyphs { get; }

Property Value

IReadOnlyDictionary<StyledGlyphDefinition, FontGlyph>

PageCount

Gets the number of texture pages.

public int PageCount { get; }

Property Value

int

Textures

Gets the font textures.

public IReadOnlyCollection<ITexture> Textures { get; }

Property Value

IReadOnlyCollection<ITexture>

Methods

GetGlyph(StyledGlyphDefinition)

Gets the glyph for a codepoint.

public FontGlyph? GetGlyph(StyledGlyphDefinition glyphDefinition)

Parameters

glyphDefinition StyledGlyphDefinition

Info about glyph codepoint and style to get glyph details for.

Returns

FontGlyph?

The glyph if it exists; otherwise, null.

GetGlyphPage(in FontGlyph)

Gets a page for the glyph with the specified codepoint.

public ITexture GetGlyphPage(in FontGlyph glyph)

Parameters

glyph FontGlyph

Glyph to get atlas page for.

Returns

ITexture

A texture page for the specified glyph.