Nicolas Rougier
unread,Mar 8, 2012, 3:35:35 AM3/8/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to freetype-gl
This is a follow-up from issue 15 (reported by wangyongcong) that is
more of a feature request than a real issue:
We could benefit much from euclidean distance transform, such as none-
cost scaling, easily outline / glow rendering... I'm trying to use edt
font in my game, the main idea is:
1, generate high resolution bitmap glyph (1024x1024 or bigger) with
Freetype
2, generate the distance transform of it
3, down sample the edt bitmap (scale to 32x32) and pack it into atlas
Then we could use it as normal glyphs.
Here is a simple demo (which is modified from demo-distance-field.c)
to demonstrate the idea. It print a line of text on the screen. You
could press +/- key to scale text size, and spacebar to show atlas.
The bigger the original font size, the better the scaled output.
It's an useful technique and could be part of texture_font_t : )
Notice: The program is only tested under VS. If you gat problems,
please email me