Don't do fractions if buffer is ASCII-only
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 5 Nov 2015 02:58:02 +0000 (18:58 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 5 Nov 2015 02:58:02 +0000 (18:58 -0800)
src/hb-buffer-private.hh
src/hb-ot-layout-private.hh
src/hb-ot-shape.cc

index 574fb36..8550517 100644 (file)
@@ -43,8 +43,9 @@ template <> class hb_mark_as_flags_t<hb_buffer_serialize_flags_t> {};
 
 enum hb_buffer_scratch_flags_t {
   HB_BUFFER_SCRATCH_FLAG_DEFAULT                       = 0x00000000u,
-  HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES                = 0x00000001u,
-  HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK            = 0x00000002u,
+  HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII                 = 0x00000001u,
+  HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES                = 0x00000002u,
+  HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK            = 0x00000004u,
 };
 template <> class hb_mark_as_flags_t<hb_buffer_scratch_flags_t> {};
 
index 60fca26..049b232 100644 (file)
@@ -249,6 +249,7 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
 
   if (u >= 0x80)
   {
+    buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII;
     if (unlikely (unicode->is_default_ignorable (u)))
     {
       buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
index 30563d0..be9c438 100644 (file)
@@ -346,7 +346,8 @@ hb_ot_mirror_chars (hb_ot_shape_context_t *c)
 static inline void
 hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c)
 {
-  if (!c->plan->has_frac)
+  if (!(c->buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII) ||
+      !c->plan->has_frac)
     return;
 
   hb_buffer_t *buffer = c->buffer;