GetFontColorGlyphByIndex

Text, fonts, colour glyphs

Description

Returns the COLR, SVG-in-OpenType, sbix or CBDT/CBLC representation attached to a zero-based glyph index

Syntax

Delphi

Function TPDFlib.GetFontColorGlyphByIndex(FontID, GlyphIndex, PaletteIndex, PreferredPPEM: Integer; Out Glyph: TPDFlibColorGlyph): Integer;

Parameters

FontIDA font handle returned by a font creation or loading API
GlyphIndexThe zero-based OpenType glyph index
PaletteIndexThe zero-based CPAL palette to resolve
PreferredPPEMThe desired bitmap strike size, or 0 for the largest strike
GlyphReceives the colour representation and optional payload

Return values

Returns 1 when colour data exists or 0 when the handle, glyph index or colour tables are unsupported

Remarks

This overload avoids a second cmap lookup when a shaping engine or previous inspection call already supplied the glyph index

The lightweight colour-table reader is retained under the shared font-cache byte budget and is reused by both colour-glyph entry points

See also

GetFontColorGlyph, GetFontGlyphIndex, GetFontCacheInfo