On 28.11.2016 16:09, Olumide wrote:
> Dear List,
>
> I've written a bit of code to rasterizing fonts at any arbitrary size as
> follows:
>
> #define FONT_HEIGHT 18
>
> FT_Size_RequestRec req = { FT_SIZE_REQUEST_TYPE_BBOX , 0 , FONT_HEIGHT *
> 64 , 0 , 0 };
> CHECK_STATUS( error , "Request size rec" )
>
> FT_Request_Size( face , &req );
> CHECK_STATUS( error , "Request size" )
>
> Oddly, face->ascender always has the same height. Why is this the case?
Because it's not scaled. It's a font global design metric that for SFNT
fonts unfortunately exists in 3 different places: hhea table, and two
times in OS/2 table of appropriate version. Freetype tries to return
reasonable value from all three of those.
> I need the ascender in order to locate my rasterized font in the
> requested box (of max size FONT_HEIGHT).
Note that rendered bitmap does not necessary fit into a box of
FONT_HEIGHT height. Ascender/descender fields are used for layout
estimation and scaling on Windows.
>
> Regards,
>
> - Olumide
>
>
> _______________________________________________
> Freetype mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/freetype
_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype