API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classGlyphAtlas

@codexo/exojs / rendering / stable

A per-font-variant glyph atlas with automatic multi-page growth. In `'sdf'` mode (default) each atlas page is a single-channel R8 `DataTexture` populated by GlyphSdf. One `GlyphSdf` instance is kept per font size so the atlas can mix sizes efficiently. In `'color'` mode pages are RGBA canvas textures that preserve full glyph colour data for emoji and colour fonts.

2
props
3
methods
1
events
Import
import { GlyphAtlas } from '@codexo/exojs'

A per-font-variant glyph atlas with automatic multi-page growth.

In `'sdf'` mode (default) each atlas page is a single-channel R8 `DataTexture` populated by GlyphSdf. One `GlyphSdf` instance is kept per font size so the atlas can mix sizes efficiently.

In `'color'` mode pages are RGBA canvas textures that preserve full glyph colour data for emoji and colour fonts.

Constructors 1
new(family: string, fontStyle: "normal" | "italic", fontWeight: string, pageSize: number, mode: AtlasMode, sdfRadius: number): GlyphAtlas
Methods 3
clear(): void
getGlyph(char: string, size: number): GlyphInfo
getKerning(prev: string, next: string, fontSize: number): number
Properties 2
mode: AtlasMode
pages: readonly AtlasPage[]
Events 1
onPageAdded: Signal<[pageIndex]>
Source