From 21646cc4a6160088933774e179df9be4865a9f4b Mon Sep 17 00:00:00 2001 From: David Corbett Date: Fri, 16 Feb 2018 12:08:55 -0500 Subject: [PATCH] Do not mark the first glyph as unsafe to break Fixes #791. --- src/hb-buffer-private.hh | 3 +-- src/hb-coretext.cc | 4 ---- src/hb-directwrite.cc | 2 -- src/hb-graphite2.cc | 1 - src/hb-uniscribe.cc | 2 -- 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index a72376de..af4767f5 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -344,8 +344,7 @@ struct hb_buffer_t { inline void unsafe_to_break_all (void) { - for (unsigned int i = 0; i < len; i++) - info[i].mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK; + unsafe_to_break_impl (0, len); } inline void safe_to_break_all (void) diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index 752dea8a..aba7cf44 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -1244,8 +1244,6 @@ resize_and_retry: pos->x_offset = info->var1.i32; pos->y_offset = info->var2.i32; - info->mask = HB_GLYPH_FLAG_UNSAFE_TO_BREAK; - info++, pos++; } else @@ -1255,8 +1253,6 @@ resize_and_retry: 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 5429255a..69a8aa20 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -878,8 +878,6 @@ 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 3b55b475..46fe1399 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -360,7 +360,6 @@ _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 5e05baa8..cd25769d 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -1025,8 +1025,6 @@ 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