LWN.net Logo

LGM: Unusual typography

LGM: Unusual typography

Posted May 21, 2012 7:40 UTC (Mon) by kRogue (guest, #84728)
In reply to: LGM: Unusual typography by Sho
Parent article: LGM: Unusual typography

Qt uses a sampled distance field computed on CPU. There are a lot of issues with sampled distance fields:
1) corners rounded
2) "boundary acne" where on stems of letters sometimes there are bumps. You also see these bumps if two features are very close

Atleast Qt made their distance field creation better, essentially rasterziing the distance values on CPU..

Buy Glyphy and Qt's distance field are in completely different categories. Roughly speaking, sampled distance field is from a visual point of view, is severely inferior to Glyphy.

On the other hand, Glyph's fragment shader is very, very heavy. Lots of branching, potentially lots of texture look ups. It will murder current embedded devices. Also a touch worried about it's memory usage.. I have not figured out if the arc-entries are reused, or if each texel has it's own list embedded within the texture. If the latter, Glyphy has very heavy texture usage, but this can be avoided. For each contour of the font, just record the arc entries together with a location of the "next" contour, or one can also just make the list repeated twice, i.e. if the contour list is A0, A1, .., An then record it as A0, A1,..., An, A0, A1, ..., An thus is one starts at say An, it will just work as a blind texture walk.

Also consider, if GL3 is on the menu, using texture buffer objects to hold the arcs.

As a side note, with (some) ATI Catalyst drivers, Glyphs renders ickily.. changing the texture look up from texture2D to texture2DLod fixes the issue. This is likely an ATI bug (I have experienced it in my own funky font rendering jazz).


(Log in to post comments)

LGM: Unusual typography

Posted May 24, 2012 22:10 UTC (Thu) by behdad (subscriber, #18708) [Link]

Thanks kRogue for the detailed feedback!

Yes, GLyphy as it is is very heavy on the GPU. I'm sure embedded devices would struggle, but seems like on desktop it's not far from usable. I mean, it gives me a decent framerate on my 2-year old Thinkpad with intel graphics and Linux mesa driver...

That said, after discussions at LGM, I have at least three pages full of ideas for optimizing it. It's just a matter of time.

Also, we already do try to share arcs among cells. Current memory usage is about 2k per glyph for a sans serif font. I think we can get that down to about 1k.

At any rate, feel free to join the Google Group and continue discussion there.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds