summaryrefslogtreecommitdiffstats
path: root/ui/gfx/pango_util.cc
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 21:57:31 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 21:57:31 +0000
commit46cb5380832a688d32cc39a25080381f90a204f2 (patch)
tree66795e797e715e0a32b2098ad955f93cd8bb08b0 /ui/gfx/pango_util.cc
parentf06188681397c7d6bc785d5dc9c26092c1f3ac03 (diff)
downloadchromium_src-46cb5380832a688d32cc39a25080381f90a204f2.zip
chromium_src-46cb5380832a688d32cc39a25080381f90a204f2.tar.gz
chromium_src-46cb5380832a688d32cc39a25080381f90a204f2.tar.bz2
Add RenderText DirectionalityMode enum and support; etc.
Add gfx::DirectionalityMode enum. Add RenderText::SetDirectionalityMode and member. Revise/consolidate RenderText::GetTextDirection. Expand on existing unit tests; minor cleanup. Consume GetTextDirection in layout initialization: -Windows: RenderTextWin::ItemizeLogicalText() -Linux: SetupPangoLayoutWithoutFont() -Mac: Add TODO in RenderTextMac::EnsureLayout() BUG=134746 TEST=Existing/updated unit tests, no behavioral changes! Review URL: https://chromiumcodereview.appspot.com/10807082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/pango_util.cc')
-rw-r--r--ui/gfx/pango_util.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/gfx/pango_util.cc b/ui/gfx/pango_util.cc
index ca129b1..638f77c 100644
--- a/ui/gfx/pango_util.cc
+++ b/ui/gfx/pango_util.cc
@@ -204,9 +204,11 @@ static void SetupPangoLayoutWithoutFont(
cairo_font_options = NULL;
}
- // Callers of DrawStringInt handle RTL layout themselves, so tell pango to not
- // scope out RTL characters.
+ // Set Pango's base text direction explicitly from |text_direction|.
pango_layout_set_auto_dir(layout, FALSE);
+ pango_context_set_base_dir(pango_layout_get_context(layout),
+ (text_direction == base::i18n::RIGHT_TO_LEFT ?
+ PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR));
if (width > 0)
pango_layout_set_width(layout, width * PANGO_SCALE);