Hi there,
I'm trying to create a border outline around my FreeType glyphs with the stroke functions (
FT_Stroker_New,
FT_Glyph_Stroke, etc), but I'm not getting the desired bitmap out.
The general flow looks like this:
FT_New_Memory_Face()
FT_Set_Pixel_Sizes()
FT_Stroker_New()
FT_Stroker_Set(..., 2, FT_STROKER_LINECAP_ROUND, FT_STROKER_LINEJOIN_ROUND, 0)
FT_Load_Glyph()
FT_Get_Glyph()
FT_Glyph_Stroke()
FT_Glyph_To_Bitmap(..., FT_RENDER_MODE_NORMAL, ...)
Once I've generated the stroked bitmap, I render it on top of the actual glyph and everything is fine and dandy.. except that the pixel values of the stroke bitmap seem to be incorrect.
Since the stroked bitmap is anti-aliased, opaque pixels are supposed to have the value 0xFF (just like when I render the actual glyph), but in this case I'm getting no opaque pixels; all the bitmap's pixel values range between 0x00 and 0x12-ish. This makes it hard for me to actually render the border since it has no opaque pixels, as you can tell from the following screenshot:
https://dl.dropbox.com/u/2406449/FreeType/Stroke.jpg