API referenceCore SDK

pdfGetKerning

Look up the kerning adjustment for a specific character

C
int32_t __stdcall pdfGetKerningA(PPDF IPDF, const char* CharPair);
int32_t __stdcall pdfGetKerningW(PPDF IPDF, const wchar_t* CharPair);
int32_t __stdcall pdfUseKerning(PPDF IPDF, int32_t Kern);
Delphi
function pdfGetKerningA(const IPDF: PPDF; CharPair: PAnsiChar): Integer; stdcall;
function pdfGetKerningW(const IPDF: PPDF; CharPair: PWideChar): Integer; stdcall;
function pdfUseKerning(const IPDF: PPDF; Kern: Integer): Integer; stdcall;

Purpose. Look up the kerning adjustment for a specific character pair in the current font; enable/disable automatic kerning application.

Description. Known limitations for both. pdfGetKerningA/W always returns 0 regardless of CharPair — per an explicit source comment on the underlying GetKerningPair: "no kern-pair data available in the current font model." pdfUseKerning stores its flag (FUseKerning) but the field is known to have no read-site anywhere — no text-writing code path consults it, so automatic kerning is never actually applied or suppressed by this call regardless of value.

Parameters.

ParameterDescription
IPDFDocument handle.
CharPair*(GetKerning only)* The 2-character pair to look up — never resolves to a non-zero value.
Kern*(UseKerning only)* Stored but never consulted.

Return value. pdfGetKerning: always 0 for a valid IPDF (no kerning data exists to look up). pdfUseKerning: 1 if IPDF valid.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetKerningW(IntPtr IPDF, IntPtr CharPair);
public static extern int pdfGetKerning(IntPtr IPDF, IntPtr CharPair);
public static extern int pdfGetKerningA(IntPtr IPDF, IntPtr CharPair);
Area
Core SDK
Category

Getters

Exported names

pdfGetKerningW pdfGetKerning pdfGetKerningA

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.