Kaydet (Commit) 54b8eb25 authored tarafından Vort's avatar Vort Kaydeden (comit) Caolán McNamara

fdo#35064 PDF Import: Add support for simple text scaling

Change-Id: I81ff611f5f326c7ef97a75011cec4f4144d2cca4
Reviewed-on: https://gerrit.libreoffice.org/8916Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 213e95bb
...@@ -908,9 +908,23 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< Element* >::co ...@@ -908,9 +908,23 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< Element* >::co
aFontProps[ "fo:font-size" ] = aFSize; aFontProps[ "fo:font-size" ] = aFSize;
aFontProps[ "style:font-size-asian" ] = aFSize; aFontProps[ "style:font-size-asian" ] = aFSize;
aFontProps[ "style:font-size-complex" ] = aFSize; aFontProps[ "style:font-size-complex" ] = aFSize;
// color // color
const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); 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 aStyle( "style:style", aProps );
StyleContainer::Style aSubStyle( "style:text-properties", aFontProps ); StyleContainer::Style aSubStyle( "style:text-properties", aFontProps );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment