1 /***************************************************************************/
5 /* Auto-fitter hinting routines for Indic writing system (body). */
7 /* Copyright 2007-2016 by */
8 /* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
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 /***************************************************************************/
23 #ifdef AF_CONFIG_OPTION_INDIC
30 #ifdef AF_CONFIG_OPTION_USE_WARPER
36 af_indic_metrics_init( AF_CJKMetrics metrics
,
39 /* skip blue zone init in CJK routines */
40 FT_CharMap oldmap
= face
->charmap
;
43 metrics
->units_per_em
= face
->units_per_EM
;
45 if ( FT_Select_Charmap( face
, FT_ENCODING_UNICODE
) )
49 af_cjk_metrics_init_widths( metrics
, face
);
51 /* either need indic specific blue_chars[] or just skip blue zones */
52 af_cjk_metrics_init_blues( metrics
, face
, af_cjk_blue_chars
);
54 af_cjk_metrics_check_digits( metrics
, face
);
57 FT_Set_Charmap( face
, oldmap
);
64 af_indic_metrics_scale( AF_CJKMetrics metrics
,
67 /* use CJK routines */
68 af_cjk_metrics_scale( metrics
, scaler
);
73 af_indic_hints_init( AF_GlyphHints hints
,
74 AF_CJKMetrics metrics
)
76 /* use CJK routines */
77 return af_cjk_hints_init( hints
, metrics
);
82 af_indic_hints_apply( FT_UInt glyph_index
,
85 AF_CJKMetrics metrics
)
87 /* use CJK routines */
88 return af_cjk_hints_apply( glyph_index
, hints
, outline
, metrics
);
92 /* Extract standard_width from writing system/script specific */
96 af_indic_get_standard_widths( AF_CJKMetrics metrics
,
101 *stdHW
= metrics
->axis
[AF_DIMENSION_VERT
].standard_width
;
104 *stdVW
= metrics
->axis
[AF_DIMENSION_HORZ
].standard_width
;
108 /*************************************************************************/
109 /*************************************************************************/
111 /***** I N D I C S C R I P T C L A S S *****/
113 /*************************************************************************/
114 /*************************************************************************/
117 AF_DEFINE_WRITING_SYSTEM_CLASS(
118 af_indic_writing_system_class
,
120 AF_WRITING_SYSTEM_INDIC
,
122 sizeof ( AF_CJKMetricsRec
),
124 (AF_WritingSystem_InitMetricsFunc
) af_indic_metrics_init
, /* style_metrics_init */
125 (AF_WritingSystem_ScaleMetricsFunc
)af_indic_metrics_scale
, /* style_metrics_scale */
126 (AF_WritingSystem_DoneMetricsFunc
) NULL
, /* style_metrics_done */
127 (AF_WritingSystem_GetStdWidthsFunc
)af_indic_get_standard_widths
, /* style_metrics_getstdw */
129 (AF_WritingSystem_InitHintsFunc
) af_indic_hints_init
, /* style_hints_init */
130 (AF_WritingSystem_ApplyHintsFunc
) af_indic_hints_apply
/* style_hints_apply */
134 #else /* !AF_CONFIG_OPTION_INDIC */
137 AF_DEFINE_WRITING_SYSTEM_CLASS(
138 af_indic_writing_system_class
,
140 AF_WRITING_SYSTEM_INDIC
,
142 sizeof ( AF_CJKMetricsRec
),
144 (AF_WritingSystem_InitMetricsFunc
) NULL
, /* style_metrics_init */
145 (AF_WritingSystem_ScaleMetricsFunc
)NULL
, /* style_metrics_scale */
146 (AF_WritingSystem_DoneMetricsFunc
) NULL
, /* style_metrics_done */
147 (AF_WritingSystem_GetStdWidthsFunc
)NULL
, /* style_metrics_getstdw */
149 (AF_WritingSystem_InitHintsFunc
) NULL
, /* style_hints_init */
150 (AF_WritingSystem_ApplyHintsFunc
) NULL
/* style_hints_apply */
154 #endif /* !AF_CONFIG_OPTION_INDIC */