Skip to content

Use proper font family for East Asian languages (CJK) #5260

Closed

Description

@be5invis
  • VSCode Version: 1.0
  • OS Version: Windows 10 x64 1511

image

Electron assigns a serif font, SimSun, as the default sans-serif font for zh-CN. This is extremely inconsistent.

A workaround may be

whatever:lang(zh-CN) {
    font-family: <your current setting>, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}
whatever:lang(zh-TW) {
    font-family: <your current setting>, "PingFang TC", "Microsoft JhengHei", "Source Han Sans TC", sans-serif;
}

Activity

  1. added
    bug
    l10n-platform
    important
    on Apr 14, 2016
  2. jackqq commented on Apr 15, 2016

    @jackqq

    Hi Belleve (@be5invis), I guess you have either installed additional fonts (such as Monaco) or modified the FontSubstitutes registry settings or so. I have the default font set and VSCode falls back to Consolas in the editing area. It looks OK.

    vscode-zh-cn-01

    However, in the explorer area the text looks a little blurry, but can be fixed by increasing the font-size to 12px. Please note the difference between two Chinese lines in the image below, 资源管理器 (original) and 工作文件 (up-sized to 12px). I guess it's because at 12px SimSun performs well with raster glyphs instead of vector ones, which can be quite blurry at small sizes.

    vscode-zh-cn-02 vscode-zh-cn-03

  3. be5invis commented on Apr 15, 2016

    @be5invis
    ContributorAuthor

    QIU Quan (@jackqq) The edit area uses Inziu Iosevka SC. What I am talking about is the font used in the UI, instead of the editing area, since it is configurable, and you can actually set to ANY fallback sequence you want.

  4. dbaeumer commented on Apr 15, 2016

    @dbaeumer
    Member

    Benjamin Pasero (@bpasero) I move this to you. If we should set different fonts in the explorer depending on the UI language you can use the API vs/base/common/platform#language to know the languge used for the UI.

  5. bpasero commented on Apr 15, 2016

    @bpasero
    Contributor

    Dirk Bäumer (@dbaeumer) the original bug report is about the editor though? if there are multiple issues discussed in here I suggest to split them up by topic.

  6. be5invis commented on Apr 15, 2016

    @be5invis
    ContributorAuthor

    Benjamin Pasero (@bpasero) This issue has no relationship with the editor. It's just the “UI”. Actually we can specify the fallback sequence for the editor.

  7. 50 remaining items

  8. anyong commented on Apr 21, 2016

    @anyong

    Benjamin Pasero (@bpasero) arianelu It's fine with Noto Sans, the CJK fonts are called different names (i.e. Noto Sans CJK SC, Noto Sans CJK TC and so on). I have these Noto Sans CJK fonts installed on my computer (Win 10 + zh-Hant-TW locale) and the UI font being displayed is Jhenghei as expected.

  9. be5invis commented on Apr 21, 2016

    @be5invis
    ContributorAuthor

    Edward Greve (@anyong) My stylesheets does not contain Noto Sans CJK. For Source Han Sans, it is after Windows fonts so on Windows it will not be used (and most users will not install them).

  10. grazies commented on Apr 21, 2016

    @grazies

    Cool

    YOTOV LIMITED[😏]


    From: ArianeLu [email protected]
    Sent: 21 April 2016 17:23
    To: Microsoft/vscode
    Subject: Re: [Microsoft/vscode] Use proper font family for East Asian languages (CJK) (#5260)

    @bpaserohttps://github.com/bpasero

    I think this one is best for zh-cn:

    "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", "Microsoft Yahei UI", "Microsoft YaHei", "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", "WenQuanYi MicroHei" ,sans-serif

    YaHei UI available in Win8+, may better than YaHei
    WenQuanYi MicroHei is for CentOS/SUSE, better than use UKai(i dont know why it will be set as default font of sans-serif in some linux)

    If linux/mac user installed YaHei, text still beautiful and clear, but other font is not clear/blur on Windows(except hi-dpi)

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly or view it on GitHubhttps://github.com//issues/5260#issuecomment-212994006

  11. anyong commented on Apr 21, 2016

    @anyong

    arianelu You have Noto Sans (a latin alphabet font) listed after the CJK fonts - that doesn't make any sense. Latin fonts should come first, because the latin characters in CJK fonts are notoriously bad.

  12. be5invis commented on Apr 21, 2016

    @be5invis
    ContributorAuthor

    arianelu Your problem is caused by PingFang, not Noto.
    And you forgot Office for Mac.

  13. be5invis commented on Apr 21, 2016

    @be5invis
    ContributorAuthor

    arianelu Benjamin Pasero (@bpasero)
    Hmmm, maybe rearrangement is acceptable, since the original CSS's Latin part is also in the "Windows -- OSX -- Linux" order. So this:

    • For zh-CN : font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif
    • For zh-TW : font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif
    • For ja : font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif
    • For ko : font-family: "Segoe WPC", "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif

    is acceptable either.

  14. bpasero commented on Apr 21, 2016

    @bpasero
    Contributor

    Belleve (@be5invis) I am relying on you guys telling me the best option. I can make such a change in the font-family list easily tomorrow.

  15. bpasero commented on Apr 22, 2016

    @bpasero
    Contributor

    Pushed the suggestion from #5260 (comment)

  16. aeschli commented on Apr 29, 2016

    @aeschli
    Contributor

    I verified that for the explorer we now use a 'zh-Hans' specific font.

  17. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugimportantl10n-platformverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions