From fb279cb0bf676bb1d225e6a296282523d839074d Mon Sep 17 00:00:00 2001 From: Eric Mader Date: Mon, 9 Sep 2002 18:11:55 +0000 Subject: [PATCH] Correctly handle back, new_advance. --- src/pango-ot-ruleset.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/pango-ot-ruleset.c b/src/pango-ot-ruleset.c index d392cc8..0283929 100644 --- a/src/pango-ot-ruleset.c +++ b/src/pango-ot-ruleset.c @@ -247,18 +247,26 @@ pango_ot_ruleset_shape (PangoOTRuleset *ruleset, { 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; - glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6 (outgpos[i].x_pos); - glyphs->glyphs[i].geometry.y_offset += PANGO_UNITS_26_6 (outgpos[i].y_pos); + while (outgpos[back].back != 0) + { + 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) - /* Can't set new x offset for marks, so just make sure not to increase it. - Can do better than this by playing with ->x_offset. */ - glyphs->glyphs[i].geometry.width = 0; + glyphs->glyphs[i].geometry.width = PANGO_UNITS_26_6(outgpos[i].x_advance); else 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++) { glyphs->glyphs[i].glyph = result_string->string[i]; - glyphs->glyphs[i].glyph = result_string->string[i]; glyphs->log_clusters[i] = result_string->logClusters[i]; if (glyphs->log_clusters[i] != last_cluster) -- 2.7.4