1 /***************************************************************************/
5 /* Auto-fitter hinting routines for CJK script (specification). */
7 /* Copyright 2006, 2007, 2011, 2012 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
29 /* the CJK-specific script class */
31 AF_DECLARE_SCRIPT_CLASS( af_cjk_script_class )
33 /* CJK (global) metrics management */
36 * CJK glyphs tend to fill the square. So we have both vertical and
37 * horizontal blue zones. But some glyphs have flat bounding strokes that
38 * leave some space between neighbour glyphs.
51 #define AF_CJK_MAX_WIDTHS 16
52 #define AF_CJK_MAX_BLUES AF_CJK_BLUE_MAX
57 AF_CJK_BLUE_ACTIVE = 1 << 0,
58 AF_CJK_BLUE_IS_TOP = 1 << 1,
59 AF_CJK_BLUE_IS_RIGHT = 1 << 2,
60 AF_CJK_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */
66 typedef struct AF_CJKBlueRec_
69 AF_WidthRec shoot; /* undershoot */
72 } AF_CJKBlueRec, *AF_CJKBlue;
75 typedef struct AF_CJKAxisRec_
81 AF_WidthRec widths[AF_CJK_MAX_WIDTHS];
82 FT_Pos edge_distance_threshold;
83 FT_Pos standard_width;
86 /* used for horizontal metrics too for CJK */
87 FT_Bool control_overshoot;
89 AF_CJKBlueRec blues[AF_CJK_BLUE_MAX];
94 } AF_CJKAxisRec, *AF_CJKAxis;
97 typedef struct AF_CJKMetricsRec_
99 AF_ScriptMetricsRec root;
100 FT_UInt units_per_em;
101 AF_CJKAxisRec axis[AF_DIMENSION_MAX];
103 } AF_CJKMetricsRec, *AF_CJKMetrics;
106 #ifdef AF_CONFIG_OPTION_CJK
108 af_cjk_metrics_init( AF_CJKMetrics metrics,
112 af_cjk_metrics_scale( AF_CJKMetrics metrics,
116 af_cjk_hints_init( AF_GlyphHints hints,
117 AF_CJKMetrics metrics );
120 af_cjk_hints_apply( AF_GlyphHints hints,
122 AF_CJKMetrics metrics );
124 /* shared; called from afindic.c */
126 af_cjk_metrics_check_digits( AF_CJKMetrics metrics,
130 af_cjk_metrics_init_widths( AF_CJKMetrics metrics,
132 #endif /* AF_CONFIG_OPTION_CJK */
139 #endif /* __AFCJK_H__ */