diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-04-23 12:39:07 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-04-23 10:57:08 +0000 |
commit | 9d4395540a10916d471579618d7bf3b60cd49140 (patch) | |
tree | 64bf7754d5d325b66ec14cd72a08d0328bde9b7e /vcl/generic | |
parent | 26ae620b036432ac3b3eb1322331d2e70b4e9e0e (diff) |
Fix glyph width calculation in HarfBuzz
Make sure everything is using 16.16 fixed point values consistently.
Change-Id: Icdcd94775d3860d57bb446a3f237c31e35e0710a
Reviewed-on: https://gerrit.libreoffice.org/3573
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/glyphs/gcach_layout.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index 1f9f3d0b98c0..ca40e9d69d97 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -152,7 +152,7 @@ static hb_position_t getGlyphAdvanceH(hb_font_t* /*font*/, void* fontData, { ServerFont* rFont = (ServerFont*) fontData; const GlyphMetric& rGM = rFont->GetGlyphMetric(nGlyphIndex); - return rGM.GetCharWidth(); + return rGM.GetCharWidth() << 6; } static hb_position_t getGlyphAdvanceV(hb_font_t* /*font*/, void* /*fontData*/, @@ -415,10 +415,10 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) if (hb_ot_layout_get_glyph_class(maHbFace, nGlyphIndex) == HB_OT_LAYOUT_GLYPH_CLASS_MARK) nGlyphFlags |= GlyphItem::IS_DIACRITIC; - aHbPositions[i].x_offset /= 64; - aHbPositions[i].y_offset /= 64; - aHbPositions[i].x_advance /= 64; - aHbPositions[i].y_advance /= 64; + aHbPositions[i].x_offset = aHbPositions[i].x_offset >> 6; + aHbPositions[i].y_offset = aHbPositions[i].y_offset >> 6; + aHbPositions[i].x_advance = aHbPositions[i].x_advance >> 6; + aHbPositions[i].y_advance = aHbPositions[i].y_advance >> 6; aNewPos = Point(aNewPos.X() + aHbPositions[i].x_offset, aNewPos.Y() - aHbPositions[i].y_offset); @@ -429,7 +429,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) // instead of nGlyphWidth above, and leave mnNewWidth alone // (whatever it is meant for) if (i + 1 < nRunGlyphCount) - aGI.mnNewWidth = nGlyphWidth + (aHbPositions[i + 1].x_offset / 64); + aGI.mnNewWidth = nGlyphWidth + (aHbPositions[i + 1].x_offset >> 6); rLayout.AppendGlyph(aGI); |