
Tom Brinkman wrote:
I've written a few freetype wrappers over the years. I've since converted it to use boost::gil and will be submiting it to GIL graphics library developers as an extension. The source code is now available for the asking.
Yes please! One question: can it render text rotated by 90, 180, 270 degrees? Although the way the gil iterators work ought to make this possible, I'm not sure how you could interface between FreeType and that aspect of gil.
Yes, it supports "cleartype" and "kerning" so it will produce fonts are equivalent to Microsoft's and Apples. I've also added extras such as "word-wrapping" and "clipping".
I hope that by "clipping" you mean that I can say "render this ten-thousand-pixel-high glypth at (0,-9900) so only the last hundred pixels are visible", and have it do so efficiently. If so, great!
Heres a complete working example of its usage.
It looks rather low-level, presumably close to the native FreeType API. I'd prefer something a little more compact, e.g. image i; Font f("times",35); draw_text(i,0,0,f,"Hello World"); Unless I need to deal with the glyphs or kerning in some non-default way, I'd prefer to not see them. Presumably this sort of thing could be added on top of what you've described.
//Step 1. Initialize the freetype library FT_Library library; FT_Face face; FT_Init_FreeType(&library); FT_New_Face(library,"c:/fonts/mini/ARGOW___.TTF",0,&face); FT_Set_Pixel_Sizes(face,0,12);
Can you wrap all this up inside boost::freetype::library and boost::freetype::face classes? Regards, Phil.