API referenceFonts

pdfSetFontWeight

Nominally: hint a numeric font weight (e.g. 100–900) for the

CategoryFont state (non-functional)
AvailabilityNon-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

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

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
WeightIntegerAccepted 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 alsopdfGetFontWeight

C# (P/Invoke)

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

Setters

Exported names

pdfSetFontWeight

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.