summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorVort <vvort@yandex.ru>2014-04-10 10:48:05 +0300
committerCaolán McNamara <caolanm@redhat.com>2014-04-11 11:13:52 +0000
commit54b8eb252a3380d9d6e3cec26463e7a257790651 (patch)
tree4be0c93d2f9eff68abf9bfb31e0a69b66b0543cc /sdext
parent213e95bb5bfd91e7946a540034cb6e2769c096cc (diff)
fdo#35064 PDF Import: Add support for simple text scaling
Change-Id: I81ff611f5f326c7ef97a75011cec4f4144d2cca4 Reviewed-on: https://gerrit.libreoffice.org/8916 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 98a677e142ee..723d0910b61d 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -908,9 +908,23 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< Element* >::co
aFontProps[ "fo:font-size" ] = aFSize;
aFontProps[ "style:font-size-asian" ] = aFSize;
aFontProps[ "style:font-size-complex" ] = aFSize;
+
// color
const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId );
- aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor );
+ aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor );
+
+ // scale
+ double fRotate, fShearX;
+ basegfx::B2DTuple aScale, aTranslation;
+ rGC.Transformation.decompose(aScale, aTranslation, fRotate, fShearX);
+ double textScale = -100 * aScale.getX() / aScale.getY();
+ if (((textScale >= 1) && (textScale <= 99)) ||
+ ((textScale >= 101) && (textScale <= 999)))
+ {
+ aBuf.append(textScale);
+ aBuf.appendAscii("%");
+ aFontProps[ "style:text-scale" ] = aBuf.makeStringAndClear();
+ }
StyleContainer::Style aStyle( "style:style", aProps );
StyleContainer::Style aSubStyle( "style:text-properties", aFontProps );