Hi,
I'm creating an font system that uses bitmap fonts generated from freetype
to be used in my game engine. It appears that even though I have specified
a pixel size of 64px there are characters that are rendered outside the
actual pixel size I have specified though the actual FT_Face->Glyph->Bitmap
is actually smaller the 64px. There also seems to be a big gap of
approximately 12px above glyphs. Below is the code I am using for placement
on a flat bitmap.
------------------------------------- CODE
-----------------------------------------
font_size = 64;
/* convert to an anti-aliased bitmap */
FT_Render_Glyph( freetype_face->glyph, FT_RENDER_MODE_LCD );
//This reference will make accessing the bitmap easier
FT_Bitmap& bitmap=freetype_face->glyph->bitmap;
for (int y = 0; y < bitmap.rows; y++)
for (int x = 0; x < bitmap.width; x++)
{
pixel_t pixel = { 0, 0, 0, bitmap.buffer[bi]};
putpixel((xoffset+x), (yoffset+y+
font_size-abs(freetype_face->glyph->bitmap_top)), maxwidth, fontdata,
pixel);
bi++;
}
xoffset += bitmap.width;
---------------------------------- END CODE
------------------------------------
I've included a sample png image showing the results. Help please?
Regards,
Shomari Sharpe
_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype