summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/import
diff options
context:
space:
mode:
authorjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-04-12 19:31:47 +0000
committerjghali <jghali@11d20701-8431-0410-a711-e3c959e3b870>2012-04-12 19:31:47 +0000
commitedaa5356a69507d02769dc9a69f32021e6e07ac3 (patch)
tree50bab49ec991e07f4eb5571394148cd134877be0 /scribus/plugins/import
parent07dd5acf87843f9f0c79bcf24c63ef5326739b10 (diff)
downloadscribus-edaa5356a69507d02769dc9a69f32021e6e07ac3.tar.gz
scribus-edaa5356a69507d02769dc9a69f32021e6e07ac3.tar.xz
scribus-edaa5356a69507d02769dc9a69f32021e6e07ac3.zip
svg import : store font size as a double + some minor refactoring
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17435 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/plugins/import')
-rw-r--r--scribus/plugins/import/svg/svgplugin.cpp26
-rw-r--r--scribus/plugins/import/svg/svgplugin.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/scribus/plugins/import/svg/svgplugin.cpp b/scribus/plugins/import/svg/svgplugin.cpp
index 40ff31c..abb11e0 100644
--- a/scribus/plugins/import/svg/svgplugin.cpp
+++ b/scribus/plugins/import/svg/svgplugin.cpp
@@ -1677,7 +1677,7 @@ QFont SVGPlug::getFontFromStyle(SvgStyle& style)
font.setOverline(overline);
font.setStrikeOut(strikeOut);
}
- font.setPointSizeF(style.FontSize / 10.0);
+ font.setPointSizeF(style.FontSize);
return font;
}
@@ -1760,30 +1760,30 @@ double SVGPlug::parseUnit(const QString &unit)
{
bool noUnit = false;
QString unitval=unit;
- if( unit.right( 2 ) == "pt" )
+ if (unit.right( 2 ) == "pt")
unitval.replace( "pt", "" );
- else if( unit.right( 2 ) == "cm" )
+ else if (unit.right( 2 ) == "cm")
unitval.replace( "cm", "" );
- else if( unit.right( 2 ) == "mm" )
+ else if (unit.right( 2 ) == "mm")
unitval.replace( "mm" , "" );
- else if( unit.right( 2 ) == "in" )
+ else if (unit.right( 2 ) == "in")
unitval.replace( "in", "" );
- else if( unit.right( 2 ) == "px" )
+ else if (unit.right( 2 ) == "px")
unitval.replace( "px", "" );
if (unitval == unit)
noUnit = true;
double value = ScCLocale::toDoubleC(unitval);
- if( unit.right( 2 ) == "pt" )
+ if (unit.right( 2 ) == "pt")
value = value;
- else if( unit.right( 2 ) == "cm" )
+ else if (unit.right( 2 ) == "cm")
value = ( value / 2.54 ) * 72;
- else if( unit.right( 2 ) == "mm" )
+ else if (unit.right( 2 ) == "mm")
value = ( value / 25.4 ) * 72;
- else if( unit.right( 2 ) == "in" )
+ else if (unit.right( 2 ) == "in")
value = value * 72;
- else if( unit.right( 2 ) == "px" )
+ else if (unit.right( 2 ) == "px")
value = value * 0.8;
- else if(noUnit)
+ else if (noUnit)
value = value;
return value;
}
@@ -2281,7 +2281,7 @@ void SVGPlug::parsePA( SvgStyle *obj, const QString &command, const QString &par
else if( command == "font-stretch" )
obj->FontStretch = params;
else if( command == "font-size" )
- obj->FontSize = static_cast<int>(parseFontSize(params) * 10.0);
+ obj->FontSize = parseFontSize(params);
else if( command == "text-anchor" )
obj->textAnchor = params;
else if( command == "text-decoration" )
diff --git a/scribus/plugins/import/svg/svgplugin.h b/scribus/plugins/import/svg/svgplugin.h
index f99e271..7dbcc92 100644
--- a/scribus/plugins/import/svg/svgplugin.h
+++ b/scribus/plugins/import/svg/svgplugin.h
@@ -153,7 +153,7 @@ public:
QString FontStyle;
QString FontWeight;
QString FontStretch;
- int FontSize;
+ double FontSize;
QString FillCol;
QString fillRule;
QString GCol1;