From 53101b3e41cfb76550c5494157f3ef2be01e0a19 Mon Sep 17 00:00:00 2001 From: Raymonf Date: Thu, 3 May 2018 20:36:48 -0400 Subject: Separate Simplified Chinese (zh/zh-Hans) from Traditional (zh-Hant) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (微軟正黑體). --- src/_asian.scss | 10 ++++++++-- src/_variables.scss | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.3.1-23-gd82d