
Playing with fonts - Moist-Toes
https://venam.nixers.net/blog/unix/2020/09/14/playing_with_fonts.html
======
bscphil
This is a _great_ post. I love messing with fonts on Linux, but I ended up
with settings that work great for me years ago, so I don't do it much any
more. (The game changer was when many of the infinality patches were rolled
into fontconfig, so you don't need to build it yourself any more to get great
rendering.)

The most important takeaways if you're on Linux:

1\. Make sure you have autohint=false (except for individually chosen fonts
that might need it). You don't want the renderer ignoring the individual
font's hinting information and trying to do it itself: results are usually
quite bad.

2\. Make sure you have the correct subpixel rendering for your screen (usually
rgb) and enable the lcdfilter. I prefer "lcdlight". Comparison of different
lcdfilter settings here:
[http://www.spasche.net/files/lcdfiltering/](http://www.spasche.net/files/lcdfiltering/)

3\. Consider disabling hinting entirely. I hate it. On a high DPI screen, you
don't need hinting at all, because the edges of a glyph will already align
very closely with the pixels. On a low DPI screen, especially as you get down
closer to 96 dpi, the amount of distortion needed to align the font with the
grid completely mangles it. You might think there's a sweet spot where hinting
makes sense, but I've never seen one.

The article actually has a picture illustrating this beautifully: look how
much better the unhinted rendering is than the hinted one!
[https://venam.nixers.net/blog/assets/fun_with_fonts/ftdiff_v...](https://venam.nixers.net/blog/assets/fun_with_fonts/ftdiff_v40.png)

If you do disable hinting, you should also change your desktop environment's
default fonts to a family that has very good _unhinted_ pixel alignment even
at small sizes. I use Adobe's "Source" family, and it looks fantastic, even at
my desktop's 10pt default size.

~~~
AlanYx
The last example you provided is very helpful, thanks. I'm surprised that the
unhinted rendering is so good.

------
BearOso
> Antialiasing: Applying a light shade around the glyph. It is useful at small
> scale, when you don’t have enough pixels, but it makes the glyph look
> bolder.

No, poor antialiasing makes the glyph look bolder. Specifically, drawing the
antialiased text without taking into account screen gamma causes that.

 _edit_ Noticed this also:

> lcddefault is color-balanced and normalized

You’d expect it to be, but not everywhere. The filter sum is ~1.4 or so with
many libraries. This is to offset the gamma problem I mentioned above. I think
skia’s renderer now actually does have sub-pixel gamma correction, and is
properly normalized.

~~~
nyanpasu64
And Mac's (subpixel only?) antialiasing algorithm thickens text beyond its
true borders. There may be a way to disable this globally though.

------
userbinator
I personally prefer all antialiasing off (especially subpixel, which looks
good at first but feels fatiguing to read and eventually causes tears and
headache), and found the fixed-width bitmap font he uses to caption the images
the most readable of all --- it appears to be one of my favourite fonts, the X
Fixed family:
[https://en.wikipedia.org/wiki/Fixed_(typeface)](https://en.wikipedia.org/wiki/Fixed_\(typeface\))

~~~
_emacsomancer_
misc-fixed are really great fonts (I wish they handled devanagari/indic
scripts - that unfortunately seems unlikely to happen:
[https://www.cl.cam.ac.uk/~mgk25/ucs-
fonts.html](https://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html) , though some of
them do handle other abugidas like ge'ez/ethiopic)

------
p1necone
No text looks better or reads more easily to me while coding than a monospaced
bitmap font at about 10pt and 100ish DPI. (And yes, I've read properly
antialiased text on a high DPI screen).

Of course this is probably a product of nostalgia and familiarity as much as
it is actual general readability.

~~~
0xdeadb00f
I have no nostalgia associated with pixelated or bitmap fonts, but I agree. So
it might not entirely be your nostalgia leading you to the preference :p

After using bitmap fonts for a while I can't help but notice how imperfect
antialiasing, and other ways of smoothing fonts are.

To the point where it distracts me. For example, when using Windows Terminal;
"Huh? Is that font meant to look like that? Better check all my windows font
settings and use that pointless wizard for the 5th time".

I cannot use a terminal font on *nix that isn't a bitmap font. I hate anything
else.

That being said I haven't tried any of the tricks in the article, maybe those
will sort out my problems with my non-bitmap font rendering.

------
sitzkrieg
its sad getting readable fonts in linux is still a bit of a waste of time

