Live data from Hacker News

Text Rendering Hates You

gankra.github.io

91–100 of 172 posts

Re: Text Rendering Hates You

#91
post #19

> Synthetic bold: paint every glyph multiple times with a slight offset in your text-direction. Designers forgetting to include a bold version of their web fonts is one of my biggest bug bears. It always stands out, especially on Safari on iOS as you zoom in and out.

> forgetting

Or rather deliberately not including to decrease download size.

Though OpenType variable fonts are a thing now. e.g. Inter https://rsms.me/inter/ has a variable version

Re: Text Rendering Hates You

#92
post #52
post #2

Another pain point on text AA: Many renderers mix up colorspaces on antialiasing. For example freetype assumes a linear colorspace when calculating the antialiased bitmap but AFAIK both GTK and QT apply it directly on sRGB without any adjusting. The result is apparently thickened fonts when displayed black on white and thinned fonts when displayed white on black. Edit: Some background can be read on [0]. [0] https://…

Qt does do gamma correction when it comes to text rendering.

Maybe for blending, white on black text and things like that - after calculating shades the "wrong" way for compatibility with fonts' built-in expectations. See my other comment about that.

Re: Text Rendering Hates You

#93

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 format of outlines is only difference between .ttf and .otf, yes. .ttf has quardratic Bézier curves and hinting is done by interpreted programs (on Windows; TrueType has generate hints at run-time). .otf has cubic Bézier curves and declarative hints.

The outline format of .otf comes from Adobe Type 1 fonts (.otf really is just .ttf with outline format taken from Type 1), so the .otf outline format is the older one. Apple created TrueType after licensing talks with Adobe failed long ago.

.otf is generally more compact in terms of font file size than .ttf. Really the only reason to stick with .ttf is the rasterizer situation on Windows and outlines traveling from Linux and Mac to Windows in PDFs.

Re: Text Rendering Hates You

#94
post #88

Earlier quoted context omitted.

I've been doing text rendering professionally for a few years now and I wouldn't consider myself fluent in anything other than English and maybe German (I'm a bit rusty in the latter). I can also speak some Japanese, but, other than that, that's it. The rest of my knowledge is a smattering of weird details about various languages that are useful for writing text renderers but terribly unhelpful for actually understan…

Yeah there's a reason all my examples use the same ~3 languages, and only a few random fragments from them. You just need a few examples that demonstrate that something can happen. Everything actually works pretty uniformly, so as long as you have a few examples that cover the interesting cases and handle those cases in a general way, everything tends to work fine. The actual font formats are much more nasty and corn…

> Apparently at least one is just Manish's name?

Yes, I noticed that. :) Both मनीष and منش are "Manish", though he didn't bother with the vowels in the Arabic-script version, so alternative readings are possible.

Re: Text Rendering Hates You

#95
post #63
post #36

Earlier quoted context omitted.

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…

It’s pretty much arbitrary what we as an industry have decided “text” means (and this has changed over the years), and what features it ought to support. It’s largely “what our technology easily supports today”. For example, most people expect antialiasing (i.e., subsampling across space) but we seem to have written off the idea of motion blur (i.e., subsampling across time), except in some games. It’s be technically…

Antialiasing (nominally) makes text easier to read. Motion blur makes everything it's applied to harder to see.

Re: Text Rendering Hates You

#96
post #36

Earlier quoted context omitted.

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.

Doesn't it depend on the screen and user preference though? On my old Thinkpad's screen grayscale antialiasing looks awful (fuzzier and harder to read), to the point where I've filled bugs when some aspect of a program's UI doesn't obey my system settings.

Re: Text Rendering Hates You

#97
post #70
post #23

Earlier quoted context omitted.

I think Chrome (PC/Android) implements synthetic bold by expanding the glyph outline, then drawing it with subpixel off. It's prettier than Firefox's "horizontal-only extrusion", but sometimes leads to funny artifacts at sharp corners.

How Firefox implements synthetic-bold varies across different platforms, actually, depending on the features of the (platform-specific) font rendering backend it's using. It uses the paint-multiple-times-with-a-small-offset approach when the font backend doesn't seem to offer a "better" synthetic-bold option.

Yeah the smearing approach is the only one that merits a callout from my position in the pipeline, because the other approaches are handled by your shaper or rasterizer, which are usually 3rd party libs that can be mostly regarded as black boxes.

Re: Text Rendering Hates You

#98

Earlier quoted context omitted.

This for sure. I love my iMac 27” 5k simply because how text looks on it so much better than even a 28” 4K. 220 DPI is a magical number

Interesting, my main screen is 160dpi@27", and I would love to try something at 300dpi@27". It's difficult to figure out how much of a difference a screen is going to make at 160 vs 220 vs 300dpi unless you sit down and just work for a few days.

Edit: obviously that is only for the resolution...

Try looking at any recent smartphone with an at least full-HD display ;) To appreciate just how many pixels there are and how many pixels per glyph, take a screenshot and look at it on a computer monitor. It's kind of surprising.

Re: Text Rendering Hates You

#99
post #51

Earlier quoted context omitted.

Elaboration for "ちょっ" Japanese hiragana chi, small yo, and small tsu. Hiragana is a syllabary (not alphabet!) comprised of 46 sounds. Small hiragana can be used to modify the sound of the leading character to expand the set of available phonemes. Here, "Chi (small)yo" becomes "cho". Small tsu is special. It represents a doubled or germinated consonant. For example ちょっと (chotto) sounds like chot-to. Example: https://m…

Japanese is one of the few languages with a worse writing system than English. Hats off to them for it. I do miss the pre-war spellings though, where they wrote things based on 10c pronunciation, eg AU is pronounced OH (like in French). Tibetan is also in pretty desperate need of spelling reform. I’d love to hear replies about other terrible writing systems.

In the scheme of writing systems it's hard for me to see why English is so bad. In general writing (like spoken grammar) is so heavily used that all the "rough corners" get sanded smooth pretty rapidly and continuously. For example, though the histogram of Kanji/Hanzi has a very steep drop-off, it's not that hard for people to recognize and keep track of, because characters that were hard to read at first tend to get restructured or dropped.

As far as Indo-European languages go, languages like English and French are quite conservative in spelling and underlying meaning, which means they do diverge from pronunciation but retain semantic clues which help the reader unlock the meaning of unknown words. While languages that continuously reform to try to match pronunciation shifts (e.g. German) discard this info. In addition they have to pick one canonical pronunciation, and themselves typically retain various homophonic issues (e.g. how many ways can you write the sound of ä (I don't mean "ae")).

Even as a kid (should be "easy to learn", right?) I struggled far more with the variants of the devanagari alphabet even though it was so phonetic. But hundreds of millions of people use it every day without thinking about it.

Re: Text Rendering Hates You

#100

Earlier quoted context omitted.

If we consider smartphone browsers, that time has already come to pass!

Half sure, 90% no.

There are over 2.5 billion active Android devices (https://twitter.com/Android/status/1125822326183014401). There were over 700 million active iPhones in 2017, likely more today (https://fortune.com/2017/03/06/apple-iphone-use-worldwide/). So conservatively there are over 3 billion smartphones.

Microsoft claims there are over 1 billion Windows 10 installations (https://news.microsoft.com/bythenumbers/en/windowsdevices/) and over half are running Windows 10; so that means that less than 2 billion Windows installations are in existence.

The numbers are pretty clear at this point.

Post reply on HN