[kern] Adjust some more
Getting closer. So many open questions still...
This commit is contained in:
parent
4d003b8503
commit
564e8ac046
|
@ -266,13 +266,9 @@ struct KernSubTableFormat1
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_mask_t kern_mask = c->plan->kern_mask;
|
hb_mask_t kern_mask = c->plan->kern_mask;
|
||||||
for (unsigned int i = 0; i < depth; i++)
|
while (depth--)
|
||||||
{
|
{
|
||||||
/* Apparently, when spec says "Each pops one glyph from the kerning stack
|
unsigned int idx = stack[depth];
|
||||||
* and applies the kerning value to it.", it doesn't mean it in that order.
|
|
||||||
* The deepest item in the stack corresponds to the first item in the action
|
|
||||||
* list. Discovered by testing. */
|
|
||||||
unsigned int idx = stack[i];
|
|
||||||
int v = *actions++;
|
int v = *actions++;
|
||||||
|
|
||||||
/* The following two flags are undocumented in the spec, but described
|
/* The following two flags are undocumented in the spec, but described
|
||||||
|
@ -291,29 +287,41 @@ struct KernSubTableFormat1
|
||||||
{
|
{
|
||||||
if (crossStream)
|
if (crossStream)
|
||||||
{
|
{
|
||||||
|
if (!buffer->pos[idx].y_offset)
|
||||||
|
buffer->pos[idx].y_offset += c->font->em_scale_y (crossOffset);
|
||||||
/* XXX Why negative, not positive?!?! */
|
/* XXX Why negative, not positive?!?! */
|
||||||
crossOffset -= v;
|
v = -v;
|
||||||
buffer->pos[idx].y_offset += c->font->em_scale_y (crossOffset);
|
crossOffset += v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer->pos[idx].x_advance += c->font->em_scale_x (v);
|
if (!buffer->pos[idx].x_offset)
|
||||||
if (last)
|
{
|
||||||
|
buffer->pos[idx].x_advance += c->font->em_scale_x (v);
|
||||||
buffer->pos[idx].x_offset += c->font->em_scale_x (v);
|
buffer->pos[idx].x_offset += c->font->em_scale_x (v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (crossStream)
|
if (crossStream)
|
||||||
{
|
{
|
||||||
crossOffset += v;
|
/* CoreText doesn't do crossStream kerning in vertical. */
|
||||||
buffer->pos[idx].x_offset += c->font->em_scale_x (crossOffset);
|
#if 0
|
||||||
|
if (!buffer->pos[idx].x_offset)
|
||||||
|
buffer->pos[idx].x_offset = c->font->em_scale_x (crossOffset);
|
||||||
|
#endif
|
||||||
|
/* XXX Why negative, not positive?!?! */
|
||||||
|
v = -v;
|
||||||
|
crossOffset += v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buffer->pos[idx].y_advance += c->font->em_scale_y (v);
|
if (!buffer->pos[idx].y_offset)
|
||||||
if (last)
|
{
|
||||||
|
buffer->pos[idx].y_advance += c->font->em_scale_y (v);
|
||||||
buffer->pos[idx].y_offset += c->font->em_scale_y (v);
|
buffer->pos[idx].y_offset += c->font->em_scale_y (v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue