| Category | Font introspection |
|---|---|
| Note | TrueType fonts only (see Remarks) |
Purpose — Read basic font-descriptor metrics (ascent/descent/cap-height, em-scaled) and the base font name for a registered font.
Declarations
C
BOOL32 __stdcall pdfGetFontEx(PPDF IPDF, uint32_t Handle, TPDFFontObj* F);
Delphi
function pdfGetFontEx(const IPDF: PPDF; Handle: Cardinal; var F: TPDFFontObj): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | Font handle. |
F | TPDFFontObj* | Receives Ascent/Descent/CapHeight (normalized to em-space, /UnitsPerEm defaulting to 1000 if the font doesn't declare one) and BaseFont (PostScript name, or family name if no PostScript name is present). |
Return value — TRUE only if Handle resolves to a TrueType font entry; FALSE for standard-14, Type 1, or CID-predefined fonts — this call has no data source for those kinds.
Remarks — For a kind-agnostic info query (works for any font kind, with heuristic style detection), use pdfGetFontInfoEx instead.
See also — pdfGetFontMetrics, pdfGetFontInfoEx
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Fonts
Category
Getters
Exported names
pdfGetFontEx
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.