jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hebrew.cc
changeset 43232 8e39ad39979f
parent 40435 553eb1a50733
equal deleted inserted replaced
43231:4885b2a3898b 43232:8e39ad39979f
   152   }
   152   }
   153 
   153 
   154   return found;
   154   return found;
   155 }
   155 }
   156 
   156 
       
   157 static bool
       
   158 disable_otl_hebrew (const hb_ot_shape_plan_t *plan)
       
   159 {
       
   160   /* For Hebrew shaper, use fallback if GPOS does not have 'hebr'
       
   161    * script.  This matches Uniscribe better, and makes fonts like
       
   162    * Arial that have GSUB/GPOS/GDEF but no data for Hebrew work.
       
   163    * See:
       
   164    * https://github.com/behdad/harfbuzz/issues/347#issuecomment-267838368
       
   165    */
       
   166   return plan->map.chosen_script[1] != HB_TAG ('h','e','b','r');
       
   167 }
       
   168 
   157 
   169 
   158 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
   170 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
   159 {
   171 {
   160   "hebrew",
   172   "hebrew",
   161   NULL, /* collect_features */
   173   NULL, /* collect_features */
   166   NULL, /* postprocess_glyphs */
   178   NULL, /* postprocess_glyphs */
   167   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
   179   HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
   168   NULL, /* decompose */
   180   NULL, /* decompose */
   169   compose_hebrew,
   181   compose_hebrew,
   170   NULL, /* setup_masks */
   182   NULL, /* setup_masks */
       
   183   disable_otl_hebrew,
   171   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   184   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   172   true, /* fallback_position */
   185   true, /* fallback_position */
   173 };
   186 };