summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-02 12:39:35 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-02 12:39:35 +0000
commitb831bef8040bfce1747e0d24f69e6747541d3f9d (patch)
tree28079f644e02173f02ba6d94918885cf89f27673 /drawinglayer
parent11d042202d3df52a68c26126c1c0854366f80cd7 (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.cxx3
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx30
2 files changed, 14 insertions, 19 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