-
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
Permit fractional 0.5 sized font scaling #6678
Comments
Fractional point sizes are sufficiently rare in the wild that I’ll have to ask: |
Alright, sure, I'll throw this on the backlog. This will require a good amount of renderer changes, as that's a shared component with conhost and we've always only ever supported integral sizes. A font's presentation should not vary so wildly between 8.5 and 9 (which, I might add, is only 1/144 of an inch of difference [1]). What you're probably seeing is a difference in hinting. If the font is hinted at 8 and hinted differently at 9, 8.5 is probably totally unhinted and you're getting raw geometries? [1] Given that 1pt is 1/72", 0.5pt is 1/144". That is imperceptibly small. Imperceptibly! |
Honestly, it might be easier to add a setting to turn off hinting. That would get you the 8.5 behavior at 8 or at 9. |
@DHowett Most likely @musm's setup (aka DPI, scaling factor, rasterization) is such that switching from 8pt to 9pt causes the renderer to round up versus round down, thus making everything larger. To be honest, I don't know if adding fractional point sizes will help. Ultimately the rasterizer is still going to try and lock the glyphs to a whole pixel, so it'll just guess up or down. As you posited, disabling hinting might be the easier fix as I expect the 9pt wouldn't jump up quite so significantly. However, it comes at the cost of blurrier text, so it'd definitely be a "use at your own risk" sort of thing! |
@aaronbell Interesting theory. Do you why this would only apply to Cascadia Code and not other fonts? Personally I'd love to use it but I'm stuck in a gray zone where size 8 is too small and size 9 is way too large. DPI: Well I'm running 100% no scaling at all. |
@musm Out of interest, do you happen to have a 72 DPI screen? I suddenly remembered something :) In Cascadia Code, there is what's called a GASP table which tells the rasterizer when to turn on / off hinting, and what kind of rasterization approach to use. Right now the GASP table instructions are set to turn on hinting at 9ppem (which equated to 9pt on a 72DPI screen) and above. This setting is following the recommendation of the font rasterization experts at Microsoft. So what could be happening is that when you switch over to 9pt, the hinting is kicking in to help the font render more sharply and it is making the letters bigger. This may not happen for other fonts because their GASP tables are set differently. |
According to https://dpi.lv/ |
🤔 |
I'm on the same boat. Something is off with the font rendering and I often enough wished that I could have the font size that is just in-between 10 and 11, or 11 and 12. |
I too have used Consolas at size 16 on classic console. ConEmu also calculated the font size differently to the classic console, but there the developer considered UX and decided that a font size of 14 would render identically to the classic console, which was also set as the default in that app. I'm using a 1920x1200 screen and classic terminal's consolas font at 16 is just perfect. In Windows Terminal the font is either too small (at size 10) or too large (size 11). Being able to specify and render at a fractional size would help me get the optimal compromise between screen real estate used and being able to easily read the console text. |
Same issue here. I'm using a Windows surface and Hack font. The font size is either too large (10) or too small (9). I'm looking for a solution to this issue. Thanks! |
Any chance this could get triaged? The number of users reporting running into the same issue suggests this is indeed something that needs to be looked into. |
This has been triaged: it's P3, on the backlog, and if somebody wants to have a look at implementing it they are very welcome to 😄 |
This would definitely be appreciated - it seems like the font sizes (at least for Consolas) are exactly two-thirds in Windows Terminal as they are in the old terminal, which means it's currently impossible to make the text size the same in both unless it's a multiple of three. In the old console, Consolas at 16px looked perfect, but now I'm stuck with 10pt (15px) or 11pt (16.5px), the latter of which looks weirdly stretched horizontally (the vertical bar of a |
I would also love this, no matter what i do or what font i use it's always blurry like it's got the wrong size and it's resizing it afterwards. |
Right, this makes it a little frustrating especially for those that prefer very small font sizes. |
I don't know anything about how you guys do rendering, but I use DPI scaling and when I'm tweaking font sizes in CSS for a browser I can make adjustments even in hundreds of a rem and they do make a difference. |
Also I wanted to ask here if anyone has any ideas about how to turn off DPI scaling for this app. I tried the normal way of turning it off for every |
I don't understand almost anything about font rendering, for me it's a bit confusing. For example using Sublime Text setting the font to size 10 is the same as size 16 in Windows command prompt 😄 Basically if an improvement is possible, I would like the Windows Terminal fonts to be rendered the same way as the command prompt, powershell or cmder. I'm starting to use Windows Terminal and I'm really enjoying it. This was really missing for Windows. |
After this commit a user may specify fractional font sizes. Support was only implemented for AtlasEngine however. DxEngine continues to use rounded (integer) font sizes. Closes #6678 ## Validation Steps Performed * Install a bitmap font that requires fractional font sizes (e.g. Terminus TTF, https://files.ax86.net/terminus-ttf/) * Set font size to something integer (e.g. 14pt) Glyphs are blurry ✅ * Set font size to something fractional (e.g. 13.5pt) Glyphs are crisp ✅
After this commit a user may specify fractional font sizes. Support was only implemented for AtlasEngine however. DxEngine continues to use rounded (integer) font sizes. Closes #6678 ## Validation Steps Performed * Install a bitmap font that requires fractional font sizes (e.g. Terminus TTF, https://files.ax86.net/terminus-ttf/) * Set font size to something integer (e.g. 14pt) Glyphs are blurry ✅ * Set font size to something fractional (e.g. 13.5pt) Glyphs are crisp ✅ (cherry picked from commit c51bb3a) Service-Card-Id: 85708971 Service-Version: 1.16
After this commit a user may specify fractional font sizes. Support was only implemented for AtlasEngine however. DxEngine continues to use rounded (integer) font sizes. Closes #6678 * Install a bitmap font that requires fractional font sizes (e.g. Terminus TTF, https://files.ax86.net/terminus-ttf/) * Set font size to something integer (e.g. 14pt) Glyphs are blurry ✅ * Set font size to something fractional (e.g. 13.5pt) Glyphs are crisp ✅ (cherry picked from commit c51bb3a) Service-Card-Id: 85708971 Service-Version: 1.16 (cherry picked from commit 73ea629)
After this commit a user may specify fractional font sizes. Support was only implemented for AtlasEngine however. DxEngine continues to use rounded (integer) font sizes. Closes #6678 * Install a bitmap font that requires fractional font sizes (e.g. Terminus TTF, https://files.ax86.net/terminus-ttf/) * Set font size to something integer (e.g. 14pt) Glyphs are blurry ✅ * Set font size to something fractional (e.g. 13.5pt) Glyphs are crisp ✅ (cherry picked from commit c51bb3a) Service-Card-Id: 85708971 Service-Version: 1.16 (cherry picked from commit 73ea629)
🎉This issue was addressed in #14013, which has now been successfully released as Handy links: |
I am using Terminal 1.19.2682.0 and there is no difference between 10.5 and 11 or 11.5 and 12 font sizes (at least in Cascadia, Hack, Source Code Pro). |
@sryze Due to hinting, not every font size increase results in a visual change. This is especially so since the font size in Windows Terminal is given in points (pt = 72 DPI) and not in pixels (px = usually considered 96 DPI, or your monitor DPI). And so two different sizes in points may round to about the same value in pixels. In other words, support for fractional sizes doesn't imply that every single fractional value ends up having a different appearance. Just pick a size that feels good to you! (If you'd like support for disabling hinting, please open a new issue. It's somewhat unlikely that you'd be happy with the result though as unhinted fonts look fairly terrible on a 96 DPI display.) |
Description of the new feature/enhancement
Allow users to set font sizes in
0.5
increments, e.g.:half-point differences are meaningful at this scale.
The text was updated successfully, but these errors were encountered: