On 22/11/2016 16:28, Werner LEMBERG wrote:
I assumed the pipe symbol was the tallest glyph in the font.
In many cases it is, but you have to check of course :-)
I guess the only way to determine the tallest or widest glyph (or
the FT_Size_RequestRec parameters) is, as you said, by trial and
error.
Well, the global bounding box that includes all glyphs is
`face->bbox'.
As shown below, I've now specified the FT_Size_RequestRec based on
1/64th of pixels, as follows and I'm now getting meaningful bitmap
dimensions, no larger than 32 by 32. I'm yet to look at the glyph
metrics though.
FT_Size_RequestRec req = { FT_SIZE_REQUEST_TYPE_BBOX , 0 , 32 * 64 , 0 ,
0 };
CHECK_STATUS( error , "Request size rec" )
FT_Request_Size( face , &req );
CHECK_STATUS( error , "Request size" )
for( BYTE i = 33; i < 127; ++i ) // Printable ASCII chars
{
error = FT_Load_Char( face, i , FT_LOAD_RENDER | FT_LOAD_MONOCHROME );
CHECK_STATUS( error , "Load char" )
slot = face->glyph;
std::cout << "[Char: " << char(i) << "] Num rows: " <<
slot->bitmap.rows << " Width: " << slot->bitmap.width << std::endl;
}
- Olumde
_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype