summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 01:40:08 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 01:40:08 +0000
commitdd6a184f6ad67921250e3f801a456c5f2ede510b (patch)
treecf60d4692464d5bc070fd9333c3c6096fb7323f2 /app
parentcdeb0a609ebdef1718708d821f5169ea21eb3ca0 (diff)
downloadchromium_src-dd6a184f6ad67921250e3f801a456c5f2ede510b.zip
chromium_src-dd6a184f6ad67921250e3f801a456c5f2ede510b.tar.gz
chromium_src-dd6a184f6ad67921250e3f801a456c5f2ede510b.tar.bz2
gtk: Fix RTL layout of page title for strong right-to-left characters. When pango detects strong RTL characters in the layout, it switches the text direction. For our uses of DrawStringInt, we've already handled the layout and don't want the direction switched. This matches the behavior of Windows.
BUG=16970 TEST=Open a browser in a RTL language. Navigate to google.com and notice that the tab title is right-aligned. Open up the history page and notice that the title (in Hebrew) is right-aligned as well. Review URL: http://codereview.chromium.org/155829 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/gfx/canvas_linux.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/gfx/canvas_linux.cc b/app/gfx/canvas_linux.cc
index cf7352d..091685e 100644
--- a/app/gfx/canvas_linux.cc
+++ b/app/gfx/canvas_linux.cc
@@ -102,6 +102,10 @@ void Canvas::DrawStringInt(const std::wstring& text,
cairo_t* cr = beginPlatformPaint();
PangoLayout* layout = pango_cairo_create_layout(cr);
+ // Callers of DrawStringInt handle RTL layout themselves, so tell pango to not
+ // scope out RTL characters.
+ pango_layout_set_auto_dir(layout, FALSE);
+
cairo_set_source_rgb(cr,
SkColorGetR(color) / 255.0,
SkColorGetG(color) / 255.0,