You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow for the configuration of font fallback #2664
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.
Reacted by Hyunwoo O, Teng Zhang, arielbeje, HumanoidSandvichDispenser, Zed, ExE Boss, Vagra Swift, Luan Vitor Simião Oliveira, Yasuaki Gohko, Hajime-Sasaki and 208 more
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
Reacted by Rikka, tataue, Piroro-hs, tsukumi, Macyrate, Freddie W, shxxyz, kenvix, A1exMinatoooo, Henry Johnson and 131 more
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.
Reacted by Marius Strom, Luan Vitor Simião Oliveira, Vũ Văn Dũng, Xie Ruifeng, 有賀 清一 Seiichi Ariga, まくぽり, Paul, JiaYue, Sandro, Keuin and 49 more
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.
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
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".
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
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.
Reacted by Badal Singh, S. B. Tam, Zhang Minghao, Nato Boram, Amr Gad, Rainick, Josias Klaus, Artem Sapegin and 陈湛明
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
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).
Reacted by Yoshio Sugiyama, Josef Andersson, François Coppens, Siwen Yu and varvir
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)
Activity
phuclv90 commentedon Sep 5, 2019
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
mdtauk commentedon Sep 5, 2019
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.
DHowett-MSFT commentedon Sep 5, 2019
This will be part of #1790.
[-]Multiple fonts support[/-][+]Allow for the configuration of font fallback[/+]28 remaining items
tsukumijima commentedon Oct 14, 2023
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.
Jaswir commentedon Oct 14, 2023
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
tsukumijima commentedon Oct 14, 2023
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".
xd003 commentedon Oct 15, 2023
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
newor0599 commentedon Nov 27, 2023
You can try using a nerd font, it contains alot of unicode including chinese character!
janderssonse commentedon Nov 30, 2023
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.
xd003 commentedon Nov 30, 2023
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
abceleung commentedon Feb 16, 2024
+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
PNif 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).
zadjii-msft commentedon Feb 27, 2024
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)
Add new and extend existing til::string helpers (#16772)
Add support for customizing font fallback (#16821)