hpl_cjk_text/lib.rs
1//! UTF-8 decoding and CJK line breaking (避頭尾) shared by the AMFP-2026 exe (C ABI, see
2//! `ffi`) and the Traditional Chinese translation tooling (PyO3, crate `hpl-cjk-text-py`).
3//!
4//! Two consumers, one set of rules:
5//! - the **2026 exe** asks [`break_allowed`] for every pair of characters while wrapping;
6//! - the **stock-exe TC build** cannot change the engine, so [`insert_break_spaces`] inserts
7//! U+0020 wherever a break is allowed (the stock engine only breaks at U+0020).
8//!
9//! The rules mirror `scripts/common.py` of the TC tooling; `tests/tc_parity.rs` carries its
10//! test table.
11
12pub mod breakspace;
13pub mod decode;
14pub mod ffi;
15pub mod rules;
16
17pub use breakspace::{default_icon_pad, insert_break_spaces, BreakSpaceOptions};
18pub use decode::{decode_utf8_bmp, DecodeStats};
19pub use rules::{break_allowed, is_cjk, NO_LINE_END, NO_LINE_START};