| Category | Font state (non-functional) |
|---|---|
| Availability | Non-functional (write-only) — see the chapter's recurring no-op pattern |
Purpose — Nominally: hint a numeric font weight (e.g. 100–900) for the active/next font.
Description — accepted but not applied. Stores Weight into FFontWeight and always returns TRUE. That field is never consulted by the font resolver (pdfSetFont's chain), the bold-synthesis logic, or any serializer — it does not influence which font file is chosen, whether bold is synthesized, or any /FontDescriptor /StemV/weight value written to the output. This is the same "reports-success, does-nothing" pattern as pdfSetTextShader and the pdfSetExt*ColorSpace family.
Declarations
BOOL32 __stdcall pdfSetFontWeight(PPDF IPDF, int32_t Weight);
function pdfSetFontWeight(const IPDF: PPDF; Weight: Integer): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Weight | Integer | Accepted and stored; has no effect on font selection or output. |
Return value — Always TRUE on a valid handle.
Remarks — To actually get bold text, use the style-bit mechanism documented under pdfSetFontEx/ pdfChangeFontStyle (Style bit 0), not this call.
See also — pdfGetFontWeight
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetFontWeight
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.