summaryrefslogtreecommitdiff
path: root/pango/shape.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-08-15 19:26:40 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-08-15 19:26:40 +0000
commit099d3b8efa4b04c8d578aa9e1de3e108ef4c77a9 (patch)
treeb9dd21fb459506b945fcf43032c2acd7b7ff3f2c /pango/shape.c
parent9f96e87af64452c67466dc48636d7df77cdd5cd4 (diff)
downloadpango-099d3b8efa4b04c8d578aa9e1de3e108ef4c77a9.tar.gz
Fix handling of WEST and EAST gravity effect on bidi level.
2006-08-15 Behdad Esfahbod <behdad@gnome.org> * pango/pango-context.c (itemize_state_add_character): Fix handling of WEST and EAST gravity effect on bidi level. * pango/pangocairo-fcfont.c (pango_cairo_fc_font_glyph_extents_cache_init): For NORTH gravity (upside down text), swap ascent and descent, and for EAST/WEST, center baseline between ascent/descent. * pango/shape.c (pango_shape): If glyph width is negative, negate it and shift glyph by that amount. This allows having font matrices that essentially move the glyph origin to the right of the glyph to still work.
Diffstat (limited to 'pango/shape.c')
-rw-r--r--pango/shape.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/pango/shape.c b/pango/shape.c
index 50479b5e..96abd21b 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -109,10 +109,10 @@ pango_shape (const gchar *text,
text, length, analysis, glyphs);
}
- /* Set glyphs[i].attr.is_cluster_start based on log_clusters[]
- */
for (i = 0; i < glyphs->num_glyphs; i++)
{
+ /* Set glyphs[i].attr.is_cluster_start based on log_clusters[]
+ */
if (glyphs->log_clusters[i] != last_cluster)
{
glyphs->glyphs[i].attr.is_cluster_start = TRUE;
@@ -120,5 +120,16 @@ pango_shape (const gchar *text,
}
else
glyphs->glyphs[i].attr.is_cluster_start = FALSE;
+
+
+ /* Shift glyph if width is negative, and negate width.
+ * This is useful for rotated font matrices and shouldn't
+ * harm in normal cases.
+ */
+ if (glyphs->glyphs[i].geometry.width < 0)
+ {
+ glyphs->glyphs[i].geometry.width = -glyphs->glyphs[i].geometry.width;
+ glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[i].geometry.width;
+ }
}
}