Live data from Hacker News

Text Rendering Hates You

gankra.github.io

71–80 of 172 posts

Re: Text Rendering Hates You

#71
> So subpixel-AA is a really neat hack that can significantly improve text legibility, great! But, sadly, it's also a huge pain in the neck!

When playing around with FreeType's ftview demo program, text rendered with an OTF/CFF font using the Adobe CFF renderer with stem darkening enabled actually looks pretty good with grayscale rendering. Subpixel rendering is not strictly necessary.

> https://gankra.github.io/blah/text-hates-you/#aa-breaks-glyp...

I think the author mixes up two concepts here, hinting and subpixel positioning.

A TrueType font can change stuff around on the x and y-axis. Applying hinting on the x-axis messes with your layouting and prevents subpixel positioning on the x-axis. What you do is apply hinting on the y-axis only (FreeType calls this slight hinting, DirectWrite more or less does this -- not quite, but close enough) so you are free to shift glyphs around on the x-axis. This helps with displaying text with a more even texture on LoDPI screens. On *nixes, Chrome does this, Firefox doesn't.

Re: Text Rendering Hates You

#72
post #57

I find it... odd that an article on font rendering is using a 14px forced font size (default: 16px) making the article really hard to read on my 14" laptop screen from a foot away. Subpixel antialiasing on my LCD screen is just not my problem here, author. :)

I am a partially vision-impaired man, and I really can't stand the dark-grey on light-grey texts that a lot of modern web pages have. They are essentially unreadable to me. In order to comfortably read this article, I had to go to Firefox's Style Editor and make the text actually black. And it is ironic that an article about text rendering uses such low-contrast and small-sized text.

> In order to comfortably read this article, I had to go to Firefox's Style Editor and make the text actually black

Does the Reader View in Firefox help here?

Re: Text Rendering Hates You

#73
I realize it’s probably too late, but as a graphics person, every time I read about text antialiasing, I wish we could rewind and fix the terminology of “Subpixel antialiasing” and “Greyscale antialiasing”. It seems problematic that greyscale antialiasing involves subpixel sampling and color channels.

I’d suggest “LCD antialiasing” to replace “subpixel antialiasing”. And regular antialiasing doesn’t really need a term, it was already established long before LCDs existed. AFAICT “Greyscale antialiasing” was made up only to differentiate regular antialiasing from LCD antialiasing.

Re: Text Rendering Hates You

#74
There are few things that scare me as a software engineer. Regex usually comes to mind first, but then I remember ... text rendering.

Just reading Microsoft's Michael J Kaplan's blog (RIP) about Unicode, and how that plays into rendering, was daunting enough.

But this article really points out how ridiculous it can get. No thanks, I'll stick to the easy stuff like my current project, Angular 8 / .Net Core, and let Firefox handle the tricky bits.

Re: Text Rendering Hates You

#75
post #71

> So subpixel-AA is a really neat hack that can significantly improve text legibility, great! But, sadly, it's also a huge pain in the neck! When playing around with FreeType's ftview demo program, text rendered with an OTF/CFF font using the Adobe CFF renderer with stem darkening enabled actually looks pretty good with grayscale rendering. Subpixel rendering is not strictly necessary. > https://gankra.github.io/blah…

+1. Subpixel AA seemed quite necessary back in the day with Windows XP and tiny, precisely hinted Tahoma/Verdana/etc.

These days, with bigger better bolder fonts, better renderers, and the departure from pixel-perfect stuff in favor of higher resolutions, subpixel is absolutely unnecessary.

Even on LoDPI screens I turn it off (assign none to lcdfilter in fontconfig) because the color fringes are so ugly. I always notice them.

Re: Text Rendering Hates You

#76
post #36
post #24

Earlier quoted context omitted.

With high density monitors on the rise we should get rid of LCD (RGB rainbows) anti alias as its really just a hack.

I strongly disagree, also the way the article describes subpixel antialiasing is not entirely accurate. The thing is the boundaries between pixels don't actually exist, it's just a convention so we can address individual pixels and subpixels within them. But these subpixels are not at the same position within the pixels and this needs to be taken into account for antialiasing. Also regarding hiDPI: I know that you ju…

Pretty much no one wants to get rid of antialiasing in general.

I use only grayscale antialiasing, even on LoDPI screens. It looks great. Subpixel adds bad color fringes.

Re: Text Rendering Hates You

#77

If it weren't for Windows, we could move on from TrueType outlines (.ttf) to CFF outlines (.otf). .otf works nicely on non-Microsoft rasterizers. It was terrible on XP. Now on Windows 10 it’s less terrible, but .otf fonts on Windows 10 using DirectWrite look bolder and blurrier than using FreeType, Apple, or Adobe rasterizers. If Microsoft adopted the Mac font rendering aesthetic and fixed their CFF rasterizer, we wo…

That's the difference between ttf and otf? And that's why certain fonts look slightly different between platforms! This is a serious revelation to me. Thank you. I've been having to switch between my Mac laptop, Linux workstation, Windows 10 workstation, and Windows 10 Amazon Workspace a lot. It's been frustrating seeing the small differences but being unable to really figure out what was going on.

The primary visible difference is the way hinting works in both formats. TrueType-flavored fonts (.ttf) must be explicitly programmed; how good this looks depends on in which decade the font was hinted and how much money, time and skill went into it. Postscript-flavored fonts (.otf) can be outfitted with some hinting metadata and have an automatic hinting tool run on them, applying the hints is then completely up to the renderer. This has the disadvantage that the designer has less control over the end-result and the advantage that the renderer can interpret hints differently if some text display technology/stack changes.

I personally find Adobe's .otf renderer in FreeType the best compromise between aesthetically pleasing and legible and can only recommend using exclusively .otf fonts on FreeType platforms.

Re: Text Rendering Hates You

#78
post #73

I realize it’s probably too late, but as a graphics person, every time I read about text antialiasing, I wish we could rewind and fix the terminology of “Subpixel antialiasing” and “Greyscale antialiasing”. It seems problematic that greyscale antialiasing involves subpixel sampling and color channels. I’d suggest “LCD antialiasing” to replace “subpixel antialiasing”. And regular antialiasing doesn’t really need a ter…

"Subpixel" makes more sense than "LCD": the technique applies to any screen with illumination units smaller than a pixel (eg. LED screens) so "subpixel" makes perfect sense.

Re: Text Rendering Hates You

#79
post #66
post #29

Earlier quoted context omitted.

In the first case, I believe that it's normally referred to as "subpixel antialiasing". And in the second case, "subpixel positioning".

Yes, good point, but what would you call it if you'd apply both concepts at the same time?

Subpixel antialiasing plus subpixel positioning :)

They are orthogonal concepts.

Re: Text Rendering Hates You

#80
Once upon a time I wrote an automated newspaper layout/preview system in Cocoa, the rendering engine in MacOS.

It was the only thing I could find that could do high quality text (ligatures, OpenType fonts, etc.), had native CMYK support, and could produce a print ready PDF or JPEG preview in milliseconds.

I can’t open source the code, but if anyone ever needs to embark on something similar I’d be happy to share what I learnt.

Post reply on HN