Skip to content

Allow for the configuration of font fallback #2664

Closed

Description

@onceSS

I am a Chinese developer, sometimes I have to use Chinese, or my Chinese version system will display some prompts in Chinese.

However, this terminal cannot specify multiple fonts in setting, for example: "editor.fontFamily": "DejaVu Sans Mono, Noto Sans CJK SC"(an example from vscode).

I hope this terminal can support multiple fonts setting in the future, thank you.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Sep 5, 2019
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 5, 2019
  3. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Sep 5, 2019
  4. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 5, 2019
  5. phuclv90 commented on Sep 5, 2019

    @phuclv90

    I don't think you need to specify different fonts. Regardless of any locale you use, Chinese characters can always be displayed properly because there are font substitution, font linking and font fallback behind the scenes

  6. mdtauk commented on Sep 5, 2019

    @mdtauk

    Fonts in the JSON file could be an array, like with CSS, where if a font is not available, or maybe even per glyph - it goes to the next font listed, and falls back.

  7. DHowett-MSFT commented on Sep 5, 2019

    @DHowett-MSFT
    Contributor

    This will be part of #1790.

  8. changed the title [-]Multiple fonts support[/-] [+]Allow for the configuration of font fallback[/+] on Sep 5, 2019
  9. added
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    and removed
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Sep 5, 2019
  10. 28 remaining items

  11. tsukumijima commented on Oct 14, 2023

    @tsukumijima

    Jaswir (@Jaswir) No, it's preferable to initially set a beautiful monospace font for English console and programming tasks, and then render glyphs that are not implemented in that font, like Japanese hiragana and kanji, using a secondary monospace font that supports Japanese.
    This is because, unlike fonts for English alphabets, Japanese fonts have a vast number of glyphs, limiting the options available, especially for free fonts.
    Furthermore, the design of the English numerals and letters in Japanese fonts may not necessarily be suited for console environments. In other words, there's a need to "use a well-designed English font for English letters and numerals, and choose a Japanese font that stylistically matches that English font for hiragana and kanji".
    While fonts that combine reputable open-source English and Japanese fonts like HackGen are available, creating such a composite font oneself is considerably laborious and generally not realistic.

  12. Jaswir commented on Oct 14, 2023

    @Jaswir
    Contributor

    tsukumi (@tsukumijima)

    Okay, so you have two fonts. One for the English alphabet and numbers and one for the Japanese characters? With current terminal you cannot have two fonts?

    PS: I can play around a bit with vs code and the fonts and check the differences

  13. tsukumijima commented on Oct 14, 2023

    @tsukumijima

    Jaswir (@Jaswir) What does it mean?
    English fonts are fonts such as Source Code Pro, while Japanese fonts (including half-width alphanumeric characters) are Kosugi, etc.
    "Kosugi" is a monospaced Japanese font that also includes alphanumeric characters. However, the alphanumeric characters in "Source Code Pro" look better on the terminal.
    Therefore, in this example, I think "Source Code Pro" should be used preferentially, and "Kosugi" should be used for the characters not included in "Source Code Pro".

  14. xd003 commented on Oct 15, 2023

    @xd003

    Badal Singh (@xd003)

    Can you maybe make a gif of how this works in Linux the font fallback thing? https://www.screentogif.com/

    Having things in Gifs describing the issue helps me. Maybe it'll help get this solved faster:

    Sure i can do that, but i am didn't quite understood if you need the part where this feature is coded in all the terminal emulators on linux or where exactly is the font fallback defined ? if you need the code part, sorry you will have to find it yourself on their respective github repos as i am not familiar with their codebase. i am linking github for the most preferred/famous linux terminals here - Konsole, Alacritty, Kitty, wezterm, foot, st. Do note that some of these terminals have windows OS support but their development is majorly focused on catering linux users except maybe just wezterm, it works pretty fine on windows i have heard.
    If you were asking where is the font fallback defined by the user, each of the github repo i have linked has their own wiki section, it is defined in the respective config files used by the terminals. For example, kitty's font section here clearly shows how to define font fallback.
    Good Luck

  15. newor0599 commented on Nov 27, 2023

    @newor0599

    You can try using a nerd font, it contains alot of unicode including chinese character!

  16. janderssonse commented on Nov 30, 2023

    @janderssonse

    You can try using a nerd font, it contains alot of unicode including chinese character!

    I guess that is precisley one of the many reasons that this issue exists. We would like to be able to have fallback font options, as to avoid using hacks like nerd fonts that are patch on fonts, sometimes with great results. sometimes with alignment issues.

  17. xd003 commented on Nov 30, 2023

    @xd003

    You can try using a nerd font, it contains alot of unicode including chinese character!

    I guess that is precisley one of the many reasons this issue exists. We wan't to be able to have fallback font as to avoid using hacks like nerd fonts that are patching a fonts, sometimes with great results. sometimes with alignment issues.

    Moreover there are very limited number of fonts available within the Nerd Fonts apart from the occasional alignment issues, its not really a viable option as people think it to be

  18. abceleung commented on Feb 16, 2024

    @abceleung

    +1 to this issue.

    Since my choice of font (Sarasa Gothic) does not have a prepatched version with nerd font, I used font-patcher in the official nerd font repo to patch nerd font in manually.

    Docker example:
    docker run --rm -v ./SarasaFixedSlabHC-TTF-1.0.5/:/in:Z -v ./out:/out:Z -e "PN=10" nerdfonts/patcher --adjust-line-height --careful --complete
    (Lower PN if you have a weak PC, otherwise it might use up all your RAM and freeze your computer)

    Another option I have considered is to use Wezterm, which is cross platform, has tab support and has nerd font as fallback font by default (so you don't have to patch nerd font by yourself).

  19. zadjii-msft commented on Feb 27, 2024

    @zadjii-msft
    Member

    For the subset of this thread that has been following along because they want the Powerline glyphs in their prompt but don't have a font with those glyphs: #16729 added some support for the Terminal drawing some of those glyphs itself, rather than relying on the font. That's available in Canary builds, if folks want to give that a try 😄

    (understanding though, that this thread is mostly not about powerline glyphs, and there's still a lot of work to do here)

  20. added a commit that references this issue on Mar 26, 2024
    de7f931
  21. moved this from Walkthrough in issue to Done in Terminal Walkthroughson Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-FontsRelated to the fontArea-SettingsIssues related to settings and customizability, for console or terminalHelp WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions