diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-02 12:39:35 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-02 12:39:35 +0000 |
commit | 5116a6c26d520683987542c3e680bd4317ea7da2 (patch) | |
tree | 5256dd68206231964bbbb0685dcb9f7310aae62f /drawinglayer | |
parent | c48a05c77bfd377bc98e24cee8fc585b681d31a8 (diff) |
CWS-TOOLING: integrate CWS aw067_DEV300
2009-03-24 11:47:28 +0100 aw r269933 : #i100489# added missing support for proportional font scaling and DXArray preparation
2009-03-24 11:42:59 +0100 aw r269932 : #i100424# corrected handling of font scaling in renderer and tooling
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/textlayoutdevice.cxx | 3 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 30 |
2 files changed, 14 insertions, 19 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index ad97637761e9..b8f7d59e6f05 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 7904815f1eeb..2479891f58d6 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 |