API referenceFonts

pdfGetFontMetrics

Read the fuller metrics set: ascent, descent, cap-height,

CategoryFont introspection

Purpose — Read the fuller metrics set: ascent, descent, cap-height, x-height, underline position/thickness, leading, max advance width, italic angle, and missing-width default.

Declarations

C
BOOL32 __stdcall pdfGetFontMetrics(PPDF IPDF, uint32_t Handle, TPDFFontMetrics* Metrics);
Delphi
function pdfGetFontMetrics(const IPDF: PPDF; Handle: Cardinal; var Metrics: TPDFFontMetrics): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalFont handle (works across font kinds, unlike pdfGetFontEx).
MetricsTPDFFontMetrics*Receives the full metrics set.

Return valueTRUE if Handle is valid; FALSE otherwise.

See alsopdfGetFontEx

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Fonts
Category

Getters

Exported names

pdfGetFontMetrics

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.