diff options
Diffstat (limited to 'vcl/source/font/LogicalFontInstance.cxx')
-rw-r--r-- | vcl/source/font/LogicalFontInstance.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/font/LogicalFontInstance.cxx b/vcl/source/font/LogicalFontInstance.cxx index fbb115825828..3cf95cab8d65 100644 --- a/vcl/source/font/LogicalFontInstance.cxx +++ b/vcl/source/font/LogicalFontInstance.cxx @@ -171,8 +171,8 @@ void LogicalFontInstance::IgnoreFallbackForUnicode(sal_UCS4 cChar, FontWeight eW bool LogicalFontInstance::GetGlyphBoundRect(sal_GlyphId nID, basegfx::B2DRectangle& rRect, bool bVertical) const { - // TODO/FIXME: bVertical handling here is highly suspicious. When it's true, it may - // return different rectangle, depending on if this glyph was cached already or not. + // TODO: find out if it's possible for the same glyph in the same font to be used both + // normally and vertically; if yes, then these two variants must be cached separately if (mpFontCache && mpFontCache->GetCachedGlyphBoundRect(this, nID, rRect)) return true; @@ -191,10 +191,13 @@ bool LogicalFontInstance::GetGlyphBoundRect(sal_GlyphId nID, basegfx::B2DRectang double fMaxY = -(aExtents.y_bearing + aExtents.height) * nYScale; rRect = basegfx::B2DRectangle(fMinX, fMinY, fMaxX, fMaxY); - if (mnOrientation && !bVertical) + auto orientation = mnOrientation; + if (bVertical) + orientation += 900_deg10; + if (orientation) { // Apply font rotation. - rRect.transform(basegfx::utils::createRotateB2DHomMatrix(-toRadians(mnOrientation))); + rRect.transform(basegfx::utils::createRotateB2DHomMatrix(-toRadians(orientation))); } if (mpFontCache) |