summaryrefslogtreecommitdiff
path: root/pango/pango-context.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/pango-context.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/pango-context.c')
-rw-r--r--pango/pango-context.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c
index f0fae76d..c538d3e9 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -875,25 +875,31 @@ itemize_state_add_character (ItemizeState *state,
state->item->analysis.level = state->embedding;
state->item->analysis.gravity = state->gravity;
/* The level vs. gravity dance:
- * - If gravity is NORTH, leave level untouched
- * - If gravity is SOUTH, step level one up, to
+ * - If gravity is SOUTH, leave level untouched
+ * - If gravity is NORTH, step level one up, to
* not get mirrored upside-down text
- * - If gravity is WEST, leave level untouched, as
+ * - If gravity is EAST, step up to an even level, as
* it's a clockwise-rotated layout, so the rotated
* top is unrotated left.
- * - If gravity is EAST, step level one up to get, as
+ * - If gravity is WEST, step up to an odd level, as
* it's a counter-clockwise-rotated layout, so the rotated
* top is unrotated right.
*/
switch (state->item->analysis.gravity)
{
case PANGO_GRAVITY_SOUTH:
- case PANGO_GRAVITY_EAST:
default:
break;
case PANGO_GRAVITY_NORTH:
- case PANGO_GRAVITY_WEST:
state->item->analysis.level++;
+ break;
+ case PANGO_GRAVITY_EAST:
+ state->item->analysis.level += 1;
+ state->item->analysis.level &= ~1;
+ break;
+ case PANGO_GRAVITY_WEST:
+ state->item->analysis.level |= 1;
+ break;
}
state->item->analysis.language = state->derived_lang;