Back to API Reference
Class

BoldModifier

Inherits:PooledAttributeModifier<ushort>

Applies bold styling to text using the CSS font-weight scale (1-1000).

Remarks

First parameter: CSS font-weight 1-1000; 0 or omitted = auto (max(700, baseWeight+300)). Second parameter — mode: f (<b=700,f>) keeps the current real face and supplies any missing weight synthetically (SDF dilate + advance correction); r (<b=700,r>) uses a real bold face only, staying at the natural weight when none matches. Default (no mode) prefers a real face — Font Family static cut or variable wght axis — and synthesizes only as a fallback. One buffer carries both: the top 2 bits select the mode, the low 10 bits the weight.
public int Weight{ get; set }

CSS font-weight 1–1000, or 0 (the default) for auto — max(700, base weight + 300), so bold never falls below the font's own weight. Any explicit 1–1000 (including 700) is honoured exactly. A per-range value overrides it.

public BoldMode Mode{ get; set }

How bold is realized. A per-range value overrides it; this is the default for a bare tag or whole-text use.

protected string AttributeKey{ get }
protected override AttributeChannel CreateChannel()
protected override void OnApply()