-
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
Font sizes in WT and conhost #14165
Comments
And another related issue: as I mentioned above, lines appear thicker and somewhat blurrier in WT (Atlas) with certain font sizes. Replacing terminal/src/renderer/atlas/dwrite.cpp Line 37 in cacf668
improves it significantly (notice also the absence of vertical artefacts within the █▄▌ and ▐▀ blocks in the 2nd case):
Test characters: |
I don't think we have! I'm actually really happy for any feedback I can get, because as the person who mucked around in our text rendering the most lately, I really don't know if most of my decisions are "good". I just go by what I know, but that doesn't mean it's optimal or correct. For instance cell height (or line height) is currently determined as the font's In either case, as you might already know, font sizes in conhost aren't specified in "font sizes". They're given in line heights and the font size is determined to fit into that height. So if you specify a "font size" of 20px it'll result in exactly 20px tall cells and the actual font size in px will be some non-integer. Given that Consolas' Combined with ClearType AA this should result in an identical appearance. Try this config: "defaults":
{
"antialiasingMode": "cleartype",
"font":
{
"face": "Consolas",
"size": 12.81067556
}
}, If there are still gaps, they should be fixed with #14099. Now the question is: How do you put that into our settings model if anything? And could we maybe merge this with my current work on allowing customized line heights? |
BTW there was a discussion about font rendering a while ago over here: #13936 Edit: I'm going to mark it as "question" for now since it's not really a bug (like a crash). We can change it to Issue-Bug/Task/Feature later if it turns out to be something like that. 🙂 |
Thank you for the explanation.
Thanks, it is really close now (and it only works in Atlas, right?).
Depends what to put:
|
@lhecker It looks way better in 1.16.3463.0, thank you! |
I'm planning to add a "legacy font size switch" to the settings in the future, allowing you to set a row or line height instead of a font size. I'm just not sure how to best design the switch in the settings UI ¹ or how to store it in the settings.json and I haven't really committed myself to spend time on implementing it just yet. There's a lot of other interesting features I'm working on as well after all, like proper & full Unicode support in all console APIs (and VT), or a "AtlasEngine v2" kind of renderer, which will allow for arbitrarily overlapping glyphs... ¹ Maybe just a checkbox next to the font size? |
Windows Terminal version
1.16.2641.0
Windows build number
10.0.19044.1889
Other Software
No response
Steps to reproduce
Apologies if this has already been discussed somewhere.
I prefer Consolas 20px. This is how it looks like in conhost:
The cmd file used: sample.cmd.txt
I would like to get the same experience in WT, so I go to settings, select Consolas, 20, and...
Oh. Ok, it says "Size of the font in points", I should've paid attention.
Ok, let's google what points are and how they relate to pixels:
https://blog.gimm.io/difference-between-pixel-px-and-point-pt-font-sizes-in-email-signatures/
https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference
Ok, if one px is 0.75 pt, then 20 px is 15 pt, right?
No.
Well, apparently these are some other points then, but I'm getting tired and don't want to research it further. Let's try the scientific method.
10pt... No.
11pt... No.
12pt...
Close. Width is nearly perfect, but height is too small.
13pt...
Now height is nearly perfect, but width is too big. What the...
Ok, the new WT supports fractional font sizes, so let's try that:
...
12.64pt...
Width is nearly perfect, height is nearly perfect, but... it's ugly. Too bold. With gaps.
No luck it seems. Let's try other apps just to check if it's possible.
Windows Notepad, 13pt:
A pixel-perfect match!
ConEmu, 20px:
Also a pixel-perfect match:
So it is doable.
Expected Behavior
I want to see exactly the same picture in WT I used to see in conhost for over a decade.
With all its flexibility, advanced renderers etc. I expect it to be trivially achievable, if not out of the box.
Actual Behavior
No matter what I do, I cannot get the same results: the font is either too short or too wide, fractional sizes approximate it better, but the result is ugly. Meanwhile, in some other apps it just works.
P.S. I understand that fonts is a complex topic, vector curves not necessarily can perfectly fit into a pixel grid, there are different approximation methods etc., but I think there should be a way to get a familiar look & feel nevertheless.
The text was updated successfully, but these errors were encountered: