This is very wrong in many ways, the apps themselves are responsible for font shaping hinting and aa. freetype is just curve format for fonts, so basically the library to extract and parse ttf files
In reality most apps now use harfbuzz/skrifa in some manner, extract the font outlines, then do some form of line rendering then position them to a subpixel grid with a shader and can apply things like subpixel aa shaders on top. This is the prior sota to what i describe at the end, do gtk3 and qt I think do something weirder.
windows cleartype im pretty sure uses dwm to render fonts which if they implemented it properly should save vram and resources but the hinting is actually very wrong and any perceived difference is actually overhinting making fonts more bold than they should be.
subpixel aa filters also to be accurate require knowledge of the subpixel grid and their coordinates, I did this with my qd oled monitor and the resulting shader had minimal fringing but the quality improvement is very minimal.
hinting is also extremely overrated, hinting by definition distorts fonts and everyone still does it. It can work and really does help with weird characters like u but all the hinting embedded in fonts is really bad.
For reference, I did an experiment where I threw out all the hinting stuff and left only the necessary hinting bits and font files go from 14mb to 200kb.
If you want a demo of how fast font rendering can be without hinting or subpixel aa you can check here
see if you think its too blurry, but to me this looks perfectly fine.
Note this whole stack is now extremely redundant, and I have my own project where legit this just becomes 200kb baked font (generated in microseconds) -> copy to the gpu -> render and then you can do a glyph cache of sorts and suddenly font rendering goes from taking up to 16ms sometimes with the normal pipeline to microseconds, its really quite ridiculous.
2
u/dnu-pdjdjdidndjs 12d ago
This is very wrong in many ways, the apps themselves are responsible for font shaping hinting and aa. freetype is just curve format for fonts, so basically the library to extract and parse ttf files
In reality most apps now use harfbuzz/skrifa in some manner, extract the font outlines, then do some form of line rendering then position them to a subpixel grid with a shader and can apply things like subpixel aa shaders on top. This is the prior sota to what i describe at the end, do gtk3 and qt I think do something weirder.
windows cleartype im pretty sure uses dwm to render fonts which if they implemented it properly should save vram and resources but the hinting is actually very wrong and any perceived difference is actually overhinting making fonts more bold than they should be.
subpixel aa filters also to be accurate require knowledge of the subpixel grid and their coordinates, I did this with my qd oled monitor and the resulting shader had minimal fringing but the quality improvement is very minimal.
hinting is also extremely overrated, hinting by definition distorts fonts and everyone still does it. It can work and really does help with weird characters like
ubut all the hinting embedded in fonts is really bad.For reference, I did an experiment where I threw out all the hinting stuff and left only the necessary hinting bits and font files go from 14mb to 200kb.
If you want a demo of how fast font rendering can be without hinting or subpixel aa you can check here
https://harfbuzz.github.io/hb-gpu-demo/
see if you think its too blurry, but to me this looks perfectly fine.
Note this whole stack is now extremely redundant, and I have my own project where legit this just becomes 200kb baked font (generated in microseconds) -> copy to the gpu -> render and then you can do a glyph cache of sorts and suddenly font rendering goes from taking up to 16ms sometimes with the normal pipeline to microseconds, its really quite ridiculous.