pub struct BridgeOptions {
pub code_block_background: [f32; 4],
pub code_block_foreground: Option<[f32; 4]>,
pub link_foreground: Option<[f32; 4]>,
pub echo_char: Option<char>,
pub hyphenate_justified: bool,
}Expand description
Per-call knobs threaded through the conversion functions so that a host widget can override defaults driven by its active theme.
Default values reproduce the historical pre-themed behaviour: a light-grey card behind fenced code blocks and no foreground override for monospaced runs.
Fields§
§code_block_background: [f32; 4]Background painted behind blocks where BlockFormat.is_code_block == Some(true) AND the block carries no explicit
background_color. Has no effect on prose blocks or blocks that
set their own background.
code_block_foreground: Option<[f32; 4]>Foreground used for character runs whose font family resolves
to monospace (set by the markdown importer for inline code
spans and by is_code_block blocks). None keeps the
engine-level default text colour. Only applied when the run
carries no explicit foreground_color.
link_foreground: Option<[f32; 4]>Foreground used for character runs carrying a hyperlink
(TextFormat.is_anchor == Some(true)). None keeps the
engine-level default text colour — which is what a host that
never sets this gets, so a link stays indistinguishable from
prose unless the host says otherwise.
Only applied when the run carries no explicit foreground_color,
the same rule code_block_foreground follows: an author who
picked a colour always wins over a convention.
Wins over code_block_foreground when a run is both, because
“you can follow this” is the more useful of the two signals.
echo_char: Option<char>When Some(c), every character of every block laid out with
these options is replaced with c — one echo char per source
char — before shaping. This is the password / secure-field
masking path: the real text never reaches the shaper or the
glyph atlas, only the echo character does. Emitting one echo per
source char (not per grapheme) preserves char counts, so the
engine’s char-indexed caret / selection / hit-test stay aligned
with the host document’s positions. None (default) lays text
out verbatim.
hyphenate_justified: boolWhen true, blocks that are justified and don’t set the
hyphenate flag explicitly are hyphenated automatically (in the
block’s language, defaulting to English). This pairs hyphenation
with justification — its primary use case — without requiring a
per-block flag. An explicit BlockFormat.hyphenate (true or false)
always wins. Hosts should enable this only for prose/rich-text
surfaces, not single-line/label widgets. false by default.