GetFontGlyphOutline

Text, fonts, vector paths

Description

Extracts a simple or composite TrueType glyph as move, line, quadratic-curve and close commands together with its unscaled metrics

Syntax

Delphi

Function TPDFlib.GetFontGlyphOutline(FontID, GlyphIndex: Integer; Out Path: TPDFlibGlyphPath; Out Metrics: TPDFlibGlyphMetrics): Integer;

Parameters

FontIDA font handle returned by a font creation or loading API
GlyphIndexThe zero-based glyph index, commonly obtained from GetFontGlyphIndex
PathReceives the ordered glyph path commands
MetricsReceives the advance, left side bearing, bounding box and units per em

Return values

Returns 1 when the glyph and metrics are available or 0 when the handle, index or font program is unsupported; output values are cleared on failure

Remarks

Coordinates remain in the font's native units with the positive Y axis pointing upwards; divide by UnitsPerEm and multiply by the target text size to scale them

TrueType glyf outlines from TTF, TTC and OpenType-TT programs are supported; CFF, CFF2, Type 1 and Type 3 outlines are not returned by this API

Composite glyphs with XY component offsets, uniform or independent scaling and two-by-two transforms are expanded recursively; point-aligned component arguments are rejected because they require contour-point attachment

An empty glyph can succeed with zero path commands while still returning its metrics

See also

GetFontGlyphIndex, TPDFlibGlyphPath, TPDFlibGlyphMetrics