Coordinates are relative to the glyph origin,
using the Y-upwards convention.
If the glyph has been loaded with
FT_LOAD_NO_SCALE, `bbox_mode' must be set to
`ft_glyph_bbox_unscaled' to get unscaled font
units.
If `bbox_mode' is set to
`ft_glyph_bbox_subpixels' the bbox coordinates
are returned in 26.6 pixels (i.e. 1/64th of
pixels).
Note that the maximum coordinates are exclusive,
which means that one can compute the width and
height of the glyph image (be it in integer or
26.6 pixels) as:
width = bbox.xMax - bbox.xMin; height = bbox.yMax
- bbox.yMin;
Note also that for 26.6 coordinates, if
`bbox_mode' is set to `ft_glyph_bbox_gridfit',
the coordinates will also be grid-fitted, which
corresponds to:
bbox.xMin = FLOOR(bbox.xMin); bbox.yMin =
FLOOR(bbox.yMin); bbox.xMax = CEILING(bbox.xMax);
bbox.yMax = CEILING(bbox.yMax);
To get the bbox in pixel coordinates, set
`bbox_mode' to `ft_glyph_bbox_truncate'.
To get the bbox in grid-fitted pixel coordinates,
set `bbox_mode' to `ft_glyph_bbox_pixels'.
The default value for `bbox_mode' is
`ft_glyph_bbox_pixels'.
|