diff options
author | Herbert Duerr <hdu@openoffice.org> | 2007-02-14 13:41:13 +0000 |
---|---|---|
committer | Herbert Duerr <hdu@openoffice.org> | 2007-02-14 13:41:13 +0000 |
commit | 597e5c5515724b53f291f3fee4543d0d18b54e91 (patch) | |
tree | b47a83f4b35a9afe82296b32cf7d77f90b529e25 /drawinglayer | |
parent | d70a7d2bf898a2c08ffa8d7b6d4bee0bef560fbd (diff) |
#i73860# if just getting outlines the unrotated VCL fonts suffice
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/textprimitive2d.cxx | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index 387a98b41981..63f1ded7cf1a 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -4,9 +4,9 @@ * * $RCSfile: textprimitive2d.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: hdu $ $Date: 2007-01-25 12:15:23 $ + * last change: $Author: hdu $ $Date: 2007-02-14 14:41:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -151,47 +151,30 @@ namespace drawinglayer ::std::vector< sal_Int32 > aNewIntegerDXArray; getIntegerDXArray(aNewIntegerDXArray); - // get outlines + // prepare transformation matrices + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + getTextTransform().decompose(aScale, aTranslate, fRotate, fShearX); + basegfx::B2DHomMatrix aUnscaledTransform; + aUnscaledTransform.rotate( fRotate ); + aUnscaledTransform.shearX( fShearX ); + aUnscaledTransform.translate( aTranslate.getX(), aTranslate.getY() ); + basegfx::B2DHomMatrix aUnrotatedTransform = getTextTransform(); + aUnrotatedTransform.rotate( -fRotate ); + + // prepare textlayoutdevice TextLayouterDevice aTextLayouter; - aTextLayouter.setFontAttributes(getFontAttributes(), getTextTransform()); + aTextLayouter.setFontAttributes(getFontAttributes(), aUnrotatedTransform ); + // get the text outlines basegfx::B2DPolyPolygonVector aB2DPolyPolyVector; aTextLayouter.getTextOutlines( aB2DPolyPolyVector, getText(), 0L, getText().Len(), aNewIntegerDXArray); - // get result count + // create primitives for the outlines const sal_uInt32 nCount = aB2DPolyPolyVector.size(); if( nCount ) { - // outlines already have scale and rotate included, so build new transformation - basegfx::B2DVector aScale, aTranslate; - double fRotate, fShearX; - getTextTransform().decompose(aScale, aTranslate, fRotate, fShearX); - basegfx::B2DHomMatrix aNewTransform; - const bool bShearUsed(!basegfx::fTools::equalZero(fShearX)); - const bool bRotateUsed(!basegfx::fTools::equalZero(fRotate)); - - if(bShearUsed) - { - // The order would be wrong when just adding shear, - // so rotate back, apply shear, rotate again - if(bRotateUsed) - { - aNewTransform.rotate(-fRotate); - } - - // add shear (before rotate) - aNewTransform.shearX(fShearX); - - if(bRotateUsed) - { - aNewTransform.rotate(+fRotate); - } - } - - // add translation - aNewTransform.translate(aTranslate.getX(), aTranslate.getY()); - // prepare retval Primitive2DSequence aRetval(nCount); @@ -199,7 +182,7 @@ namespace drawinglayer { // prepare polygon basegfx::B2DPolyPolygon& rPolyPolygon = aB2DPolyPolyVector[a]; - rPolyPolygon.transform(aNewTransform); + rPolyPolygon.transform(aUnscaledTransform); // create primitive const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(rPolyPolygon, getFontColor())); |