summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-05-26 11:37:44 +0000
committertavmjong-free <tavmjong@free.fr>2014-05-26 11:37:44 +0000
commitd2d46b5e9228a21330720e7c8ccce353ced02b72 (patch)
tree475870c57d1e2e55f9f27e79083d9648a98ab5e9
parentUpdate for working Win64 GDB (devlibs update required) (diff)
downloadinkscape-d2d46b5e9228a21330720e7c8ccce353ced02b72.tar.gz
inkscape-d2d46b5e9228a21330720e7c8ccce353ced02b72.zip
Convert from 90px to inch to 96px to inch per SVG (CSS) specification.
(bzr r13341.1.39)
-rwxr-xr-xshare/extensions/inkex.py4
-rw-r--r--share/ui/units.xml18
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp8
3 files changed, 15 insertions, 15 deletions
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index 947cb5b30..a8adfa43d 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -285,8 +285,8 @@ class Effect:
return 'px'
#a dictionary of unit to user unit conversion factors
- __uuconv = {'in':90.0, 'pt':1.25, 'px':1.0, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866,
- 'km':3543307.0866, 'pc':15.0, 'yd':3240.0 , 'ft':1080.0}
+ __uuconv = {'in':96.0, 'pt':1.33333333333, 'px':1.0, 'mm':3.77952755913, 'cm':37.7952755913,
+ 'm':3779.52755913, 'km':3779527.55913, 'pc':16.0, 'yd':3456.0 , 'ft':1152.0}
def unittouu(self, string):
'''Returns userunits given a string representation of units in another system'''
unit = re.compile('(%s)$' % '|'.join(self.__uuconv.keys()))
diff --git a/share/ui/units.xml b/share/ui/units.xml
index 69d78565d..802999003 100644
--- a/share/ui/units.xml
+++ b/share/ui/units.xml
@@ -12,55 +12,55 @@
<plural>pixels</plural>
<abbr>px</abbr>
<factor>1.00</factor>
- <description>CSS Pixels (90/inch)</description>
+ <description>CSS Pixels (96/inch)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>point</name>
<plural>points</plural>
<abbr>pt</abbr>
- <factor>1.25</factor>
+ <factor>1.3333333333</factor>
<description>PostScript points (72/inch)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>pica</name>
<plural>picas</plural>
<abbr>pc</abbr>
- <factor>15.0</factor>
+ <factor>16.0</factor>
<description>12 points</description>
</unit>
<unit type="LINEAR" pri="n">
<name>inch</name>
<plural>inches</plural>
<abbr>in</abbr>
- <factor>90.0</factor>
- <description>Inches (90 px/in)</description>
+ <factor>96.0</factor>
+ <description>Inches (96 px/in)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>millimeter</name>
<plural>millimeters</plural>
<abbr>mm</abbr>
- <factor>3.543307</factor>
+ <factor>3.77952755913</factor>
<description>Millimeters (25.4 mm/in)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>centimeter</name>
<plural>centimeters</plural>
<abbr>cm</abbr>
- <factor>35.43307</factor>
+ <factor>37.7952755913</factor>
<description>Centimeters (10 mm/cm)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>meter</name>
<plural>meters</plural>
<abbr>m</abbr>
- <factor>3543.307</factor>
+ <factor>3779.52755913</factor>
<description>Meters (100 cm/m)</description>
</unit>
<unit type="LINEAR" pri="n">
<name>foot</name>
<plural>feet</plural>
<abbr>ft</abbr>
- <factor>1080</factor>
+ <factor>1152</factor>
<description>Feet (12 in/ft)</description>
</unit>
<unit type="RADIAL" pri="y">
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index a384c7bde..da179bee0 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -87,11 +87,11 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
ir = new ImageResolution(uri);
}
if (ir && ir->ok()) {
- xscale = 900.0 / floor(10.*ir->x() + .5); // round-off to 0.1 dpi
- yscale = 900.0 / floor(10.*ir->y() + .5);
+ xscale = 960.0 / floor(10.*ir->x() + .5); // round-off to 0.1 dpi
+ yscale = 960.0 / floor(10.*ir->y() + .5);
} else {
- xscale = 90.0 / defaultxdpi;
- yscale = 90.0 / defaultxdpi;
+ xscale = 96.0 / defaultxdpi;
+ yscale = 96.0 / defaultxdpi;
}
width *= xscale;