1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| FT_UInt glyph_index = FT_Get_Char_Index(face,charIndex); FT_Load_Glyph(face,glyph_index,FT_LOAD_DEFAULT);
FT_Glyph glyph; FT_Get_Glyph(face->glyph,&glyph);
FT_Stroker stroker; FT_Stroker_New(ft,&stroker); FT_Stroker_Set(stroker, 1.25 * 64 , FT_STROKER_LINECAP_BUTT,FT_STROKER_LINEJOIN_ROUND,1.25 * 64); FT_Glyph_Stroke(&glyph,stroker,true); FT_Vector v; v.x=0; v.y=0; FT_Glyph_To_Bitmap(&glyph,FT_RENDER_MODE_NORMAL,&v,true); FT_BitmapGlyph bmGlyph = reinterpret_cast<FT_BitmapGlyph>(glyph); int width = bmGlyph->bitmap.width; int height = bmGlyph->bitmap.rows;
for(int i=0;i<width*height;i++){ if(i%width==0){ std::cout<<std::endl; } printf("%02X ",bmGlyph->bitmap.buffer[i]); } std::cout<<std::endl;
|