LinGreg
11-12-2007, 05:52 PM
I'm using freetype2 to get bitmaps of characters, but they look 'twisted' and distorted. I can tell they are the correct characters, but they are just distorted. My code looks something like:
FT_Library library;
FT_Face face;
FT_Init_FreeType( &library );
FT_New_Face( library, "/usr/share/fonts/freefont/FreeMono.ttf", 0, &face );
FT_Set_Char_Size( face, 0, 64*64, 300, 300 );
FT_ULong charcode = static_cast<unsigned int>('A');
int glyph_index = FT_Get_Char_Index( face, charcode );
FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_HINTING );
FT_Render_Glyph( face->glyph, FT_RENDER_MODE_NORMAL);
gl stuff ...
glRasterPos3i(0,0, -2);
glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, face->glyph->bitmap.buffer);
I trying explictly converting it into a bitmap, tried loading with and without hinting, but still the same problem.
Thanks,
Greg
FT_Library library;
FT_Face face;
FT_Init_FreeType( &library );
FT_New_Face( library, "/usr/share/fonts/freefont/FreeMono.ttf", 0, &face );
FT_Set_Char_Size( face, 0, 64*64, 300, 300 );
FT_ULong charcode = static_cast<unsigned int>('A');
int glyph_index = FT_Get_Char_Index( face, charcode );
FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_HINTING );
FT_Render_Glyph( face->glyph, FT_RENDER_MODE_NORMAL);
gl stuff ...
glRasterPos3i(0,0, -2);
glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, face->glyph->bitmap.buffer);
I trying explictly converting it into a bitmap, tried loading with and without hinting, but still the same problem.
Thanks,
Greg