API referenceFonts

pdfTestGlyphs

Count (and record) how many characters in Text have no

CategoryGlyph coverage testing
Exported namespdfTestGlyphsA, pdfTestGlyphsW
Notereal per-font-kind coverage logic

Purpose — Count (and record) how many characters in Text have no glyph in the given font.

Description — real, kind-specific coverage checking. For a TrueType font: a real cmap lookup per character. For a standard-14 font: WinAnsi (CP1252) range coverage — everything in ASCII, Latin-1 supplement, and the CP1252 0x80-0x9F special slots counts as present; anything else (CJK, Cyrillic, Greek, etc.) counts as missing — except Symbol/ ZapfDingbats, which are conservatively assumed to fully cover the text (this engine has no coverage table for their special charsets, so it avoids false "missing" reports). For a Type 1 or CID-predefined font, or an unrecognized FontHandle: also assumed fully covered (no coverage data available). The missing code points are stored for retrieval via pdfGetMissingGlyphs.

Declarations

C
int32_t __stdcall pdfTestGlyphsA(PPDF IPDF, int32_t FontHandle, const char* Text);
int32_t __stdcall pdfTestGlyphsW(PPDF IPDF, int32_t FontHandle, const wchar_t* Text);
Delphi
function pdfTestGlyphsA(const IPDF: PPDF; FontHandle: Integer; const Text: PAnsiChar): Integer; stdcall; external 'LumasPdf.dll';
function pdfTestGlyphsW(const IPDF: PPDF; FontHandle: Integer; const Text: PWideChar): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
FontHandleIntegerFont to test against (this call, unlike the glyph-index/outline calls above, does take an explicit handle).
TextstringText to test.

Return value — Count of missing characters (0 = fully covered).

See alsopdfTestGlyphsEx, pdfGetMissingGlyphs

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfTestGlyphsA(IntPtr IPDF, int FontHandle, [MarshalAs(UnmanagedType.LPStr)] string Text);
public static extern int pdfTestGlyphsW(IntPtr IPDF, int FontHandle, [MarshalAs(UnmanagedType.LPWStr)] string Text);
Area
Fonts
Category

Core

Exported names

pdfTestGlyphsA pdfTestGlyphsW

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.