BLGlyphRun Struct Reference

BLGlyphRun describes a set of consecutive glyphs and their placements.

BLGlyphRun should only be used to pass glyph IDs and their placements to the rendering context. The purpose of BLGlyphRun is to allow rendering glyphs, which could be shaped by various shaping engines (Blend2D, Harfbuzz, etc).

BLGlyphRun allows to render glyphs that are either stored in uint16_t[] or uint32_t[] array or part of a bigger structure (for example hb_glyph_info_t used by HarfBuzz). Glyph placements at the moment use Blend2D's BLGlyphPlacement or BLPoint, but it's possible to extend the data type in the future.

See BLGlyphRunPlacement for placement modes provided by Blend2D.

Public Members


Member Functions

Common Functionality

Member Data Documentation

void* BLGlyphRun::glyphData

Glyph id data (abstract, incremented by glyphAdvance).

void* BLGlyphRun::placementData

Glyph placement data (abstract, incremented by placementAdvance).

size_t BLGlyphRun::size

Size of the glyph-run in glyph units.

uint8_t BLGlyphRun::glyphSize

Size of a glyphId - must be either 2 (uint16_t) or 4 (uint32_t) bytes.

Blend2D always uses 32-bit glyph-ids, thus the glyph-run returned by BLGlyphBuffer has always set glyphSize to 4. The possibility to render glyphs of size 2 is strictly for compatibility with text shapers that use 16-bit glyphs, which is sufficient for TrueType and OpenType fonts.

uint8_t BLGlyphRun::placementType

Type of placement, see BLGlyphPlacementType.

int8_t BLGlyphRun::glyphAdvance

Advance of glyphData array.

int8_t BLGlyphRun::placementAdvance

Advance of placementData array.

uint32_t BLGlyphRun::flags

Glyph-run flags.