Freetype: change size with dificulty

This commit is contained in:
Edouard Dupin 2011-11-04 18:20:49 +01:00
parent b1b8cae9cf
commit ebd9868153

View File

@ -239,11 +239,10 @@ void ewol::Windows::SysDraw(void)
EWOL_INFO(" Current size = " << face->size); EWOL_INFO(" Current size = " << face->size);
// set size : // set size :
error = FT_Set_Char_Size(face, /* handle to face object */ int32_t fontSize = 12;
0, /* char_width in 1/64th of points */ int32_t fontQuality = 96; // 300dpi (hight quality) 96 dpi (normal quality)
16*64, /* char_height in 1/64th of points */ error = FT_Set_Char_Size(face, fontSize<<6, fontSize<<6, fontQuality, fontQuality); // note tha <<6==*64 corespond with the 1/64th of points calculation of freetype
300, /* horizontal device resolution */ float lineHeight = fontSize*1.43f; // the line height to have a correct display
300 ); /* vertical device resolution */
/* retrieve glyph index from character code */ /* retrieve glyph index from character code */
int32_t glyph_index = FT_Get_Char_Index(face, 'A' ); int32_t glyph_index = FT_Get_Char_Index(face, 'A' );
@ -314,18 +313,18 @@ void ewol::Windows::SysDraw(void)
*/ */
glColor4f(1.0, 1.0, 1.0, 1.0); glColor4f(0.0, 0.0, 0.0, 1.0);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TMPtextureid); glBindTexture(GL_TEXTURE_2D, TMPtextureid);
glBegin(GL_QUADS); glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glTexCoord2f(0.0, 0.0);
glVertex3f(300.0, 100.0, 0.0); glVertex3f(300.0, 100.0, 0.0);
glTexCoord2f(1.0, 0.0); glTexCoord2f(1.0, 0.0);
glVertex3f(338.0, 100.0, 0.0); glVertex3f(310.0, 100.0, 0.0);
glTexCoord2f(1.0, 1.0); glTexCoord2f(1.0, 1.0);
glVertex3f(338.0, 140.0, 0.0); glVertex3f(310.0, 112.0, 0.0);
glTexCoord2f(0.0, 1.0); glTexCoord2f(0.0, 1.0);
glVertex3f(300.0, 140.0, 0.0); glVertex3f(300.0, 112.0, 0.0);
glEnd(); glEnd();
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);