API referenceFonts

pdfChangeFontEx

Switch to a font handle and apply a new size and style in

CategoryFont selection

Purpose — Switch to a font handle and apply a new size and style in one call.

Description — Switches first; if that succeeds, applies FontSize (via pdfChangeFontSize's logic) then Style (via pdfChangeFontStyle's logic — same bit-convention caveat applies to Style here as documented in the chapter-level warning, since Style: TFStyle on this entry point too).

Declarations

C
BOOL32 __stdcall pdfChangeFontEx(PPDF IPDF, int32_t Handle, double FontSize, TFStyle Style);
Delphi
function pdfChangeFontEx(const IPDF: PPDF; Handle: Integer; FontSize: Double; Style: TFStyle): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleIntegerTarget font handle.
FontSizeDoubleNew size; <= 0 is silently ignored (previous size kept).
StyleTFStyleSame bit-0=Bold/bit-1=Italic convention as pdfChangeFontStyle — see the chapter warning.

Return valueTRUE if Handle was valid; FALSE otherwise. (Once the handle switch succeeds, the size/style applications cannot themselves cause this call to report failure.)

See alsopdfChangeFont

C# (P/Invoke)

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

Core

Exported names

pdfChangeFontEx

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.