tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
76.07k stars 3.07k forks source link

Digit 9 height inconsistent with rest #1515

Open ghost opened 1 year ago

ghost commented 1 year ago

Question

Is alignment of digits of default stylistic set (no feature selected) supposed to be equal at top and bottom bounds? I really like Fira Code overall, yet cannot use it at the moment as I fail to ignore the seeming inconsistency. Maybe there's a solution.

Observation

I cannot quite tell if 9 is misaligned or actually taller than the other digits, but in different terminals on Wayland (foot, alacritty, kitty, wezterm) it sticks out anytime there's a 9 on display within other digits: image

After taking a screenshot and marking the bottom, it looks like 3 is the same: image

And looking at the top, 1 doesn't align with 9 and seems like neither does it with 3 (slightly): image

Same result with GTK3's font renderer: image

kenmcd commented 1 year ago

Overshoot - Google Fonts Glossary https://fonts.google.com/knowledge/glossary/overshoot

Overshoot (typography) - Wikipedia https://en.wikipedia.org/wiki/Overshoot_%28typography%29

This Optical Illusion Tricks You Into Thinking That Typeface Letters Are the Same Height https://slate.com/human-interest/2015/04/tobias-frere-jones-explains-the-optical-illusion-that-tricks-our-brains-into-perceiving-typeface-letters-are-of-equal-height.html

Normal practice.

ghost commented 1 year ago

Thanks for the typography knowledge, TIL. Is it a deliberate stylistic choice in Fira Code?

kenmcd commented 1 year ago

Is it a deliberate stylistic choice in Fira Code?

Yes. You will find overshoot in most fonts. Overshoot above the cap height, and overshoot below the baseline. To appear visually the same height.

ghost commented 1 year ago

Thanks for sharing more knowledge. Not arguing sytlistic choice, only trying to learn more even if there's no technical solution given the design constraints of the typeface.

To appear visually the same height.

Does that mean the style is perceived as equal height by humans with a differently wired visual cortex than mine? I mean, 9 and 3, two round shaped glyphs, distinctly break out of the box for me in source code.

tonsky commented 1 year ago

It shouldn’t be that noticeable on low font sizes. Can you show 100% screenshots where you can see 9 and 3 breaking out of the box?

ghost commented 1 year ago

In Alacritty at size 13 Fira stays inside the box. To check, open the screenshots and zoom in.

If I zoom in and out, I can see undershoot at some of the small sizes and overshoot at anything above 13. Increasing size further away from 13 seems to render inside the box at some sizes and go back to overshoot at most sizes. Some cyclic back and forth from overshoot to fitting inside the box.

size 13 ok

image

size 12 miniscule undershoot at bottom, easy to overlook

image

size 10 overshoot

image

size 11 overshoot

image

size 15 overshoot

image

tonsky commented 1 year ago

Wait, you mean at the bottom? Because all your screenshots have perfectly flat top

ghost commented 1 year ago

Yes, from what I've noticed, it's all at the bottom. 9 jumps from overshoot to fit-in and back while cycling font size in alacritty. Size 13 is one of the levels where it stays inside. And at size 12 there's a miniscule undershoot.