From 3e738789d18fc1ba74dd2593b6f585cff7c36a9e Mon Sep 17 00:00:00 2001 From: "msw@chromium.org" Date: Sun, 20 Jul 2014 02:25:17 +0000 Subject: [PATCH] Fix RenderTextHarfBuzz glyph offset regression. Negate the vertical glyph offset in RenderTextHarfBuzz. Also restores the hb_buffer_set_language call and comment. These were victims of merge errors in r284297. BUG=391203 TEST=Arabic diacritics are drawn correctly. R=ckocagil@chromium.org TBR=asvitkine@chromium.org Review URL: https://codereview.chromium.org/408733002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284356 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/render_text_harfbuzz.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc index 8d332e3c147b..2fcf15711ff5 100644 --- a/ui/gfx/render_text_harfbuzz.cc +++ b/ui/gfx/render_text_harfbuzz.cc @@ -1011,7 +1011,8 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run, hb_buffer_set_script(buffer, ICUScriptToHBScript(run->script)); hb_buffer_set_direction(buffer, run->is_rtl ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); - // TODO(ckocagil): Should we call |hb_buffer_set_language()| here? + // TODO(ckocagil): Should we determine the actual language? + hb_buffer_set_language(buffer, hb_language_get_default()); // Shape the text. hb_shape(harfbuzz_font, buffer, NULL, 0); @@ -1033,7 +1034,7 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run, SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_offset)); const int y_offset = SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].y_offset)); - run->positions[i].set(run->width + x_offset, y_offset); + run->positions[i].set(run->width + x_offset, -y_offset); run->width += SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); } -- 2.11.4.GIT