Package-level declarations
Types
The Unicode Bidirectional Algorithm (UAX #9), implicit subset: it resolves an embedding level per character and reorders a line from logical to visual order, so mixed Latin + Arabic/Hebrew + numbers display correctly. Lives in core so both the EPUB reflow engine and (later) PDF text extraction can share it.
Knuth-Liang hyphenation (the TeX algorithm). Given a set of language patterns, finds the valid hyphenation points inside a word so a justified line-breaker can split long words. The pattern data is the language-specific part; the bundled sets (see forLanguage) are the full TeX hyph-* pattern files for German, French, Spanish, Italian, Portuguese, Dutch and Russian, plus a small built-in English set for common words.
Turns bytes into text when nobody can be trusted about the encoding.