| Category | Font selection |
|---|---|
| Note | Style here uses the correct convention (see Remarks); Embed/CP still unused |
Purpose — Same resolution chain as pdfSetFont, with Style typed as a plain Integer rather than TFStyle.
Description — Identical implementation to pdfSetFontA/W — the only difference is the ABI's declared type for Style.
Declarations
int32_t __stdcall pdfSetFontExA(PPDF IPDF, const char* Name, int32_t Style, double Size, BOOL32 Embed, TCodepage CP);
int32_t __stdcall pdfSetFontExW(PPDF IPDF, const wchar_t* Name, int32_t Style, double Size, BOOL32 Embed, TCodepage CP);
function pdfSetFontExA(const IPDF: PPDF; const Name: PAnsiChar; Style: Integer; Size: Double; Embed: LongBool; CP: TCodepage): Integer; stdcall; external 'LumasPdf.dll';
function pdfSetFontExW(const IPDF: PPDF; const Name: PWideChar; Style: Integer; Size: Double; Embed: LongBool; CP: TCodepage): Integer; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Name | string | Font family/PostScript name. |
Style | Integer | The correct convention for this implementation: 0=regular, 1=bold, 2=italic, 3=bold+italic. Because this parameter is typed as plain Integer (not TFStyle) in the ABI, using the simple bit values here is consistent with the type — the mismatch documented for pdfSetFontA/W is really about that entry point's misleading TFStyle type, not about this function. |
Size | Double | Point size. |
Embed | BOOL32 | Accepted but not read — same as pdfSetFont. |
CP | TCodepage | Accepted but not read — same as pdfSetFont. |
Return value — Same semantics as pdfSetFont.
Remarks — Prefer this entry point over pdfSetFontA/W when you need programmatic bold/italic selection, precisely because its Integer typing matches what the implementation actually checks.
See also — pdfSetFont
C# (P/Invoke)
public static extern int pdfSetFontExA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, int Style, double Size, [MarshalAs(UnmanagedType.Bool)] bool Embed, TCodepage CP);
public static extern int pdfSetFontExW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string Name, int Style, double Size, [MarshalAs(UnmanagedType.Bool)] bool Embed, TCodepage CP);
Setters
pdfSetFontExA
pdfSetFontExW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.