X-Git-Url: https://projects.mako.cc/source/yourule/blobdiff_plain/769e51f5d2f06c6e40a09378b9c127d21d65c8f5:/ruler.py..1711747333c7666b644f6124de39c49cd0b26526:/svgruler.py diff --git a/ruler.py b/svgruler.py similarity index 97% rename from ruler.py rename to svgruler.py index 39bcd3d..7c66050 100644 --- a/ruler.py +++ b/svgruler.py @@ -2,7 +2,7 @@ from __future__ import division import SVGdraw -class Ruler: +class SVGRuler: def __init__(self, scale=None, units=None, ruler_height=None, ruler_length=None): @@ -49,14 +49,14 @@ class Ruler: self.__drawline(0.3) self.__drawline(0.6) - self.svg.addElement(SVGdraw.text((self.point - font_height * 1.4), + self.svg.addElement(SVGdraw.text((self.point - font_height * 1.15), (self.ruler_height * 0.6 - 5), str(i + 1), font_height)) self.drawing.setSVG(self.svg) - def output(self): + def getxml(self): import cStringIO xml = cStringIO.StringIO() xml.write("\n")