Skip to main content

Hyphenator

Trait Hyphenator 

pub trait Hyphenator: Send + Sync {
    // Required methods
    fn breaks(&self, text: &str) -> Vec<usize>;
    fn cache_key(&self) -> u64;
}
Expand description

Paragraph hyphenation policy. It is deliberately opt-in: short UI labels and identifiers should never acquire language-dependent line endings, while reading text can request TeX/Liang patterns with a BCP-47 language tag. Application-supplied discretionary hyphenation. Returned offsets are in the original UTF-8 byte space; invalid, edge, and non-character boundaries are ignored by the renderer.

Required Methods§

fn breaks(&self, text: &str) -> Vec<usize>

fn cache_key(&self) -> u64

Stable identity for shape/measurement caches. Change this value when the algorithm, dictionary, or user settings change.

Implementors§