Correctly handle back, new_advance.
This commit is contained in:
parent
c880e814a5
commit
fb279cb0bf
|
@ -247,18 +247,26 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
|
||||||
{
|
{
|
||||||
for (i = 0; i < result_string->length; i++)
|
for (i = 0; i < result_string->length; i++)
|
||||||
{
|
{
|
||||||
|
FT_Pos x_pos = outgpos[i].x_pos;
|
||||||
|
FT_Pos y_pos = outgpos[i].y_pos;
|
||||||
|
int back = i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6 (outgpos[i].x_pos);
|
while (outgpos[back].back != 0)
|
||||||
glyphs->glyphs[i].geometry.y_offset += PANGO_UNITS_26_6 (outgpos[i].y_pos);
|
{
|
||||||
|
back -= outgpos[back].back;
|
||||||
|
x_pos += outgpos[back].x_pos;
|
||||||
|
y_pos += outgpos[back].y_pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = back; j < i; j++)
|
||||||
|
glyphs->glyphs[i].geometry.x_offset -= glyphs->glyphs[j].geometry.width;
|
||||||
|
|
||||||
|
glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6(x_pos);
|
||||||
|
glyphs->glyphs[i].geometry.y_offset += PANGO_UNITS_26_6(y_pos);
|
||||||
|
|
||||||
for (j = i - outgpos[i].back; j < i; j++)
|
|
||||||
glyphs->glyphs[i].geometry.x_offset -= glyphs->glyphs[j].geometry.width;
|
|
||||||
|
|
||||||
if (outgpos[i].new_advance)
|
if (outgpos[i].new_advance)
|
||||||
/* Can't set new x offset for marks, so just make sure not to increase it.
|
glyphs->glyphs[i].geometry.width = PANGO_UNITS_26_6(outgpos[i].x_advance);
|
||||||
Can do better than this by playing with ->x_offset. */
|
|
||||||
glyphs->glyphs[i].geometry.width = 0;
|
|
||||||
else
|
else
|
||||||
glyphs->glyphs[i].geometry.width += PANGO_UNITS_26_6(outgpos[i].x_advance);
|
glyphs->glyphs[i].geometry.width += PANGO_UNITS_26_6(outgpos[i].x_advance);
|
||||||
}
|
}
|
||||||
|
@ -273,7 +281,6 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset,
|
||||||
for (i = 0; i < result_string->length; i++)
|
for (i = 0; i < result_string->length; i++)
|
||||||
{
|
{
|
||||||
glyphs->glyphs[i].glyph = result_string->string[i];
|
glyphs->glyphs[i].glyph = result_string->string[i];
|
||||||
glyphs->glyphs[i].glyph = result_string->string[i];
|
|
||||||
|
|
||||||
glyphs->log_clusters[i] = result_string->logClusters[i];
|
glyphs->log_clusters[i] = result_string->logClusters[i];
|
||||||
if (glyphs->log_clusters[i] != last_cluster)
|
if (glyphs->log_clusters[i] != last_cluster)
|
||||||
|
|
Loading…
Reference in New Issue