summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx21
-rw-r--r--vcl/inc/generic/glyphcache.hxx1
2 files changed, 14 insertions, 8 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index ca40e9d69d97..eef1fd08f201 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -67,7 +67,6 @@ bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs )
}
// -----------------------------------------------------------------------
-
void ServerFontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
{
GenericSalLayout::AdjustLayout( rArgs );
@@ -91,6 +90,18 @@ void ServerFontLayout::AdjustLayout( ImplLayoutArgs& rArgs )
}
}
+void ServerFontLayout::ApplyDXArray(ImplLayoutArgs& rArgs)
+{
+#if ENABLE_HARFBUZZ
+ // No idea what issue ApplyDXArray() was supposed to fix, but whatever
+ // GenericSalLayout::ApplyDXArray() does it just breaks our perfectly
+ // positioned text.
+ const char* pUseHarfBuzz = getenv("SAL_USE_HARFBUZZ");
+ if (!pUseHarfBuzz)
+#endif
+ GenericSalLayout::ApplyDXArray(rArgs);
+}
+
// =======================================================================
static bool lcl_CharIsJoiner(sal_Unicode cChar)
@@ -423,13 +434,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
aNewPos = Point(aNewPos.X() + aHbPositions[i].x_offset, aNewPos.Y() - aHbPositions[i].y_offset);
GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth);
-
- // This is a hack to compensate for assumptions made elsewhere in
- // the codebase, the right way is to use aHbPositions[i].x_advance
- // 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 >> 6);
+ aGI.mnNewWidth = aHbPositions[i].x_advance;
rLayout.AppendGlyph(aGI);
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index d9f8378a28d9..cc3ae497c584 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -322,6 +322,7 @@ public:
ServerFontLayout( ServerFont& );
virtual bool LayoutText( ImplLayoutArgs& );
virtual void AdjustLayout( ImplLayoutArgs& );
+ virtual void ApplyDXArray( ImplLayoutArgs& );
virtual void DrawText( SalGraphics& ) const;
ServerFont& GetServerFont() const { return mrServerFont; }
};