Add some CJK fonts for windows
This commit is contained in:
parent
dc50b6935b
commit
3552abdcbb
1 changed files with 22 additions and 0 deletions
|
|
@ -12,6 +12,24 @@ pub fn common_fallback() -> &'static [&'static str] {
|
|||
]
|
||||
}
|
||||
|
||||
fn han_unification(locale: &str) -> &'static [&'static str] {
|
||||
//TODO!
|
||||
match locale {
|
||||
// Japan
|
||||
"ja" => &[],
|
||||
// Korea
|
||||
"ko" => &[],
|
||||
// China
|
||||
"zh-CN" => &[],
|
||||
// Hong Kong
|
||||
"zh-HK" => &[],
|
||||
// Taiwan
|
||||
"zh-TW" => &[],
|
||||
// Simplified Chinese is the default
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
// Fallbacks to use per script
|
||||
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
|
||||
|
|
@ -20,10 +38,14 @@ pub fn script_fallback(script: &Script, locale: &str) -> &'static [&'static str]
|
|||
Script::Canadian_Aboriginal => &["Gadugi"],
|
||||
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::Hiragana => &["Meiryo"]
|
||||
Script::Kannada => &["Nirmala UI"],
|
||||
Script::Katakana => &["Meiryo"]
|
||||
Script::Khmer => &["Leelawadee UI"],
|
||||
Script::Lao => &["Leelawadee UI"],
|
||||
Script::Malayalam => &["Nirmala UI"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue