News for hackers. Stuff that matters.
Re:System Font Stack by tshaddox on Saturday May 28, 2022 @07:29PM (#31544788)
It’s not as petty as you make it sound. You don’t have to pixel peep to spot the differences. Switching to a different font can break basic stuff like text in a button being vertically centered, which can look broken or amateurish to normal site visitors.
Re:System Font Stack by blep_ on Saturday May 28, 2022 @09:09PM (#31545287)
Only if you're doing centering by hardcoded pixel offsets. Stop doing that.
Re:System Font Stack by thundermuffin on Saturday May 28, 2022 @09:30PM (#31545406)
You can still have this problem apply even if you are using flex and aligning items to the center.

If a font has some weird characteristic about it (for instance, the font itself has built in whitespace at the bottom or top of letters), you will not be able to center it vertically no matter what CSS magic you try to do except for doing some kind of translation on it; that translation doesn't have to be pixel-based either, but it will 100% have to happen until hopefully when the leading-trim property that saadat mentioned is widely available.

Re:System Font Stack by bufferoverflow on Saturday May 28, 2022 @11:14PM (#31546006)
I don't think you understand the problem.

Here, try to align these without changing individual p's CSS:

https://jsfiddle.net/a3q87ucs/

You see how the second text is lower. That has to do with internal font settings that CSS has no control of. Not yet at least.

Re:System Font Stack by Hello71 on Saturday May 28, 2022 @11:48PM (#31546209)
this only looks terrible because you've forced a specific height in rem. https://jsfiddle.net/vbd3fok5/ looks fine to me. there is some extra space, but I assume that if the font designer added extra space on top of the text, they did it on purpose. if you insist on ignoring that, https://jsfiddle.net/qpb0d45n/ makes the text "visually continuous", at least for a non-Korean reader like myself. I would speculate that a Korean user might look at this and ask why the site designer ignored their font's preference for space above the text.
Re:System Font Stack by bufferoverflow on Sunday May 29, 2022 @12:41AM (#31546451)
> https://jsfiddle.net/vbd3fok5/ looks fine to me

No, it doesn't. Here's the screenshot with a line I added:

https://i.imgur.com/6pLiasn.png

> if you insist on ignoring that, https://jsfiddle.net/qpb0d45n/

And now you have blocks of different heights. Which cause other issues.