src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh
changeset 48274 51772bf1fb0c
parent 47216 71c04702a3d5
child 50352 25db2c8f3cf8
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Tue Dec 05 11:04:42 2017 -0800
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh	Thu Dec 07 11:55:06 2017 -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;