[HarfBuzz] harfbuzz: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Nov 4 23:01:26 PST 2015
src/hb-buffer-private.hh | 2 ++
src/hb-ot-layout-gpos-table.hh | 15 ++++++++-------
src/hb-ot-shape.cc | 7 +++++++
3 files changed, 17 insertions(+), 7 deletions(-)
New commits:
commit e95eb23a4ee920eab1e2f4eec9cf490bb431452c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 4 22:55:11 2015 -0800
Don't try zeroing marks by GDEF if there are no non-ASCII
This one is a hack, but should be ok.
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 8d4b169..36b1297 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -638,6 +638,10 @@ zero_mark_widths_by_unicode (hb_buffer_t *buffer, bool adjust_offsets)
static inline void
zero_mark_widths_by_gdef (hb_buffer_t *buffer, bool adjust_offsets)
{
+ /* This one is a hack; Technically GDEF can mark ASCII glyphs as marks, but we don't listen. */
+ if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII))
+ return;
+
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++)
commit 7fa54ed75aa30ae1d6ee9136ccb83b630c24fb65
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 4 22:54:49 2015 -0800
Don't try zeroing mark attachments by Unicode if there's no non-ASCII
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 4b2732b..8d4b169 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -621,6 +621,9 @@ zero_mark_width (hb_glyph_position_t *pos)
static inline void
zero_mark_widths_by_unicode (hb_buffer_t *buffer, bool adjust_offsets)
{
+ if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII))
+ return;
+
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++)
commit 550bd14d2b21ec2a2b509ff42f4df4341dbf2d46
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Nov 4 22:58:58 2015 -0800
Actually commit changes for previous commit
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index 8550517..53c6780 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -46,6 +46,8 @@ enum hb_buffer_scratch_flags_t {
HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII = 0x00000001u,
HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES = 0x00000002u,
HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK = 0x00000004u,
+ HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_CURSIVE = 0x00000008u,
+ HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT = 0x00000010u,
};
template <> class hb_mark_as_flags_t<hb_buffer_scratch_flags_t> {};
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 3bb0913..8bb9107 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -426,6 +426,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
o.x_offset = base_x - mark_x;
o.y_offset = base_y - mark_y;
o.attach_lookback() = buffer->idx - glyph_pos;
+ buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT;
buffer->idx++;
return_trace (true);
@@ -993,6 +994,7 @@ struct CursivePosFormat1
reverse_cursive_minor_offset (pos, child, c->direction, parent);
pos[child].cursive_chain() = parent - child;
+ buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_CURSIVE;
if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
pos[child].y_offset = y_offset;
else
@@ -1599,15 +1601,14 @@ GPOS::position_finish (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
hb_direction_t direction = buffer->props.direction;
/* Handle cursive connections */
- for (unsigned int i = 0; i < len; i++)
- fix_cursive_minor_offset (pos, i, direction);
-
- if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII))
- return;
+ if (buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_CURSIVE)
+ for (unsigned int i = 0; i < len; i++)
+ fix_cursive_minor_offset (pos, i, direction);
/* Handle attachments */
- for (unsigned int i = 0; i < len; i++)
- fix_mark_attachment (pos, i, direction);
+ if (buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT)
+ for (unsigned int i = 0; i < len; i++)
+ fix_mark_attachment (pos, i, direction);
}
More information about the HarfBuzz
mailing list