--- old/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh 2017-11-30 10:47:05.925458272 -0800 +++ new/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh 2017-11-30 10:47:05.749458277 -0800 @@ -39,6 +39,8 @@ #define complex_var_u8_1() var2.u8[3] +#define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32 + enum hb_ot_shape_zero_width_marks_type_t { HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY, @@ -63,12 +65,10 @@ struct hb_ot_complex_shaper_t { - char name[8]; - /* collect_features() * Called during shape_plan(). * Shapers should use plan->map to add their features and callbacks. - * May be NULL. + * May be nullptr. */ void (*collect_features) (hb_ot_shape_planner_t *plan); @@ -76,7 +76,7 @@ * Called during shape_plan(). * Shapers should use plan->map to override features and add callbacks after * common features are added. - * May be NULL. + * May be nullptr. */ void (*override_features) (hb_ot_shape_planner_t *plan); @@ -84,15 +84,15 @@ /* data_create() * Called at the end of shape_plan(). * Whatever shapers return will be accessible through plan->data later. - * If NULL is returned, means a plan failure. + * If nullptr is returned, means a plan failure. */ void *(*data_create) (const hb_ot_shape_plan_t *plan); /* data_destroy() * Called when the shape_plan is being destroyed. * plan->data is passed here for destruction. - * If NULL is returned, means a plan failure. - * May be NULL. + * If nullptr is returned, means a plan failure. + * May be nullptr. */ void (*data_destroy) (void *data); @@ -100,7 +100,7 @@ /* preprocess_text() * Called during shape(). * Shapers can use to modify text before shaping starts. - * May be NULL. + * May be nullptr. */ void (*preprocess_text) (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, @@ -109,7 +109,7 @@ /* postprocess_glyphs() * Called during shape(). * Shapers can use to modify glyphs after shaping ends. - * May be NULL. + * May be nullptr. */ void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, @@ -120,7 +120,7 @@ /* decompose() * Called during shape()'s normalization. - * May be NULL. + * May be nullptr. */ bool (*decompose) (const hb_ot_shape_normalize_context_t *c, hb_codepoint_t ab, @@ -129,7 +129,7 @@ /* compose() * Called during shape()'s normalization. - * May be NULL. + * May be nullptr. */ bool (*compose) (const hb_ot_shape_normalize_context_t *c, hb_codepoint_t a, @@ -140,7 +140,7 @@ * Called during shape(). * Shapers should use map to get feature masks and set on buffer. * Shapers may NOT modify characters. - * May be NULL. + * May be nullptr. */ void (*setup_masks) (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, @@ -150,10 +150,20 @@ * Called during shape(). * If set and returns true, GDEF/GSUB/GPOS of the font are ignored * and fallback operations used. - * May be NULL. + * May be nullptr. */ bool (*disable_otl) (const hb_ot_shape_plan_t *plan); + /* reorder_marks() + * Called during shape(). + * Shapers can use to modify ordering of combining marks. + * May be nullptr. + */ + void (*reorder_marks) (const hb_ot_shape_plan_t *plan, + hb_buffer_t *buffer, + unsigned int start, + unsigned int end); + hb_ot_shape_zero_width_marks_type_t zero_width_marks; bool fallback_position; @@ -191,6 +201,9 @@ case HB_SCRIPT_MANICHAEAN: case HB_SCRIPT_PSALTER_PAHLAVI: + /* Unicode-9.0 additions */ + case HB_SCRIPT_ADLAM: + /* For Arabic script, use the Arabic shaper even if no OT script tag was found. * This is because we do fallback shaping for Arabic script (and not others). * But note that Arabic shaping is applicable only to horizontal layout; for @@ -250,10 +263,12 @@ case HB_SCRIPT_SINHALA: /* If the designer designed the font for the 'DFLT' script, - * use the default shaper. Otherwise, use the specific shaper. + * (or we ended up arbitrarily pick 'latn'), use the default shaper. + * Otherwise, use the specific shaper. * Note that for some simple scripts, there may not be *any* * GSUB/GPOS needed, so there may be no scripts found! */ - if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T')) + if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || + planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) return &_hb_ot_complex_shaper_default; else return &_hb_ot_complex_shaper_indic; @@ -269,7 +284,7 @@ planner->map.script_index[0], planner->map.language_index[0], HB_TAG ('p','r','e','f'), - NULL)) + nullptr)) return &_hb_ot_complex_shaper_indic; else return &_hb_ot_complex_shaper_default; @@ -359,11 +374,18 @@ case HB_SCRIPT_MARCHEN: case HB_SCRIPT_NEWA: + /* Unicode-10.0 additions */ + case HB_SCRIPT_MASARAM_GONDI: + case HB_SCRIPT_SOYOMBO: + case HB_SCRIPT_ZANABAZAR_SQUARE: + /* If the designer designed the font for the 'DFLT' script, - * use the default shaper. Otherwise, use the specific shaper. + * (or we ended up arbitrarily pick 'latn'), use the default shaper. + * Otherwise, use the specific shaper. * Note that for some simple scripts, there may not be *any* * GSUB/GPOS needed, so there may be no scripts found! */ - if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T')) + if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || + planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) return &_hb_ot_complex_shaper_default; else return &_hb_ot_complex_shaper_use;