4 ms·
> After all, there's no point re-doing all the calculations to draw all the curves in a letter 'g' when the output is going to look just the same as the last ti
by acdha 10y ago
> After all, there's no point re-doing all the calculations to draw all the curves in a letter 'g' when the output is going to look just the same as the last time you drew it...
Beyond the sub-pixel aliasing and CJK questions other people asked, a fair number of people use languages like Arabic, Devangari, etc. which have complex rules for how adjacent characters affect rendering (you can see something like this in English with a font like Zapfino which has ligatures: http://download.linotype.com/free/howtouse/ZapfinoTips_e.pdf http://download.linotype.com/free/howtouse/ZapfinoTips_e.pdf). I would imagine all of that would conspire against cache hit rates more than we might guess.
That's not to say this isn't great work but just that any time something involves text rendering it seems to inevitably sprout special cases on the special cases.
- posterboy 10y agohard to imagine the code used to render the bitmaps would be smaller and hence less often lead to cache misses than the bitmaps.
- munificent 10y agoacdha is referring to the cache of rendered bitmaps, not the CPU cache. Font renderers that cache keep a cache of bitmaps for glyphs that it has previously rendered. Since you need a separate bitmap for each Unicode codepoint or ligature × font size × subpixel offset, the cache could potentially get huge. So, they cap the number of bitmaps that get cached and evict some. But when you're animating a font's size or dealing with non-Latin languages, you're churning through so many unique bitmaps that you end up not getting much value from the cache.
- witty_username 10y agoDevanagari is not a language; it's a writing script.
- acdha 10y agoYou're right, I should have been less colloquial in that reference since I was using “Arabic” in reference to the script, which is used by multiple languages.