|
From: | Z C |
Subject: | Re: [ft] How to generate a glyph bitmap of a specific pixel size using FT_Set_Pixel_Sizes |
Date: | Mon, 9 Jun 2014 19:57:20 +0800 |
> `face->glyph->bitmap' to access the bitmap, its dimension is 26*14.
> I called
>
> FT_Set_Pixel_Sizes(face, 40, 20);
>
> hoping to get a glyph of 20x40 dimension in pixels, but when I used
The documentation of FT_Set_Pixel_Sizes says
You should not rely on the resulting glyphs matching, or being
constrained, to this pixel size. Refer to FT_Request_Size to
understand how requested sizes relate to actual sizes.
and FT_Request_Size says
The relation between the requested size and the resulting glyph size
is dependent entirely on how the size is defined in the source face.
The font designer chooses the final size of each glyph relative to
this size. For more information refer to
`http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'
Assuming an arbitrary outline font there is only the trial and error
method to get a glyph bitmap with an exact bbox of 20x40 pixels,
playing around with `pixel_width' and `pixel_height' parameters of
`FT_Set_Pixel_Sizes'.
Werner
[Prev in Thread] | Current Thread | [Next in Thread] |