API referenceFonts

pdfChangeFont

Switch the active font to a previously-created font handle,

CategoryFont selection

Purpose — Switch the active font to a previously-created font handle, without touching size or style.

Declarations

C
BOOL32 __stdcall pdfChangeFont(PPDF IPDF, int32_t Handle);
Delphi
function pdfChangeFont(const IPDF: PPDF; Handle: Integer): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle with an open document.
HandleIntegerA handle from pdfSetFont/pdfLoadFont/pdfReplaceFont.

Return valueTRUE if Handle is in range 1..fontCount; FALSE otherwise.

See alsopdfChangeFontEx

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Fonts
Category

Core

Exported names

pdfChangeFont

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.