summaryrefslogtreecommitdiff
path: root/src/autofit/afcjk.h
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2013-08-25 19:47:26 +0200
committerWerner Lemberg <wl@gnu.org>2013-08-25 19:47:26 +0200
commitc1eb4459651daddef94027a50328daabc4d3c1c7 (patch)
tree525cff8a8c7910558a19388ab9791bc1e8942594 /src/autofit/afcjk.h
parent5c4a23a4e97f2deff9afc198f487d857eba7c299 (diff)
downloadfreetype2-c1eb4459651daddef94027a50328daabc4d3c1c7.tar.gz
[autofit] Make `cjk' module use blue stringsets.
* src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed. (af_cjk_hani_blue_chars): Removed. (AF_CJK_BLUE_TYPE_*): Removed. (af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with AF_BLUE_STRING_MAX_LEN. Change loops to use offsets (in file `afblue.h') into the new arrays `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c'). Instead of three dimensions (as used in the old blue string array) we now use properties to do the same, saving one loop nesting level. * src/autofit/afcjk.h: Remove old enumeration values superseded by the new data in `afblue.h'. (AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE, AF_CJK_IS_RIGHT_BLUE): New macros, to be used in `af_cjk_metrics_init_blues'. (AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value. (AF_CJK_BLUE_IS_TOP): Renamed to... (AF_CJK_BLUE_TOP): This. (AF_CJK_MAX_BLUES): Remove. (AF_CJKAxisRec): Updated.
Diffstat (limited to 'src/autofit/afcjk.h')
-rw-r--r--src/autofit/afcjk.h47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h
index 44f718b47..6f5bdc53d 100644
--- a/src/autofit/afcjk.h
+++ b/src/autofit/afcjk.h
@@ -36,35 +36,38 @@ FT_BEGIN_HEADER
AF_DECLARE_SCRIPT_CLASS( af_hani_script_class )
- /* CJK (global) metrics management */
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** C J K G L O B A L M E T R I C S *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
/*
* CJK glyphs tend to fill the square. So we have both vertical and
* horizontal blue zones. But some glyphs have flat bounding strokes that
* leave some space between neighbour glyphs.
*/
- enum
- {
- AF_CJK_BLUE_TOP,
- AF_CJK_BLUE_BOTTOM,
- AF_CJK_BLUE_LEFT,
- AF_CJK_BLUE_RIGHT,
-
- AF_CJK_BLUE_MAX
- };
+#define AF_CJK_IS_TOP_BLUE( b ) \
+ ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )
+#define AF_CJK_IS_HORIZ_BLUE( b ) \
+ ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )
+#define AF_CJK_IS_FILLED_BLUE( b ) \
+ ( (b)->properties & AF_BLUE_PROPERTY_CJK_FILL )
+#define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE
#define AF_CJK_MAX_WIDTHS 16
-#define AF_CJK_MAX_BLUES AF_CJK_BLUE_MAX
enum
{
- AF_CJK_BLUE_ACTIVE = 1 << 0,
- AF_CJK_BLUE_IS_TOP = 1 << 1,
- AF_CJK_BLUE_IS_RIGHT = 1 << 2,
- AF_CJK_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */
- /* optimization */
+ AF_CJK_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
+ AF_CJK_BLUE_TOP = 1 << 1, /* result of AF_CJK_IS_TOP_BLUE */
+ AF_CJK_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
+ /* optimization */
AF_CJK_BLUE_FLAG_MAX
};
@@ -83,16 +86,16 @@ FT_BEGIN_HEADER
FT_Fixed scale;
FT_Pos delta;
- FT_UInt width_count;
- AF_WidthRec widths[AF_CJK_MAX_WIDTHS];
- FT_Pos edge_distance_threshold;
- FT_Pos standard_width;
- FT_Bool extra_light;
+ FT_UInt width_count; /* number of used widths */
+ AF_WidthRec widths[AF_CJK_MAX_WIDTHS]; /* widths array */
+ FT_Pos edge_distance_threshold; /* used for creating edges */
+ FT_Pos standard_width; /* the default stem thickness */
+ FT_Bool extra_light; /* is standard width very light? */
/* used for horizontal metrics too for CJK */
FT_Bool control_overshoot;
FT_UInt blue_count;
- AF_CJKBlueRec blues[AF_CJK_BLUE_MAX];
+ AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX];
FT_Fixed org_scale;
FT_Pos org_delta;