API referenceFonts

fntCmapGID

Map a Unicode code point to a glyph ID using a TrueType

CategoryStandalone TrueType parsing
Notedocument-independent

Purpose — Map a Unicode code point to a glyph ID using a TrueType font's cmap table, given the font's raw bytes directly.

Description — Takes no IPDF/PFNT at all — pass the bytes of any .ttf/.otf file you have in memory.

Declarations

C
int32_t __stdcall fntCmapGID(uint8_t* pTTF, uint32_t Len, uint32_t CodePoint);
Delphi
function fntCmapGID(pTTF: PByte; Len, CodePoint: Cardinal): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
pTTFPByteRaw TrueType/OpenType font file bytes.
LenCardinalByte length of pTTF.
CodePointCardinalUnicode code point (BMP range — Word-truncated internally).

Return value — Glyph ID (> 0) if found; 0 if pTTF is NULL/empty or the code point has no glyph.

See alsofntGlyfOutline

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int fntCmapGID(byte[] pTTF, uint Len, uint CodePoint);
Area
Fonts
Category

Font Services

Exported names

fntCmapGID

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.