diff --git a/examples/text/src/font/fallback/windows.rs b/examples/text/src/font/fallback/windows.rs index 6a992d64..bd3b7610 100644 --- a/examples/text/src/font/fallback/windows.rs +++ b/examples/text/src/font/fallback/windows.rs @@ -21,17 +21,15 @@ fn han_unification(locale: &str) -> &'static [&'static str] { //TODO! match locale { // Japan - "ja" => &[], + "ja" => &["Yu Gothic"], // Korea - "ko" => &[], - // China - "zh-CN" => &[], - // Hong Kong - "zh-HK" => &[], + "ko" => &["Malgun Gothic"], + // Hong Kong" + "zh-HK" => &["MingLiU_HKSCS"], // Taiwan - "zh-TW" => &[], - // Simplified Chinese is the default - _ => &[], + "zh-TW" => &["Microsoft JhengHei UI"], + // Simplified Chinese is the default (also catches "zh-CN" for China) + _ => &["Microsoft YaHei UI"] } } @@ -39,16 +37,21 @@ fn han_unification(locale: &str) -> &'static [&'static str] { pub fn script_fallback(script: &Script, locale: &str) -> &'static [&'static str] { //TODO: better match https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/platform/fonts/win/font_fallback_win.cc#L99 match script { + Script::Adlam => &["Ebrima"], Script::Bengali => &["Nirmala UI"], Script::Canadian_Aboriginal => &["Gadugi"], + Script::Chakma => &["Nirmala UI"], Script::Cherokee => &["Gadugi"], Script::Devanagari => &["Nirmala UI"], Script::Ethiopic => &["Ebrima"], Script::Gujarati => &["Nirmala UI"], Script::Gurmukhi => &["Nirmala UI"], Script::Han => han_unification(locale), - Script::Hangul => &["Malgun Gothic"], + Script::Hangul => han_unification("ko"), + Script::Hiragana => han_unification("ja"), + Script::Javanese => &["Javanese Text"], Script::Kannada => &["Nirmala UI"], + Script::Katakana => han_unification("ja"), Script::Khmer => &["Leelawadee UI"], Script::Lao => &["Leelawadee UI"], Script::Malayalam => &["Nirmala UI"], @@ -61,6 +64,8 @@ pub fn script_fallback(script: &Script, locale: &str) -> &'static [&'static str] Script::Thaana => &["MV Boli"], Script::Thai => &["Leelawadee UI"], Script::Tibetan => &["Microsoft Himalaya"], + Script::Tifinagh => &["Ebrima"], + Script::Vai => &["Ebrima"], Script::Yi => &["Microsoft Yi Baiti"], _ => &[], }