PDFium Delphi Component Docs

TextObjectGlyphOutline method

Component: TPdf  ·  Unit: PDFium
Read the vector outline of one glyph of a text object.

Syntax

function TextObjectGlyphOutline(Index: Integer; GlyphIndex: Integer; FontSize: Single): TPdfPathSegments;

IndexInteger. Zero-based index of a text page object.
GlyphIndexInteger. Font glyph id, not a character code. A caller that starts from text has to map characters to glyphs first.
FontSizeSingle. Passed through to PDFium because its signature takes one; it does not scale the result.
ResultTPdfPathSegments. Path segments that draw the glyph, or an empty array when the font exposes no outline for it.

Description

Turns a glyph into the path segments that draw it, which is what converting text to vector art needs, and what makes a font substitution visible: the outline reflects the face actually used, not the face the document names

The returned points are in the design space of the font, normalised so that one em is 1.0 - measured rather than assumed, because the same glyph returns identical coordinates at 12pt and at 24pt. A caller that wants device units multiplies by the point size itself

An empty result is not an error. Bitmap-only fonts and the .notdef glyph both land there

See Also

AddText, PathInfo, FontHandle, PageObjectInfo