summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorPale Moon <git-repo@palemoon.org>2017-04-03 14:00:02 +0200
committerPale Moon <git-repo@palemoon.org>2017-04-03 14:00:02 +0200
commitaf9f6ff8c5e7ca0a99b9f6928365d291b4f70696 (patch)
tree2a3504bd08da0a99e62ec4d209c6eadf2f25af34 /gfx
parent96019c210d3eabe57bf5cee08e086b6ca357f5cf (diff)
downloadpalemoon-gre-af9f6ff8c5e7ca0a99b9f6928365d291b4f70696.tar.gz
Fix the handling of glyph positioning (gpos) offsets in vertical-upright mode.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/thebes/gfxHarfBuzzShaper.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp
index b0cfc79be..6f7adb729 100644
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -1620,7 +1620,15 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxContext *aContext,
// collect all glyphs in a list to be assigned to the first char;
// there must be at least one in the clump, and we already measured
// its advance, hence the placement of the loop-exit test and the
- // measurement of the next glyph
+ // measurement of the next glyph.
+ // For vertical orientation, we add a "base offset" to compensate
+ // for the positioning within the cluster being based on horizontal
+ // glyph origin/offset.
+ hb_position_t baseIOffset, baseBOffset;
+ if (aVertical) {
+ baseIOffset = 2 * (i_offset - i_advance);
+ baseBOffset = GetGlyphHAdvance(ginfo[glyphStart].codepoint);
+ }
while (1) {
gfxTextRun::DetailedGlyph* details =
detailedGlyphs.AppendElement();
@@ -1643,9 +1651,9 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxContext *aContext,
}
if (aVertical) {
- i_offset = posInfo[glyphStart].y_offset;
+ i_offset = baseIOffset - posInfo[glyphStart].y_offset;
i_advance = posInfo[glyphStart].y_advance;
- b_offset = posInfo[glyphStart].x_offset;
+ b_offset = baseBOffset - posInfo[glyphStart].x_offset;
b_advance = posInfo[glyphStart].x_advance;
} else {
i_offset = posInfo[glyphStart].x_offset;