class
Tessell::Text::GlyphAtlas
- Tessell::Text::GlyphAtlas
- Reference
- Object
Defined in:
tessell/text/glyph_atlas.crConstructors
Instance Method Summary
- #begin_frame : Nil
- #capacity : Int32
- #clear : Nil
- #end_frame : Nil
- #evict_lru(count : Int32 = 1) : Int32
- #evicted_total : Int32
- #in_frame? : Bool
- #insert(key : GlyphKey, w : Int32, h : Int32, bearing_x : Int32 = 0, bearing_y : Int32 = 0, advance : Float32 = 0.0_f32) : GlyphSlot
-
#insert_rgba(key : GlyphKey, w : Int32, h : Int32, bearing_x : Int32 = 0, bearing_y : Int32 = 0, advance : Float32 = 0.0_f32) : GlyphSlot
Color-glyph insert into an RGBA page.
- #invalidate_font(font_id : Int32) : Int32
- #lookup(key : GlyphKey, color : Bool = false) : GlyphSlot | Nil
- #page_count : Int32
- #page_data(page : Int32) : Bytes
- #page_revision(page : Int32) : UInt64
- #page_size : Int32
-
#revision : UInt64
Monotonic atlas-wide content version.
- #rgba_page_count : Int32
- #rgba_page_data(page : Int32) : Bytes
- #rgba_page_revision(page : Int32) : UInt64
- #slot_rect(slot : GlyphSlot) : NamedTuple(x: Int32, y: Int32, w: Int32, h: Int32)
- #used_pixels : Int32
- #waste_ratio : Float64
Constructor Detail
Instance Method Detail
def insert(key : GlyphKey, w : Int32, h : Int32, bearing_x : Int32 = 0, bearing_y : Int32 = 0, advance : Float32 = 0.0_f32) : GlyphSlot
#
def insert_rgba(key : GlyphKey, w : Int32, h : Int32, bearing_x : Int32 = 0, bearing_y : Int32 = 0, advance : Float32 = 0.0_f32) : GlyphSlot
#
Color-glyph insert into an RGBA page. Same duplicate-key/idempotent and zero-size rules as insert; page indices address @rgba_pages only.
def revision : UInt64
#
Monotonic atlas-wide content version. Bumped whenever any page's pixels change (glyph inserted into an existing page included). This is the only reliable "did the atlas content change" signal for GPU sync.