-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for the configuration of font fallback #2664
Comments
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 |
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. |
This will be part of #1790. |
Adding the word fontFace in here to make it easier to find this issue. |
It would be nice if VS Code and Terminal were more consistent on configuration parameters as well. This is a bigger problem, but this is a good example: vscode uses fontFamily, Terminal uses fontFace as the configuration parameter. |
It's been over a year since this issue was opened. Is there any progress in implementing font fallback? For example, suppose you want to use Cascadia Code in Windows Terminal. For VS Code, you can specify an alternative font to display characters that Cascadia Code doesn't have. There are not many fonts for coding that contain Japanese characters. If font fallback is possible, you can easily combine alphabet fonts and Japanese fonts, expanding your font choices. |
Is there any solution to this problem yet ? |
This is the only issue that limits me from using Windows Terminal over other solutions now. |
From discussion on #14959, specifically this thread: #14959 (comment) |
Why is something as important as this not implemented since 4 yrs, please this is something very barebones on linux if you ask me. I am using a Mono font for my Terminal but i needed to add a secondary font for better glyph/icons support in my prompt which is not possible at the moment |
Can you maybe make a gif of how this works in Linux the font fallback thing? Having things in Gifs describing the issue helps me. |
So let me get this straight the normal font is Japanese (tsu) / Chinese (once) and it should fall back to English font if not available? |
@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. |
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 What does it mean? |
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. |
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. |
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 |
+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: 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). |
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) |
`wstring_case_insensitive_compare` is not a great name for what it does as it's incorrect to use for regular (human readable) strings. This PR thus renames it to `env_key_sorter`. `compare_string_ordinal` was renamed to `compare_ordinal_insensitive` to make sure callers know that the comparison is insensitive (this may otherwise be incorrect in certain contexts after all). The return value was changed to match `memcmp` so that the API is detached from its underlying implementation (= NLS). `compare_linguistic_insensitive` and `contains_linguistic_insensitive` were added to sort and filter human-readable strings respectively. `prefix_split` was extended to allow for needles that are just a single character. This significantly improves the generated assembly and is also usually what someone would want to actually use. I've left the string-as-needle variant in just in case. This PR is prep-work for #2664
This adds support for specifying more than one font family using a syntax that is similar to CSS' `font-family` property. The implementation is straight-forward and is effectively just a wrapper around `IDWriteFontFallbackBuilder`. Closes #2664 ## PR Checklist * Font fallback * Write "「猫」" * Use "Consolas" and remember the shape of the glyphs * Use "Consolas, MS Gothic" and check that it changed ✅ * Settings UI autocompletion * It completes ✅ * It filters ✅ * It recognizes commas and starts a new name ✅ * All invalid font names are listed in the warning message ✅ --------- Co-authored-by: Dustin L. Howett <duhowett@microsoft.com>
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.
The text was updated successfully, but these errors were encountered: