From 239119a631fee7701be4d444adeda808b915863a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 13 Aug 2017 15:08:34 -0700 Subject: [PATCH] [unsafe-to-break] Mark all positions as unsafe in alternative shapers --- src/hb-coretext.cc | 6 ++++++ src/hb-directwrite.cc | 2 ++ src/hb-graphite2.cc | 1 + src/hb-uniscribe.cc | 2 ++ 4 files changed, 11 insertions(+) diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index e237335e..ba96d399 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -1180,6 +1180,9 @@ resize_and_retry: pos->x_advance = info->mask; pos->x_offset = info->var1.i32; pos->y_offset = info->var2.i32; + + info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; + info++, pos++; } else @@ -1188,6 +1191,9 @@ resize_and_retry: pos->y_advance = info->mask; pos->x_offset = info->var1.i32; pos->y_offset = info->var2.i32; + + info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; + info++, pos++; } diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index ab07d8a3..14df8221 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -880,6 +880,8 @@ retry_getglyphs: pos->x_offset = x_mult * (isRightToLeft ? -info->var1.i32 : info->var1.i32); pos->y_offset = y_mult * info->var2.i32; + + info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; } if (isRightToLeft) diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index c9799e9d..6eb34b0e 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -355,6 +355,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, hb_glyph_info_t *info = &buffer->info[clusters[i].base_glyph + j]; info->codepoint = gids[clusters[i].base_glyph + j]; info->cluster = clusters[i].cluster; + info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; info->var1.i32 = clusters[i].advance; // all glyphs in the cluster get the same advance } } diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 58f983db..d25accd5 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -1024,6 +1024,8 @@ retry: pos->x_advance = x_mult * (int32_t) info->mask; pos->x_offset = x_mult * (backward ? -info->var1.i32 : info->var1.i32); pos->y_offset = y_mult * info->var2.i32; + + info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; } if (backward) -- GitLab