| Category | Glyph coverage testing |
|---|---|
| Exported names | pdfTestGlyphsA, pdfTestGlyphsW |
| Note | real 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
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);
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
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
FontHandle | Integer | Font to test against (this call, unlike the glyph-index/outline calls above, does take an explicit handle). |
Text | string | Text to test. |
Return value — Count of missing characters (0 = fully covered).
See also — pdfTestGlyphsEx, pdfGetMissingGlyphs
C# (P/Invoke)
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);
Core
pdfTestGlyphsA
pdfTestGlyphsW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.