Class StaticFontAtlas
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
texturesIReadOnlyList<ITexture>The pre-rendered texture pages.
glyphsFrozenDictionary<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
PageCount
Gets the number of texture pages.
public int PageCount { get; }
Property Value
Textures
Gets the font textures.
public IReadOnlyCollection<ITexture> Textures { get; }
Property Value
Methods
GetGlyph(StyledGlyphDefinition)
Gets the glyph for a codepoint.
public FontGlyph? GetGlyph(StyledGlyphDefinition glyphDefinition)
Parameters
glyphDefinitionStyledGlyphDefinitionInfo about glyph codepoint and style to get glyph details for.
Returns
GetGlyphPage(in FontGlyph)
Gets a page for the glyph with the specified codepoint.
public ITexture GetGlyphPage(in FontGlyph glyph)
Parameters
glyphFontGlyphGlyph to get atlas page for.
Returns
- ITexture
A texture page for the specified glyph.