提交 9c04b605 编写于 作者: B Behdad Esfahbod

[kern] In Format1, adjust how kerning is done

In a series of kerns in one action, kern all but last glyph forward,
and the last one backward.  Seems to better match what CoreText is doing.

Test cases, with GeezaPro Arabic:

$ ./hb-shape GeezaPro_10_10.ttc -u U+0631,U+0628
[u0628.beh=1+1415|u0631.reh=0@-202,0+700]

$ ./hb-shape GeezaPro_10_10.ttc -u U+0628,U+064F
[u064f.damma=0@0,-250+-250|u0628.beh=0@250,0+1665]

In a later change, I'll make kern machine avoid producing negative kerns.
上级 e8c47724
...@@ -289,7 +289,7 @@ struct KernSubTableFormat1 ...@@ -289,7 +289,7 @@ struct KernSubTableFormat1
else else
{ {
buffer->pos[idx].x_advance += c->font->em_scale_x (v); buffer->pos[idx].x_advance += c->font->em_scale_x (v);
if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) if (last)
buffer->pos[idx].x_offset += c->font->em_scale_x (v); buffer->pos[idx].x_offset += c->font->em_scale_x (v);
} }
} }
...@@ -303,7 +303,7 @@ struct KernSubTableFormat1 ...@@ -303,7 +303,7 @@ struct KernSubTableFormat1
else else
{ {
buffer->pos[idx].y_advance += c->font->em_scale_y (v); buffer->pos[idx].y_advance += c->font->em_scale_y (v);
if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) if (last)
buffer->pos[idx].y_offset += c->font->em_scale_y (v); buffer->pos[idx].y_offset += c->font->em_scale_y (v);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册