GetFontColorGlyph

Text, fonts, colour glyphs

Description

Maps a Unicode code point through the selected TrueType or OpenType font and returns its COLR paint graph, SVG document or embedded bitmap payload

Syntax

Delphi

Function TPDFlib.GetFontColorGlyph(FontID: Integer; CodePoint: Cardinal; PaletteIndex, PreferredPPEM: Integer; Out Glyph: TPDFlibColorGlyph): Integer;

Parameters

FontIDA font handle returned by a font creation or loading API
CodePointA Unicode scalar value from 0 through $10FFFF
PaletteIndexThe zero-based CPAL palette to resolve, with an invalid value falling back to palette zero
PreferredPPEMThe desired bitmap strike size, or 0 to choose the largest available strike
GlyphReceives the colour format, mapped glyph index, description and optional binary payload

Return values

Returns 1 when a supported colour representation exists or 0 when the font, code point or colour tables cannot provide one; output values are cleared on failure

Remarks

COLR version 0 layers and COLR version 1 paint graphs include resolved CPAL colours in DescriptionJSON, including transforms, gradients and compositing nodes

SVG-in-OpenType returns the exact SVG document in Data; gzip-compressed documents use image/svg+xml+gzip so the caller can distinguish compressed bytes without content guessing

sbix and CBDT/CBLC choose the closest requested strike and return PNG, JPEG, TIFF or raw OpenType bitmap data with its MIME type and pixels-per-em metadata

See also

GetFontColorGlyphByIndex, TPDFlibColorGlyph, TPDFlibColorGlyphKind