| Category | Alternate font substitution |
|---|---|
| Note | The A and W variants behave differently — see the chapter note above |
Purpose — Set the ordered list of fallback font names pdfSetFont tries when the requested name isn't found installed on the system.
Declarations
BOOL32 __stdcall pdfSetAltFontsA(PPDF IPDF, uint32_t ListHandle, PPAnsiChar List, uint32_t Count);
BOOL32 __stdcall pdfSetAltFontsW(void* IPDF, uint32_t ListHandle, PPWideChar List, uint32_t Count);
function pdfSetAltFontsA(const IPDF: PPDF; ListHandle: Cardinal; const List: PPAnsiChar; Count: Cardinal): LongBool; stdcall; external 'LumasPdf.dll';
function pdfSetAltFontsW(const IPDF: Pointer; ListHandle: Cardinal; const List: PPWideChar; Count: Cardinal): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF/Pointer | Instance handle. |
ListHandle | Cardinal | Only meaningful for the A variant (targets FAltLists[ListHandle-1], the dead mechanism). Ignored by the W variant, which always writes the single global FAltFontNames regardless of this value. |
List | array of strings | Font names to try, in order. |
Count | Cardinal | Number of entries in List. |
Return value — TRUE on a valid handle and non-nil list; FALSE otherwise. pdfSetAltFontsA's success additionally requires ListHandle to name an existing, non-deleted list from pdfCreateAltFontList — but success here still has no effect on font resolution, per the chapter note.
Remarks — use pdfSetAltFontsW for real substitution. To make alternate-font fallback actually work, call pdfSetAltFontsW — the ListHandle argument can be any value (it's unused); only List/Count matter. Do not build a pdfCreateAltFontList → pdfActivateAltFontList → pdfSetAltFontsA sequence expecting it to influence pdfSetFont — it won't.
See also — pdfCreateAltFontList, pdfSetFont
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetAltFontsW
pdfSetAltFontsA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.