ref: a7096374eeb138d78b86c07a652e0a098ae17775
parent: 3d568ac772be8445846dcce73e90242d774f5270
author: Werner Lemberg <[email protected]>
date: Wed Oct 11 19:31:12 EDT 2000
Added new `ft_glyph_bbox_unscaled' enum; fixing documentation of FT_Glyph_Get_CBox(). ftnames.c has been omitted from the Makefile.
--- a/include/freetype/ftglyph.h
+++ b/include/freetype/ftglyph.h
@@ -218,8 +218,9 @@
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 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 */
};
@@ -236,8 +237,8 @@
/* <Input> */
/* glyph :: A handle to the source glyph object. */
/* */
- /* mode :: A set of bit flags that indicate how to interpret the */
- /* returned bounding box values. */
+ /* mode :: The mode which indicates how to interpret the returned */
+ /* bounding box values. */
/* */
/* <Output> */
/* box :: The glyph bounding box. Coordinates are expressed in */
@@ -247,9 +248,12 @@
/* Coordinates are relative to the glyph origin, using the Y-upwards */
/* convention. */
/* */
- /* If `ft_glyph_bbox_subpixels' is set in `mode', the bbox */
+ /* 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). */
- /* Otherwise, coordinates are expressed in integer 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 */
@@ -258,9 +262,9 @@
/* width = bbox.xMax - bbox.xMin; */
/* height = bbox.yMax - bbox.yMin; */
/* */
- /* Note also that for 26.6 coordinates, if the */
- /* `ft_glyph_bbox_gridfit' flag is set in `mode;, the coordinates */
- /* will also be grid-fitted, which corresponds to: */
+ /* 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); */
@@ -267,7 +271,13 @@
/* bbox.xMax = CEILING(bbox.xMax); */
/* bbox.yMax = CEILING(bbox.yMax); */
/* */
- /* The default value (0) for `bbox_mode' is `ft_glyph_bbox_pixels'. */
+ /* 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'. */
/* */
FT_EXPORT_DEF( void ) FT_Glyph_Get_CBox( FT_Glyph glyph,
FT_UInt bbox_mode,
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -602,8 +602,8 @@
/* <Input> */
/* glyph :: A handle to the source glyph object. */
/* */
- /* mode :: A set of bit flags that indicate how to interpret the */
- /* returned bounding box values. */
+ /* mode :: The mode which indicates how to interpret the returned */
+ /* bounding box values. */
/* */
/* <Output> */
/* box :: The glyph bounding box. Coordinates are expressed in */
@@ -613,9 +613,12 @@
/* Coordinates are relative to the glyph origin, using the Y-upwards */
/* convention. */
/* */
- /* If `ft_glyph_bbox_subpixels' is set in `mode', the bbox */
+ /* 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). */
- /* Otherwise, coordinates are expressed in integer 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 */
@@ -624,9 +627,9 @@
/* width = bbox.xMax - bbox.xMin; */
/* height = bbox.yMax - bbox.yMin; */
/* */
- /* Note also that for 26.6 coordinates, if the */
- /* `ft_glyph_bbox_gridfit' flag is set in `mode;, the coordinates */
- /* will also be grid-fitted, which corresponds to: */
+ /* 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); */
@@ -633,7 +636,13 @@
/* bbox.xMax = CEILING(bbox.xMax); */
/* bbox.yMax = CEILING(bbox.yMax); */
/* */
- /* The default value (0) for `bbox_mode' is `ft_glyph_bbox_pixels'. */
+ /* 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'. */
/* */
FT_EXPORT_FUNC( void ) FT_Glyph_Get_CBox( FT_Glyph glyph,
FT_UInt bbox_mode,
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -45,7 +45,8 @@
# object. It will then be linked to the final executable only if one of its
# symbols is used by the application.
#
-BASE_EXT_SRC := $(BASE_)ftglyph.c \
+BASE_EXT_SRC := $(BASE_)ftglyph.c \
+ $(BASE_)ftnames.c \
$(BASE_)ftmm.c
# Default extensions objects