diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 22eb499ee..59dddcf73 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -437,6 +437,22 @@ struct MarkArray : ArrayOf /* Array of MarkRecords--in Coverage orde o.attach_type() = ATTACH_TYPE_MARK; o.attach_chain() = (int) glyph_pos - (int) buffer->idx; buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; + { + unsigned int i = buffer->idx; + unsigned int j = glyph_pos; + hb_glyph_position_t *pos = buffer->pos; + assert (j < i); + if (HB_DIRECTION_IS_FORWARD (c->direction)) + for (unsigned int k = j; k < i; k++) { + pos[i].x_offset -= pos[k].x_advance; + pos[i].y_offset -= pos[k].y_advance; + } + else + for (unsigned int k = j + 1; k < i + 1; k++) { + pos[i].x_offset += pos[k].x_advance; + pos[i].y_offset += pos[k].y_advance; + } + } buffer->idx++; return_trace (true); @@ -917,9 +933,6 @@ struct CursivePosFormat1 TRACE_APPLY (this); hb_buffer_t *buffer = c->buffer; - /* We don't handle mark glyphs here. */ - if (unlikely (_hb_glyph_info_is_mark (&buffer->cur()))) return_trace (false); - const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage (buffer->cur().codepoint)]; if (!this_record.exitAnchor) return_trace (false); @@ -1580,18 +1593,6 @@ propagate_attachment_offsets (hb_glyph_position_t *pos, unsigned int i, hb_direc { pos[i].x_offset += pos[j].x_offset; pos[i].y_offset += pos[j].y_offset; - - assert (j < i); - if (HB_DIRECTION_IS_FORWARD (direction)) - for (unsigned int k = j; k < i; k++) { - pos[i].x_offset -= pos[k].x_advance; - pos[i].y_offset -= pos[k].y_advance; - } - else - for (unsigned int k = j + 1; k < i + 1; k++) { - pos[i].x_offset += pos[k].x_advance; - pos[i].y_offset += pos[k].y_advance; - } } } diff --git a/test/shaping/fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf b/test/shaping/fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf new file mode 100644 index 000000000..eb5c50c66 Binary files /dev/null and b/test/shaping/fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf differ diff --git a/test/shaping/fonts/sha1sum/MANIFEST b/test/shaping/fonts/sha1sum/MANIFEST index a94bc5139..5c8c9de89 100644 --- a/test/shaping/fonts/sha1sum/MANIFEST +++ b/test/shaping/fonts/sha1sum/MANIFEST @@ -22,6 +22,7 @@ 5a5daf5eb5a4db77a2baa3ad9c7a6ed6e0655fa8.ttf 641bd9db850193064d17575053ae2bf8ec149ddc.ttf 6466d38c62e73a39202435a4f73bf5d6acbb73c0.ttf +706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf 757ebd573617a24aa9dfbf0b885c54875c6fe06b.ttf 7a37dc4d5bf018456aea291cee06daf004c0221c.ttf 7e14e7883ed152baa158b80e207b66114c823a8b.ttf diff --git a/test/shaping/tests/cursive-positioning.tests b/test/shaping/tests/cursive-positioning.tests index b61d0c13b..503554f43 100644 --- a/test/shaping/tests/cursive-positioning.tests +++ b/test/shaping/tests/cursive-positioning.tests @@ -1,2 +1,3 @@ fonts/sha1sum/c4e48b0886ef460f532fb49f00047ec92c432ec0.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3@441,1197+0|gid6=3@0,432+405|gid9=2@0,477+452|gid9=1@0,977+452|gid10=0@20,1577+207] fonts/sha1sum/298c9e1d955f10f6f72c6915c3c6ff9bf9695cec.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3@441,1197+0|gid6=3@0,432+405|gid9=2@0,477+500|gid9=1@0,577+452|gid10=0@20,1177+207] +fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf::U+0B1F,U+0B4D,U+0B1A,U+0B4D,U+0B1A:[ttaorya=0+1307|casubscriptorya=0@-242,104+-231|casubscriptnarroworya=0@20,104+507]