EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust
Merge pull request #401 from dmatviichuk/i18n/ukrainian
Brandon Thomasa0c6a6e96ed5
diff --cc crates/text/src/fonts.rsindex 86ca268db,85eb5135e..c5ad8b9bc--- a/crates/text/src/fonts.rs+++ b/crates/text/src/fonts.rs@@@ -955,23 -921,19 +955,36 @@@ mod testsassert_eq!(fallback_for('\u{e001}', inter), id, "fallback finds the drawn one");}+ #[test]+ fn the_han_order_follows_the_cjk_locale() {+ // Chinese first for any Chinese tag, whether or not it names a script.+ for tag in ["zh", "zh-CN", "zh_Hans", "ZH-Hant-TW.UTF-8", "zh_MO"] {+ assert_eq!(han_order_for(tag)[0], FallbackScript::Han, "{tag}");+ }+ assert_eq!(han_order_for("ko-KR"), [FallbackScript::Korean, FallbackScript::Japanese, FallbackScript::Han]);+ // Japanese, and anything else, keeps the Japanese face first for Han text.+ for tag in ["ja_JP.UTF-8", "en-US", "de", ""] {+ assert_eq!(han_order_for(tag), [FallbackScript::Japanese, FallbackScript::Han, FallbackScript::Korean], "{tag}");+ }+ // The host's request is what `han_order` reads (the ui test covers the effect on the+ // registered fallbacks; this only checks that clearing it returns to the environment).+ assert_eq!(requested_cjk_locale(), None, "tests run without a request");+ assert_eq!(han_order(), han_order_for(&active_cjk_locale()));+ }++ #[test]+ fn bundled_ui_fonts_cover_the_ukrainian_alphabet() {+ const ALPHABET: &str = "АБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФХЦЧШЩЬЮЯабвгґдеєжзиіїйклмнопрстуфхцчшщьюя’«»";+ for (name, bytes) in+ [("Inter Regular", INTER_REGULAR), ("Inter Medium", INTER_MEDIUM), ("Inter SemiBold", INTER_SEMIBOLD), ("JetBrains Mono", JETBRAINS_MONO_REGULAR)]+ {+ let font = FontRef::new(bytes).unwrap();+ for c in ALPHABET.chars() {+ assert!(covers(&font, c), "{name} cannot draw {c}");+ }+ }+ }+#[test]fn metrics_and_coverage() {let f = face(resolve("Inter", "Regular").face);