Merge pull request #6537 from harfbuzz/issue-6535

[aat] Apply kerx format 4 cross-direction mark offsets immediately
This commit is contained in:
Khaled Hosny authored and GitHub committed 2026-11-01 09:28:05 -07:00
1 parent b05c7266d6
commit 436f067b20
6 files changed
+19 -2

No files matched your search

+4 -2
View File
@@ -12,7 +12,8 @@ static inline hb_position_t
resolve_cross_offset (const hb_glyph_position_t *pos,
unsigned int len,
unsigned int glyph_pos,
hb_direction_t direction)
hb_direction_t direction,
bool reversed = false)
{
bool horizontal = HB_DIRECTION_IS_HORIZONTAL (direction);
hb_position_t offset = horizontal ? pos[glyph_pos].y_offset : pos[glyph_pos].x_offset;
@@ -25,7 +26,8 @@ resolve_cross_offset (const hb_glyph_position_t *pos,
int chain = pos[glyph_pos].attach_chain();
if (!chain)
break;
unsigned int parent = (int) glyph_pos + chain;
/* AAT keeps attachment chains in the original buffer order. */
unsigned int parent = (int) glyph_pos + (reversed ? -chain : chain);
if (unlikely (parent >= len))
break;
glyph_pos = parent;
+7
View File
@@ -632,6 +632,13 @@ struct KerxSubTableFormat4
}
break;
}
hb_position_t base_offset = OT::Layout::GPOS_impl::resolve_cross_offset (buffer->pos, buffer->len, mark,
buffer->props.direction,
c->buffer_is_reversed);
if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
o.y_offset = hb_saturate_add (o.y_offset, base_offset);
else
o.x_offset = hb_saturate_add (o.x_offset, base_offset);
o.attach_type() = OT::Layout::GPOS_impl::ATTACH_TYPE_MARK;
o.attach_chain() = (int) mark - (int) buffer->idx;
if (c->buffer_is_reversed)
@@ -10,3 +10,11 @@
../fonts/9f0def61bfa49ffb44ba45c8703eee567c5bb816.ttf;;U+0045,U+0042;[E=0+600|B=1+600]
../fonts/9f0def61bfa49ffb44ba45c8703eee567c5bb816.ttf;;U+0041,U+0045;[A=0+600|E=1+600]
../fonts/9f0def61bfa49ffb44ba45c8703eee567c5bb816.ttf;--features=-kern;U+0041,U+0042;[A=0+600|B=1+600]
../fonts/76945ad2b2303cbdf235f5be45285993eb65694b.ttf;;U+0062,U+0078;[b=0+615|m=1@-440,600+150]
../fonts/76945ad2b2303cbdf235f5be45285993eb65694b.ttf;;U+0062,U+0078,U+0078;[b=0+615|m=1@-440,600+150|m=2@-590,800+150]
../fonts/a8b4a746c2d1a1fd5d5d6108e366e79c0ae74ef5.ttf;;U+0645,U+064F,U+062D,U+064E,U+0645,U+064E,U+0651,U+062F;[uni062F.fina=7+474|uni064E=4@107,-64+0|uni0651=4@109,-186+0|uni0645.medi=4+413|uni064E=2@200,-172+0|uni062D.medi=2+666|uni064F=0@143,-196+0|uni0645.init=0+456]
../fonts/a8b4a746c2d1a1fd5d5d6108e366e79c0ae74ef5.ttf;;U+0643,U+064F,U+0644,U+064F,U+0651;[uni064F=2@112,-32+0|uni0651=2@128,-154+0|uni0644.fina=2+591|uni064F=0@56,-105+0|uni0643.init=0+415]
# Cross-stream kerning followed by a backwards format 4 attachment.
# Reset c's chain so m attaches to the unshifted b.
../fonts/1bfb8aab9b49ef30e8deae3db271ca3dbc6208a1.ttf;;U+0078,U+007A,U+0062,U+0062;[m=0@925,600+150|c=1+600|b=2+615|b=3@0,100+615]
../fonts/1bfb8aab9b49ef30e8deae3db271ca3dbc6208a1.ttf;;U+0078,U+007A,U+0062,U+0062,U+0062;[m=0@925,600+150|c=1+600|b=2+615|b=3@0,100+615|b=4@0,200+615]