Hi everyone,
I have been struggling with this issue for the past two days. I cannot render all my letters on the base line.
I have used this function to set my font size
unsigned int charPixelSize = 50;
FT_Set_Pixel_Sizes(face, 0, charPixelSize);
and when it's time to render a character I do this
y = face->glyph->bitmap.rows - face->glyph->bitmap_top;
But the line of code above will produce the image above.
The only way I could get all my characters to render properly is by doing this
y = (50 / 1.33333) - face->glyph->bitmap_top;
in theory 50 should be my font size in pixels. But it seems that it is in points?? I don't know.
If I divide 50 by 1.3333 this woks somewhat. The reason I'm diving by 1.33333 is because each point has 1.33333 pixels.
I feel this whole division thing is a hacky way of getting this to work. Because 50 should be the font size in pixels not points.
I don't know. I'm just lost.
Any help would be appreciated.
Cheers.
↧