SlugGlyphMap

class SlugGlyphMap(val slugMap: SlugMap, glyphs: MutableMap<Int, Int> = mutableMapOf()) : BoundaryGlyphMap(source)

Caches the slugs of glyphs in a SlugMap, each glyph of a face is added to slugMap once.

Constructors

Link copied to clipboard
constructor(slugMap: SlugMap, glyphs: MutableMap<Int, Int> = mutableMapOf())

Properties

Link copied to clipboard

the boundary indices of glyphs, by a hash of their face and glyph index

Link copied to clipboard

the map the boundaries of glyphs are added to

Link copied to clipboard

the SlugMap instance used to manage and store slugs.

Functions

Link copied to clipboard
fun endBatch()

Ends the batch started by startBatch and uploads the added glyphs

Link copied to clipboard
fun getBoundaryForGlyphIndex(face: Face, index: Int): Int

Returns the boundary index of the glyph at index in face, adding the glyph to map when it is not in it yet

Link copied to clipboard
fun getGlyph(face: Face, char: Char): Int

Returns the boundary index of the glyph for char in face

Link copied to clipboard
fun getSlugForGlyphIndex(face: Face, index: Int): Int

Returns the slug of the glyph at index in face, adding the glyph to slugMap when it is not in it yet

Link copied to clipboard

Starts a batch in map, glyphs added until endBatch is called are uploaded to the GPU at once