diff options
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 3 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 30 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 11 |
3 files changed, 24 insertions, 20 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 60df24c1e1..35f62a8c5c 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -325,7 +325,8 @@ namespace drawinglayer aRetval.SetOutline(rFontAttributes.getOutline()); #ifdef WIN32 - if(nWidth != nHeight) + // #100424# use higher precision + if(!basegfx::fTools::equal(fFontScaleX, fFontScaleY)) { // #i92757# // Removed the relative calculation with GetFontMetric() usage again. On diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index af61cefcf4..e0ad602819 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -169,31 +169,25 @@ namespace drawinglayer if(!basegfx::fTools::equal(aScale.getX(), aScale.getY())) { - // #i96581# font stretching is needed; examine how big the difference between X and Y scaling is - const double fPercent(fabs(1.0 - (aScale.getX() / aScale.getY()))); - static double fMaximumAcceptedPercent(0.05); - static bool bForceAdaption(false); - - if(bForceAdaption || fPercent > fMaximumAcceptedPercent) + // #100424# We have a hint on FontScaling here. To decide a look + // at the pure font's scale is needed, since e.g. SC uses unequally scaled + // MapModes (was: #i96581#, but use available full precision from primitive + // now). aTranslate and fShearX can be reused since no longer needed. + basegfx::B2DVector aFontScale; + double fFontRotate; + rTextCandidate.getTextTransform().decompose(aFontScale, aTranslate, fFontRotate, fShearX); + + if(!basegfx::fTools::equal(aFontScale.getX(), aFontScale.getY())) { - // #i96581# Need to adapt to a FontStretching bigger than acceptable maximum. - // Get font's real width using FontMetric and adapt font to stretched - // font - const FontMetric aFontMetric(mpOutputDevice->GetFontMetric(aFont)); - const double fRealFontWidth(aFontMetric.GetWidth()); - + // indeed a FontScaling. Set at Font. Use the combined scale + // and rotate here aFont = primitive2d::getVclFontFromFontAttributes( rTextCandidate.getFontAttributes(), - fRealFontWidth, + aScale.getX(), aScale.getY(), fRotate, *mpOutputDevice); } - else - { - // #i96581# less than allowed maximum (probably SC's generated MapModes). React - // pragmatically by ignoring the stretching up to this point - } } // handle additional font attributes diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b894b19073..4ca4e02c90 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -206,6 +206,10 @@ namespace false)); basegfx::B2DHomMatrix aNewTransform; + // #i100489# need extra scale factor for DXArray which collects all scalings + // which are needed to get the DXArray to unit coordinates + double fDXArrayScaleFactor(aSize.getX()); + // add font scale to new transform aNewTransform.scale(aSize.getX(), aSize.getY()); @@ -214,6 +218,10 @@ namespace { const double fFactor(rInfo.mrFont.GetPropr() / 100.0); aNewTransform.scale(fFactor, fFactor); + + // #i100489# proportional font scaling influences the DXArray, + // add to factor + fDXArrayScaleFactor *= fFactor; } // apply font rotate @@ -265,7 +273,8 @@ namespace if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen) { - const double fScaleFactor(basegfx::fTools::equalZero(aSize.getX()) ? 1.0 : 1.0 / aSize.getX()); + // #i100489# use fDXArrayScaleFactor here + const double fScaleFactor(basegfx::fTools::equalZero(fDXArrayScaleFactor) ? 1.0 : 1.0 / fDXArrayScaleFactor); aDXArray.reserve(rInfo.mnTextLen); for(xub_StrLen a(0); a < rInfo.mnTextLen; a++) |