< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex.hh

Print this page




   7  * license or royalty fees, to use, copy, modify, and distribute this
   8  * software and its documentation for any purpose, provided that the
   9  * above copyright notice and the following two paragraphs appear in
  10  * all copies of this software.
  11  *
  12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
  13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
  15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  16  * DAMAGE.
  17  *
  18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
  19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
  22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  23  *
  24  * Google Author(s): Behdad Esfahbod
  25  */
  26 
  27 #ifndef HB_OT_SHAPE_COMPLEX_PRIVATE_HH
  28 #define HB_OT_SHAPE_COMPLEX_PRIVATE_HH
  29 
  30 #include "hb-private.hh"
  31 
  32 #include "hb-ot-shape-private.hh"
  33 #include "hb-ot-shape-normalize-private.hh"
  34 



  35 
  36 
  37 /* buffer var allocations, used by complex shapers */
  38 #define complex_var_u8_0()      var2.u8[2]
  39 #define complex_var_u8_1()      var2.u8[3]
  40 
  41 
  42 #define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32
  43 
  44 enum hb_ot_shape_zero_width_marks_type_t {
  45   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
  46   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
  47   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE
  48 };
  49 
  50 
  51 /* Master OT shaper list */
  52 #define HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS \
  53   HB_COMPLEX_SHAPER_IMPLEMENT (default) /* should be first */ \
  54   HB_COMPLEX_SHAPER_IMPLEMENT (arabic) \
  55   HB_COMPLEX_SHAPER_IMPLEMENT (hangul) \
  56   HB_COMPLEX_SHAPER_IMPLEMENT (hebrew) \
  57   HB_COMPLEX_SHAPER_IMPLEMENT (indic) \
  58   HB_COMPLEX_SHAPER_IMPLEMENT (khmer) \
  59   HB_COMPLEX_SHAPER_IMPLEMENT (myanmar) \
  60   HB_COMPLEX_SHAPER_IMPLEMENT (myanmar_old) \
  61   HB_COMPLEX_SHAPER_IMPLEMENT (thai) \
  62   HB_COMPLEX_SHAPER_IMPLEMENT (tibetan) \
  63   HB_COMPLEX_SHAPER_IMPLEMENT (use) \
  64   /* ^--- Add new shapers here */
  65 
  66 
  67 struct hb_ot_complex_shaper_t
  68 {
  69   /* collect_features()
  70    * Called during shape_plan().
  71    * Shapers should use plan->map to add their features and callbacks.
  72    * May be nullptr.
  73    */
  74   void (*collect_features) (hb_ot_shape_planner_t *plan);
  75 
  76   /* override_features()
  77    * Called during shape_plan().
  78    * Shapers should use plan->map to override features and add callbacks after
  79    * common features are added.
  80    * May be nullptr.
  81    */
  82   void (*override_features) (hb_ot_shape_planner_t *plan);
  83 
  84 
  85   /* data_create()
  86    * Called at the end of shape_plan().
  87    * Whatever shapers return will be accessible through plan->data later.
  88    * If nullptr is returned, means a plan failure.
  89    */
  90   void *(*data_create) (const hb_ot_shape_plan_t *plan);
  91 
  92   /* data_destroy()
  93    * Called when the shape_plan is being destroyed.
  94    * plan->data is passed here for destruction.
  95    * If nullptr is returned, means a plan failure.
  96    * May be nullptr.
  97    */
  98   void (*data_destroy) (void *data);
  99 
 100 
 101   /* preprocess_text()
 102    * Called during shape().
 103    * Shapers can use to modify text before shaping starts.
 104    * May be nullptr.
 105    */
 106   void (*preprocess_text) (const hb_ot_shape_plan_t *plan,
 107                            hb_buffer_t              *buffer,
 108                            hb_font_t                *font);
 109 
 110   /* postprocess_glyphs()
 111    * Called during shape().
 112    * Shapers can use to modify glyphs after shaping ends.
 113    * May be nullptr.
 114    */
 115   void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
 116                               hb_buffer_t              *buffer,
 117                               hb_font_t                *font);
 118 
 119 
 120   hb_ot_shape_normalization_mode_t normalization_preference;
 121 
 122   /* decompose()
 123    * Called during shape()'s normalization.
 124    * May be nullptr.
 125    */
 126   bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
 127                      hb_codepoint_t  ab,
 128                      hb_codepoint_t *a,
 129                      hb_codepoint_t *b);
 130 
 131   /* compose()
 132    * Called during shape()'s normalization.
 133    * May be nullptr.
 134    */
 135   bool (*compose) (const hb_ot_shape_normalize_context_t *c,
 136                    hb_codepoint_t  a,
 137                    hb_codepoint_t  b,
 138                    hb_codepoint_t *ab);
 139 
 140   /* setup_masks()
 141    * Called during shape().
 142    * Shapers should use map to get feature masks and set on buffer.
 143    * Shapers may NOT modify characters.
 144    * May be nullptr.
 145    */
 146   void (*setup_masks) (const hb_ot_shape_plan_t *plan,
 147                        hb_buffer_t              *buffer,
 148                        hb_font_t                *font);
 149 
 150   /* disable_otl()
 151    * Called during shape().
 152    * If set and returns true, GDEF/GSUB/GPOS of the font are ignored
 153    * and fallback operations used.
 154    * May be nullptr.
 155    */
 156   bool (*disable_otl) (const hb_ot_shape_plan_t *plan);
 157 
 158   /* reorder_marks()
 159    * Called during shape().
 160    * Shapers can use to modify ordering of combining marks.
 161    * May be nullptr.
 162    */
 163   void (*reorder_marks) (const hb_ot_shape_plan_t *plan,
 164                          hb_buffer_t              *buffer,
 165                          unsigned int              start,
 166                          unsigned int              end);
 167 
 168   hb_ot_shape_zero_width_marks_type_t zero_width_marks;
 169 
 170   bool fallback_position;
 171 };
 172 
 173 #define HB_COMPLEX_SHAPER_IMPLEMENT(name) extern HB_INTERNAL const hb_ot_complex_shaper_t _hb_ot_complex_shaper_##name;
 174 HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS
 175 #undef HB_COMPLEX_SHAPER_IMPLEMENT
 176 
 177 
 178 static inline const hb_ot_complex_shaper_t *
 179 hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 180 {
 181   switch ((hb_tag_t) planner->props.script)


 217            planner->props.script == HB_SCRIPT_ARABIC) &&
 218           HB_DIRECTION_IS_HORIZONTAL(planner->props.direction))
 219         return &_hb_ot_complex_shaper_arabic;
 220       else
 221         return &_hb_ot_complex_shaper_default;
 222 
 223 
 224     /* Unicode-1.1 additions */
 225     case HB_SCRIPT_THAI:
 226     case HB_SCRIPT_LAO:
 227 
 228       return &_hb_ot_complex_shaper_thai;
 229 
 230 
 231     /* Unicode-1.1 additions */
 232     case HB_SCRIPT_HANGUL:
 233 
 234       return &_hb_ot_complex_shaper_hangul;
 235 
 236 
 237     /* Unicode-2.0 additions */
 238     case HB_SCRIPT_TIBETAN:
 239 
 240       return &_hb_ot_complex_shaper_tibetan;
 241 
 242 
 243     /* Unicode-1.1 additions */
 244     case HB_SCRIPT_HEBREW:
 245 
 246       return &_hb_ot_complex_shaper_hebrew;
 247 
 248 
 249     /* ^--- Add new shapers here */
 250 
 251 #if 0
 252     /* Unicode-4.1 additions */
 253     case HB_SCRIPT_NEW_TAI_LUE:
 254 #endif
 255 
 256     /* Unicode-1.1 additions */
 257     case HB_SCRIPT_BENGALI:
 258     case HB_SCRIPT_DEVANAGARI:
 259     case HB_SCRIPT_GUJARATI:
 260     case HB_SCRIPT_GURMUKHI:
 261     case HB_SCRIPT_KANNADA:
 262     case HB_SCRIPT_MALAYALAM:
 263     case HB_SCRIPT_ORIYA:
 264     case HB_SCRIPT_TAMIL:
 265     case HB_SCRIPT_TELUGU:
 266 
 267     /* Unicode-3.0 additions */
 268     case HB_SCRIPT_SINHALA:
 269 
 270       /* If the designer designed the font for the 'DFLT' script,
 271        * (or we ended up arbitrarily pick 'latn'), use the default shaper.
 272        * Otherwise, use the specific shaper.
 273        * Note that for some simple scripts, there may not be *any*
 274        * GSUB/GPOS needed, so there may be no scripts found! */
 275       if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
 276           planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
 277         return &_hb_ot_complex_shaper_default;


 278       else
 279         return &_hb_ot_complex_shaper_indic;
 280 
 281     case HB_SCRIPT_KHMER:
 282       /* A number of Khmer fonts in the wild don't have a 'pref' feature,
 283        * and as such won't shape properly via the Indic shaper;
 284        * however, they typically have 'liga' / 'clig' features that implement
 285        * the necessary "reordering" by means of ligature substitutions.
 286        * So we send such pref-less fonts through the generic shaper instead. */
 287       if (planner->map.found_script[0] &&
 288           hb_ot_layout_language_find_feature (planner->face, HB_OT_TAG_GSUB,
 289                                               planner->map.script_index[0],
 290                                               planner->map.language_index[0],
 291                                               HB_TAG ('p','r','e','f'),
 292                                               nullptr))
 293         return &_hb_ot_complex_shaper_khmer;
 294       else
 295         return &_hb_ot_complex_shaper_default;
 296 
 297     case HB_SCRIPT_MYANMAR:
 298       if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','2'))
 299         return &_hb_ot_complex_shaper_myanmar;
 300       else if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','r'))
 301         return &_hb_ot_complex_shaper_myanmar_old;
 302       else





 303         return &_hb_ot_complex_shaper_default;








 304 
 305 
 306     /* Unicode-2.0 additions */
 307     //case HB_SCRIPT_TIBETAN:
 308 
 309     /* Unicode-3.0 additions */
 310     //case HB_SCRIPT_MONGOLIAN:
 311     //case HB_SCRIPT_SINHALA:
 312 
 313     /* Unicode-3.2 additions */
 314     case HB_SCRIPT_BUHID:
 315     case HB_SCRIPT_HANUNOO:
 316     case HB_SCRIPT_TAGALOG:
 317     case HB_SCRIPT_TAGBANWA:
 318 
 319     /* Unicode-4.0 additions */
 320     case HB_SCRIPT_LIMBU:
 321     case HB_SCRIPT_TAI_LE:
 322 
 323     /* Unicode-4.1 additions */
 324     case HB_SCRIPT_BUGINESE:
 325     case HB_SCRIPT_KHAROSHTHI:
 326     case HB_SCRIPT_SYLOTI_NAGRI:
 327     case HB_SCRIPT_TIFINAGH:


 355     /* Unicode-6.1 additions */
 356     case HB_SCRIPT_CHAKMA:
 357     case HB_SCRIPT_SHARADA:
 358     case HB_SCRIPT_TAKRI:
 359 
 360     /* Unicode-7.0 additions */
 361     case HB_SCRIPT_DUPLOYAN:
 362     case HB_SCRIPT_GRANTHA:
 363     case HB_SCRIPT_KHOJKI:
 364     case HB_SCRIPT_KHUDAWADI:
 365     case HB_SCRIPT_MAHAJANI:
 366     //case HB_SCRIPT_MANICHAEAN:
 367     case HB_SCRIPT_MODI:
 368     case HB_SCRIPT_PAHAWH_HMONG:
 369     //case HB_SCRIPT_PSALTER_PAHLAVI:
 370     case HB_SCRIPT_SIDDHAM:
 371     case HB_SCRIPT_TIRHUTA:
 372 
 373     /* Unicode-8.0 additions */
 374     case HB_SCRIPT_AHOM:
 375     //case HB_SCRIPT_MULTANI:
 376 
 377     /* Unicode-9.0 additions */

 378     case HB_SCRIPT_BHAIKSUKI:
 379     case HB_SCRIPT_MARCHEN:
 380     case HB_SCRIPT_NEWA:
 381 
 382     /* Unicode-10.0 additions */
 383     case HB_SCRIPT_MASARAM_GONDI:
 384     case HB_SCRIPT_SOYOMBO:
 385     case HB_SCRIPT_ZANABAZAR_SQUARE:
 386 
 387     /* Unicode-11.0 additions */
 388     case HB_SCRIPT_DOGRA:
 389     case HB_SCRIPT_GUNJALA_GONDI:

 390     case HB_SCRIPT_MAKASAR:

 391 
 392       /* If the designer designed the font for the 'DFLT' script,
 393        * (or we ended up arbitrarily pick 'latn'), use the default shaper.
 394        * Otherwise, use the specific shaper.
 395        * Note that for some simple scripts, there may not be *any*
 396        * GSUB/GPOS needed, so there may be no scripts found! */
 397       if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
 398           planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
 399         return &_hb_ot_complex_shaper_default;
 400       else
 401         return &_hb_ot_complex_shaper_use;
 402   }
 403 }
 404 
 405 
 406 #endif /* HB_OT_SHAPE_COMPLEX_PRIVATE_HH */


   7  * license or royalty fees, to use, copy, modify, and distribute this
   8  * software and its documentation for any purpose, provided that the
   9  * above copyright notice and the following two paragraphs appear in
  10  * all copies of this software.
  11  *
  12  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
  13  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  14  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
  15  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  16  * DAMAGE.
  17  *
  18  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
  19  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  20  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  21  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
  22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  23  *
  24  * Google Author(s): Behdad Esfahbod
  25  */
  26 
  27 #ifndef HB_OT_SHAPE_COMPLEX_HH
  28 #define HB_OT_SHAPE_COMPLEX_HH
  29 
  30 #include "hb.hh"



  31 
  32 #include "hb-ot-layout.hh"
  33 #include "hb-ot-shape.hh"
  34 #include "hb-ot-shape-normalize.hh"
  35 
  36 
  37 /* buffer var allocations, used by complex shapers */
  38 #define complex_var_u8_0()      var2.u8[2]
  39 #define complex_var_u8_1()      var2.u8[3]
  40 
  41 
  42 #define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32
  43 
  44 enum hb_ot_shape_zero_width_marks_type_t {
  45   HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
  46   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
  47   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE
  48 };
  49 
  50 
  51 /* Master OT shaper list */
  52 #define HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS \
  53   HB_COMPLEX_SHAPER_IMPLEMENT (default) /* should be first */ \
  54   HB_COMPLEX_SHAPER_IMPLEMENT (arabic) \
  55   HB_COMPLEX_SHAPER_IMPLEMENT (hangul) \
  56   HB_COMPLEX_SHAPER_IMPLEMENT (hebrew) \
  57   HB_COMPLEX_SHAPER_IMPLEMENT (indic) \
  58   HB_COMPLEX_SHAPER_IMPLEMENT (khmer) \
  59   HB_COMPLEX_SHAPER_IMPLEMENT (myanmar) \
  60   HB_COMPLEX_SHAPER_IMPLEMENT (myanmar_zawgyi) \
  61   HB_COMPLEX_SHAPER_IMPLEMENT (thai) \

  62   HB_COMPLEX_SHAPER_IMPLEMENT (use) \
  63   /* ^--- Add new shapers here */
  64 
  65 
  66 struct hb_ot_complex_shaper_t
  67 {
  68   /* collect_features()
  69    * Called during shape_plan().
  70    * Shapers should use plan->map to add their features and callbacks.
  71    * May be NULL.
  72    */
  73   void (*collect_features) (hb_ot_shape_planner_t *plan);
  74 
  75   /* override_features()
  76    * Called during shape_plan().
  77    * Shapers should use plan->map to override features and add callbacks after
  78    * common features are added.
  79    * May be NULL.
  80    */
  81   void (*override_features) (hb_ot_shape_planner_t *plan);
  82 
  83 
  84   /* data_create()
  85    * Called at the end of shape_plan().
  86    * Whatever shapers return will be accessible through plan->data later.
  87    * If nullptr is returned, means a plan failure.
  88    */
  89   void *(*data_create) (const hb_ot_shape_plan_t *plan);
  90 
  91   /* data_destroy()
  92    * Called when the shape_plan is being destroyed.
  93    * plan->data is passed here for destruction.
  94    * If nullptr is returned, means a plan failure.
  95    * May be NULL.
  96    */
  97   void (*data_destroy) (void *data);
  98 
  99 
 100   /* preprocess_text()
 101    * Called during shape().
 102    * Shapers can use to modify text before shaping starts.
 103    * May be NULL.
 104    */
 105   void (*preprocess_text) (const hb_ot_shape_plan_t *plan,
 106                            hb_buffer_t              *buffer,
 107                            hb_font_t                *font);
 108 
 109   /* postprocess_glyphs()
 110    * Called during shape().
 111    * Shapers can use to modify glyphs after shaping ends.
 112    * May be NULL.
 113    */
 114   void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
 115                               hb_buffer_t              *buffer,
 116                               hb_font_t                *font);
 117 
 118 
 119   hb_ot_shape_normalization_mode_t normalization_preference;
 120 
 121   /* decompose()
 122    * Called during shape()'s normalization.
 123    * May be NULL.
 124    */
 125   bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
 126                      hb_codepoint_t  ab,
 127                      hb_codepoint_t *a,
 128                      hb_codepoint_t *b);
 129 
 130   /* compose()
 131    * Called during shape()'s normalization.
 132    * May be NULL.
 133    */
 134   bool (*compose) (const hb_ot_shape_normalize_context_t *c,
 135                    hb_codepoint_t  a,
 136                    hb_codepoint_t  b,
 137                    hb_codepoint_t *ab);
 138 
 139   /* setup_masks()
 140    * Called during shape().
 141    * Shapers should use map to get feature masks and set on buffer.
 142    * Shapers may NOT modify characters.
 143    * May be NULL.
 144    */
 145   void (*setup_masks) (const hb_ot_shape_plan_t *plan,
 146                        hb_buffer_t              *buffer,
 147                        hb_font_t                *font);
 148 
 149   /* gpos_tag()
 150    * If not HB_TAG_NONE, then must match found GPOS script tag for
 151    * GPOS to be applied.  Otherwise, fallback positioning will be used.


 152    */
 153   hb_tag_t gpos_tag;
 154 
 155   /* reorder_marks()
 156    * Called during shape().
 157    * Shapers can use to modify ordering of combining marks.
 158    * May be NULL.
 159    */
 160   void (*reorder_marks) (const hb_ot_shape_plan_t *plan,
 161                          hb_buffer_t              *buffer,
 162                          unsigned int              start,
 163                          unsigned int              end);
 164 
 165   hb_ot_shape_zero_width_marks_type_t zero_width_marks;
 166 
 167   bool fallback_position;
 168 };
 169 
 170 #define HB_COMPLEX_SHAPER_IMPLEMENT(name) extern HB_INTERNAL const hb_ot_complex_shaper_t _hb_ot_complex_shaper_##name;
 171 HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS
 172 #undef HB_COMPLEX_SHAPER_IMPLEMENT
 173 
 174 
 175 static inline const hb_ot_complex_shaper_t *
 176 hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 177 {
 178   switch ((hb_tag_t) planner->props.script)


 214            planner->props.script == HB_SCRIPT_ARABIC) &&
 215           HB_DIRECTION_IS_HORIZONTAL(planner->props.direction))
 216         return &_hb_ot_complex_shaper_arabic;
 217       else
 218         return &_hb_ot_complex_shaper_default;
 219 
 220 
 221     /* Unicode-1.1 additions */
 222     case HB_SCRIPT_THAI:
 223     case HB_SCRIPT_LAO:
 224 
 225       return &_hb_ot_complex_shaper_thai;
 226 
 227 
 228     /* Unicode-1.1 additions */
 229     case HB_SCRIPT_HANGUL:
 230 
 231       return &_hb_ot_complex_shaper_hangul;
 232 
 233 






 234     /* Unicode-1.1 additions */
 235     case HB_SCRIPT_HEBREW:
 236 
 237       return &_hb_ot_complex_shaper_hebrew;
 238 
 239 







 240     /* Unicode-1.1 additions */
 241     case HB_SCRIPT_BENGALI:
 242     case HB_SCRIPT_DEVANAGARI:
 243     case HB_SCRIPT_GUJARATI:
 244     case HB_SCRIPT_GURMUKHI:
 245     case HB_SCRIPT_KANNADA:
 246     case HB_SCRIPT_MALAYALAM:
 247     case HB_SCRIPT_ORIYA:
 248     case HB_SCRIPT_TAMIL:
 249     case HB_SCRIPT_TELUGU:
 250 
 251     /* Unicode-3.0 additions */
 252     case HB_SCRIPT_SINHALA:
 253 
 254       /* If the designer designed the font for the 'DFLT' script,
 255        * (or we ended up arbitrarily pick 'latn'), use the default shaper.
 256        * Otherwise, use the specific shaper.
 257        *
 258        * If it's indy3 tag, send to USE. */
 259       if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
 260           planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
 261         return &_hb_ot_complex_shaper_default;
 262       else if ((planner->map.chosen_script[0] & 0x000000FF) == '3')
 263         return &_hb_ot_complex_shaper_use;
 264       else
 265         return &_hb_ot_complex_shaper_indic;
 266 
 267     case HB_SCRIPT_KHMER:











 268         return &_hb_ot_complex_shaper_khmer;


 269 
 270     case HB_SCRIPT_MYANMAR:
 271       /* If the designer designed the font for the 'DFLT' script,
 272        * (or we ended up arbitrarily pick 'latn'), use the default shaper.
 273        * Otherwise, use the specific shaper.
 274        *
 275        * If designer designed for 'mymr' tag, also send to default
 276        * shaper.  That's tag used from before Myanmar shaping spec
 277        * was developed.  The shaping spec uses 'mym2' tag. */
 278       if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
 279           planner->map.chosen_script[0] == HB_TAG ('l','a','t','n') ||
 280           planner->map.chosen_script[0] == HB_TAG ('m','y','m','r'))
 281         return &_hb_ot_complex_shaper_default;
 282       else
 283         return &_hb_ot_complex_shaper_myanmar;
 284 
 285 
 286     /* https://github.com/harfbuzz/harfbuzz/issues/1162 */
 287     case HB_SCRIPT_MYANMAR_ZAWGYI:
 288 
 289       return &_hb_ot_complex_shaper_myanmar_zawgyi;
 290 
 291 
 292     /* Unicode-2.0 additions */
 293     case HB_SCRIPT_TIBETAN:
 294 
 295     /* Unicode-3.0 additions */
 296     //case HB_SCRIPT_MONGOLIAN:
 297     //case HB_SCRIPT_SINHALA:
 298 
 299     /* Unicode-3.2 additions */
 300     case HB_SCRIPT_BUHID:
 301     case HB_SCRIPT_HANUNOO:
 302     case HB_SCRIPT_TAGALOG:
 303     case HB_SCRIPT_TAGBANWA:
 304 
 305     /* Unicode-4.0 additions */
 306     case HB_SCRIPT_LIMBU:
 307     case HB_SCRIPT_TAI_LE:
 308 
 309     /* Unicode-4.1 additions */
 310     case HB_SCRIPT_BUGINESE:
 311     case HB_SCRIPT_KHAROSHTHI:
 312     case HB_SCRIPT_SYLOTI_NAGRI:
 313     case HB_SCRIPT_TIFINAGH:


 341     /* Unicode-6.1 additions */
 342     case HB_SCRIPT_CHAKMA:
 343     case HB_SCRIPT_SHARADA:
 344     case HB_SCRIPT_TAKRI:
 345 
 346     /* Unicode-7.0 additions */
 347     case HB_SCRIPT_DUPLOYAN:
 348     case HB_SCRIPT_GRANTHA:
 349     case HB_SCRIPT_KHOJKI:
 350     case HB_SCRIPT_KHUDAWADI:
 351     case HB_SCRIPT_MAHAJANI:
 352     //case HB_SCRIPT_MANICHAEAN:
 353     case HB_SCRIPT_MODI:
 354     case HB_SCRIPT_PAHAWH_HMONG:
 355     //case HB_SCRIPT_PSALTER_PAHLAVI:
 356     case HB_SCRIPT_SIDDHAM:
 357     case HB_SCRIPT_TIRHUTA:
 358 
 359     /* Unicode-8.0 additions */
 360     case HB_SCRIPT_AHOM:

 361 
 362     /* Unicode-9.0 additions */
 363     //case HB_SCRIPT_ADLAM:
 364     case HB_SCRIPT_BHAIKSUKI:
 365     case HB_SCRIPT_MARCHEN:
 366     case HB_SCRIPT_NEWA:
 367 
 368     /* Unicode-10.0 additions */
 369     case HB_SCRIPT_MASARAM_GONDI:
 370     case HB_SCRIPT_SOYOMBO:
 371     case HB_SCRIPT_ZANABAZAR_SQUARE:
 372 
 373     /* Unicode-11.0 additions */
 374     case HB_SCRIPT_DOGRA:
 375     case HB_SCRIPT_GUNJALA_GONDI:
 376     //case HB_SCRIPT_HANIFI_ROHINGYA:
 377     case HB_SCRIPT_MAKASAR:
 378     //case HB_SCRIPT_SOGDIAN:
 379 
 380       /* If the designer designed the font for the 'DFLT' script,
 381        * (or we ended up arbitrarily pick 'latn'), use the default shaper.
 382        * Otherwise, use the specific shaper.
 383        * Note that for some simple scripts, there may not be *any*
 384        * GSUB/GPOS needed, so there may be no scripts found! */
 385       if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') ||
 386           planner->map.chosen_script[0] == HB_TAG ('l','a','t','n'))
 387         return &_hb_ot_complex_shaper_default;
 388       else
 389         return &_hb_ot_complex_shaper_use;
 390   }
 391 }
 392 
 393 
 394 #endif /* HB_OT_SHAPE_COMPLEX_HH */
< prev index next >