summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-03-28 23:11:49 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-03-28 23:11:49 +0000
commitb0bc5900769742861a57b3200f25378a5d5138be (patch)
treec641716ac21b5f28e2a05284eedd4778605fbc69 /share
parentUpdate to trunk (diff)
parentFix for Bug #1161205 (Font substitution dialog appears when generic font fami... (diff)
downloadinkscape-b0bc5900769742861a57b3200f25378a5d5138be.tar.gz
inkscape-b0bc5900769742861a57b3200f25378a5d5138be.zip
Update to trunk
(bzr r11950.1.76)
Diffstat (limited to 'share')
-rwxr-xr-xshare/extensions/measure.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/share/extensions/measure.py b/share/extensions/measure.py
index a1ae00ce1..8aa940ed2 100755
--- a/share/extensions/measure.py
+++ b/share/extensions/measure.py
@@ -83,7 +83,10 @@ def csparea(csp):
bezarea += ( 3.0*sp[i-1][1][1] - 1.0*sp[i-1][2][1] - 2.0*sp[i][0][1] + 0.0*sp[i][1][1])*sp[i][1][0]
area += 0.15*bezarea
return abs(area)
-
+def appendSuperScript(node, text):
+ super = inkex.etree.SubElement(node, inkex.addNS('tspan', 'svg'), {'style': 'font-size:65%;baseline-shift:super'})
+ super.text = text
+
class Length(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
@@ -180,7 +183,11 @@ class Length(inkex.Effect):
new.set('startOffset', startOffset)
new.set('dy', str(dy)) # dubious merit
#new.append(tp)
- new.text = str(text)
+ if text[-2:] == "^2":
+ appendSuperScript(new, "2")
+ new.text = str(text)[:-2]
+ else:
+ new.text = str(text)
#node.set('transform','rotate(180,'+str(-x)+','+str(-y)+')')
node.set('x', str(x))
node.set('y', str(y))
@@ -193,7 +200,11 @@ class Length(inkex.Effect):
'font-weight': 'normal', 'font-style': 'normal', 'fill': '#000000'}
new.set('style', simplestyle.formatStyle(s))
new.set('dy', str(dy))
- new.text = str(text)
+ if text[-2:] == "^2":
+ appendSuperScript(new, "2")
+ new.text = str(text)[:-2]
+ else:
+ new.text = str(text)
node.set('x', str(x))
node.set('y', str(y))
node.set('transform', 'rotate(%s, %s, %s)' % (angle, x, y))