diff options
Separate Simplified Chinese (zh/zh-Hans) from Traditional (zh-Hant)
This commit separates `zh` into `zh-Hans` and `zh-Hant`.
`zh-Hans` is used as a fallback for `zh`.
Essentially, the traditional script and the simplified script often have different-looking glyphs. Some fonts may even completely lack traditional glyphs, which produces weird results when some characters used that are unchanged in the simplified script, but nonexistent unless you're writing with the traditional script (zh-Hans 为 == zh-Hant 為).
This is especially apparent on Windows, where Microsoft YaHei (微软雅黑) is much "fatter" than Microsoft JhengHei (微軟正黑體).
2 files changed, 10 insertions, 3 deletions
| -rw-r--r-- | src/_asian.scss | 10 | ||||
| -rw-r--r-- | src/_variables.scss | 3 |
diff --git a/src/_asian.scss b/src/_asian.scss index 5f7533e..df67890 100644 --- a/src/_asian.scss +++ b/src/_asian.scss @@ -1,6 +1,10 @@ // Optimized for East Asian CJK -:lang(zh) { - font-family: $cjk-zh-font-family; +:lang(zh), :lang(zh-Hans) { + font-family: $cjk-zh-Hans-font-family; +} + +:lang(zh-Hant) { + font-family: $cjk-zh-Hant-font-family; } :lang(ja) { @@ -12,6 +16,8 @@ } :lang(zh), +:lang(zh-Hans), +:lang(zh-Hant), :lang(ja), .cjk { ins, diff --git a/src/_variables.scss b/src/_variables.scss index 87fd981..70d1e67 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -43,7 +43,8 @@ $link-color-dark: darken($link-color, 5%) !default; $base-font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto !default; $mono-font-family: "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Courier, monospace !default; $fallback-font-family: "Helvetica Neue", sans-serif !default; -$cjk-zh-font-family: $base-font-family, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", $fallback-font-family !default; +$cjk-zh-Hans-font-family: $base-font-family, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", $fallback-font-family !default; +$cjk-zh-Hant-font-family: $base-font-family, "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", $fallback-font-family !default; $cjk-jp-font-family: $base-font-family, "Hiragino Sans", "Hiragino Kaku Gothic Pro", "Yu Gothic", YuGothic, Meiryo, $fallback-font-family !default; $cjk-ko-font-family: $base-font-family, "Malgun Gothic", $fallback-font-family !default; $body-font-family: $base-font-family, $fallback-font-family !default; |