Content-type: text/html
Returns a glyph's `control box'. The control box encloses all the outline's points, including Bezier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline which contains Bezier outside arcs). Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the `ftbbox' component which is dedicated to this single task.
Input:
glyph :: A handle to the source glyph object.
mode :: The mode which indicates how to interpret the returned bounding box values.
Output:
acbox :: The glyph coordinate bounding box. Coordinates are expressed in 1/64th of pixels if it is grid-fitted.
Notes: 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'. enum { ft_glyph_bbox_unscaled = 0, return unscaled font units ft_glyph_bbox_subpixels = 0, return unfitted 26.6 coordinates ft_glyph_bbox_gridfit = 1, return grid-fitted 26.6 coordinates ft_glyph_bbox_truncate = 2, return coordinates in integer pixels ft_glyph_bbox_pixels = 3 return grid-fitted pixel coordinates }; FT_EXPORT( void ) FT_Glyph_Get_CBox( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox );
This documentation was generated for Freetype 2.0.4 by autodocbook (http://www.stillhq.com). Autodocbook is (c) Michael Still 2001.
Copyright 1996-2000 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, and distributed under the terms of the FreeType project license, LICENSE.TXT. By continuing to use, modify, or distribute this file you indicate that you have read the license and understand and accept it fully.
Please report errors in this documentation, and Freetype itself to freetype@freetype.org