pub struct HyphenationDictionaryStore { /* private fields */ }Expand description
Hyphenation dictionaries by language. Dictionaries that the app registers are used first, and
a dictionary embedded in the build is the fallback when text-hyphenation-embedded is on.
Implementations§
Source§impl HyphenationDictionaryStore
impl HyphenationDictionaryStore
Sourcepub fn register_dictionary_path(
&self,
locale: &str,
path: impl AsRef<Path>,
) -> Result<(), HyphenationDictionaryError>
pub fn register_dictionary_path( &self, locale: &str, path: impl AsRef<Path>, ) -> Result<(), HyphenationDictionaryError>
Registers the dictionary for locale read from the file at path, replacing an earlier
one.
Sourcepub fn register_dictionary_reader(
&self,
locale: &str,
reader: &mut impl Read,
) -> Result<(), HyphenationDictionaryError>
pub fn register_dictionary_reader( &self, locale: &str, reader: &mut impl Read, ) -> Result<(), HyphenationDictionaryError>
Registers the dictionary for locale read from reader, replacing an earlier one.
Sourcepub fn choose_auto_hyphen_break(
&self,
line: &str,
style: &TextStyle,
segment_start_char: usize,
measured_break_char: usize,
) -> Option<usize>
pub fn choose_auto_hyphen_break( &self, line: &str, style: &TextStyle, segment_start_char: usize, measured_break_char: usize, ) -> Option<usize>
Chooses where to hyphenate the word that contains the break at character
measured_break_char of line. segment_start_char is the character index where the
current line segment starts, and the language comes from the first locale of style,
English when it has none. Returns the character index of the break, at least two
characters after the segment start and not after measured_break_char, or None when
the break is not inside a word or no dictionary is available.