Terminal: Permit fractional 0.5 sized font scaling

Created on 25 Jun 2020  路  13Comments  路  Source: microsoft/terminal

Description of the new feature/enhancement

Allow users to set font sizes in 0.5 increments, e.g.:

            "fontSize": 8.5

half-point differences are meaningful at this scale.

1

Area-Rendering Area-Settings Issue-Feature Priority-3 Product-Terminal

Most helpful comment

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.

All 13 comments

Fractional point sizes are sufficiently rare in the wild that I鈥檒l have to ask:
Why?

Vs Code permits fractional sizing, because the jump between 8 and 9 is quite drastic, especially on some fonts.
half-point differences are meaningful at this scale.

For example, Cascadia Code looks terrible at size 8
image

At size 9 it looks much better, but takes up too much space

image

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/

image

馃

I'm still puzzled by the drastic jump in font size between size 8 and 7. Especially compared to, say, VS Code.

1

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!

Was this page helpful?
0 / 5 - 0 ratings