Live data from Hacker News

Text Rendering Hates You

gankra.github.io

41–50 of 172 posts

Re: Text Rendering Hates You

#41
post #10

"If you're in Firefox or Chrome, it looks awful" Looks correct in Firefox 69.0.1 on Windows here. In Chrome it looks awful as described. In both the "bow" at the top overlaps the text on the previous line.

Looks like they changed things. The link [1] given is not working on firefox, while the website is telling me to use firefox.

[1] : https://colorfonts.langustefonts.com/disco.html

Re: Text Rendering Hates You

#42
post #35

>Rendering text, how hard could it be? As it turns out, incredibly hard! Related undesired complexities/heterogeneities I encountered while implementing a simple text drawing API on top of various libraries (cf. "Pain points", near the bottom): https://github.com/jeffhain/jolikit/blob/master/README-BWD.m...

> Libraries don't always provide font metrics, and when they do, these metrics are not reliable, as some glyphs can leak outside of their theoretical box, possibly depending on the used font size, or usage of diacritical marks

God yes. I'm building a UI design tool, and running head-first into this reality. I had no idea it was this hard.

Re: Text Rendering Hates You

#43
A few minor things missing in OP (mostly CJK related)

- Code point is sometimes not enough to determine the glyph. For example, U+5199 must look different in Simplified Chinese and Japanese. Typically this is handled by using different fonts, but more formally it should be marked with different lang attributes (in case of HTML).

- Top-to-bottom writing mode is still pretty much in use in Japanese. HTML support is poor, but it's common in PDF. Caveat: Latin alphabets are rotated by 90 degree (as explained in OP), but for punctuations, simply rotating the glyph isn't enough because the center line is going to be slightly off. You need special glyphs for rotated punctuation.

- Unlike Latin scripts, most Chinese and Japanese characters are free to break line at any point, but there are exceptions: contracted letters (e.g. ちょっ) cannot be split. So you'll end up with treating each letter as a separate word. (Contracted letters are treated as one word.)

Re: Text Rendering Hates You

#44

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…

Someday, 90% of people won't be running Windows... It's been said for decades now, but it might happen some day.

Re: Text Rendering Hates You

#45
post #40

Earlier quoted context omitted.

You can't convert a bitmap back into vectors (well maybe image recognition of some sort). Once you render to canvas its a bitmap and stays that way all the way to printer. SVG is turned into the appropriate PS/PDF vector drawing command by the browser print engine, canvas just gets sent as a bitmap in the printer language since that all that's left. I believe pdf.js incorporated and modified https://github.com/gliffy…

Yeah, ok, so we have essentially PDF -> SVG -> PDF/PS because of too many abstractions. It would make sense to expose some internal printing API to the embedded PDF reader so all this nonsense wouldn't be necessary.

Firefox tried to with mozPrintCallback specifically for pdf.js, then went away from that. Not sure what happened behind the scenes exactly as they wanted to get it standardized for canvas printing.

Printing is a forgotten corner on the web, would be nice if a mainstream browser implemented the full css print spec too so we could create page perfect output without relying on PrinceXml...

Re: Text Rendering Hates You

#48
> That said, if you take a screenshot of subpixel text you will absolutely be able to see the colors if you resize the image

I once tried to see the subpixel rendering using the Microsoft's magnifying glass tool. Got disappointed - the tool just disabled subpixel rendering. Globally, not just the area being magnified.

Re: Text Rendering Hates You

#49

For the color example they say "here's what they look like in Chrome and safari"... and show some horrible mess, yet I'm on Chrome and that isn't what I see at all? The text I see looks fine, although the font is different. https://imgur.com/a/5JZVZCB

I wonder if it is partially OS-dependent? I'm also on Chrome, but see something closest to the Safari version.

Re: Text Rendering Hates You

#50
post #12

>3.2 Style Can Change Mid-Ligature >Here's what they look like in Chrome and Safari: Running 76.0.3809.132 here on Mac OS and it looks very different from the picture. Bug partially fixed? https://i.imgur.com/CcjATLO.png

On the other hand, here's 3.1 on my MacOS Chrome, i don't think it's supposed to look like this:

https://imgur.com/HLiFPIt

Post reply on HN