text, ui: the CJK fallback fonts follow the interface language
- `effectcraft_text::fonts::set_cjk_locale` lets the host say whose face should draw Han ideographs instead of leaving it to the locale environment, and drops the fallback cache when it changes. `han_order` reads that request first; the tag → order rule moves into the pure `han_order_for`, so it can be tested without touching process state. - `theme::install` now takes the stored `general.language` value and registers one CJK system fallback per script in every font family, the interface's own script first: kana for Japanese, a Han character for `zh-hans` / `zh-hant`, then the other script so names in it still render. A face is registered at most once, and a machine with no CJK font installs nothing (the web build installs nothing, as before). - Before this the probe was always `あ`, so Han text was drawn by the Japanese face whenever the operating system's locale was not Chinese: a Chinese interface, and Chinese file, layer or template names on any locale, both got Japanese glyph forms. - Tests: the tag → order rule (`zh`, `zh_Hans`, `zh-Hant-TW`, `ko`, `ja`, `en`, empty), and the registration order plus once-only registration for a Chinese, a Japanese and an English interface.
This commit is contained in:
@@ -844,7 +844,7 @@ mod tests {
|
||||
fn premiere_export_dialog() {
|
||||
let mut app = EffectcraftApp::new(effectcraft_engine::Session::default());
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install(&ctx, &app.tokens);
|
||||
crate::theme::install(&ctx, &app.tokens, &app.session.prefs.general.language);
|
||||
app.session.execute("comp.new", json!({"name": "Spot", "width": 64, "height": 36, "frameRate": 25, "duration": 1})).unwrap();
|
||||
app.session.execute("layer.newSolid", json!({"color": "#ff0000"})).unwrap();
|
||||
crate::menus::invoke(&mut app, &ctx, "file.exportTimeline", json!({})).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user