def load (self) :
		"""Load SVG attributes from XML attributes
		"""
		SVGElement.load(self)
		self._x = read_float(self.get_default("x","0") )
		self._y = read_float(self.get_default("y","0") )
		
		#read txt fragments
		self.clear()
		size = self.font_size()
		for txt,size in read_text_fragments(self.child(0),size) :
			self.add_text_fragment(txt,size)
		self.clear_children()
	def load (self) :
		"""Load SVG attributes from XML attributes
		"""
		SVGElement.load(self)
		if self.nodename() == "line" :
			x1 = read_float(self.get_default("x1","0") )
			y1 = read_float(self.get_default("y1","0") )
			x2 = read_float(self.get_default("x2","0") )
			y2 = read_float(self.get_default("y2","0") )
			self.move_to(x1,y1,False)
			self.line_to(x2,y2,False)
		elif self.nodename() in ("polyline","polygone") :
			raise NotImplementedError("polyline to path still need to be done :)")
		else :
			path_txt = self.get_default("d","")
			self.from_string(path_txt)
    def load(self):
        """Load SVG attributes from XML attributes
		"""
        SVGElement.load(self)
        self._width = read_float(self.get_default("width", "0"))
        self._height = read_float(self.get_default("height", "0"))
        # svg elements load
        for ind in xrange(self.nb_children()):
            try:
                svgelm = svg_element(self.child(ind))
                svgelm.from_node(self.child(ind))
                self.set_child(ind, svgelm)
                self._elms.append(svgelm)
                svgelm.load()
            except KeyError:
                pass
    def load(self):
        """Load SVG attributes from XML attributes
		"""
        SVGElement.load(self)
        self._width = read_float(self.get_default("width", "0"))
        self._height = read_float(self.get_default("height", "0"))
        #svg elements load
        for ind in xrange(self.nb_children()):
            try:
                svgelm = svg_element(self.child(ind))
                svgelm.from_node(self.child(ind))
                self.set_child(ind, svgelm)
                self._elms.append(svgelm)
                svgelm.load()
            except KeyError:
                pass
Beispiel #5
0
    def load(self):
        """Load SVG attributes from XML attributes
		"""
        SVGElement.load(self)
        if self.nodename() == "line":
            x1 = read_float(self.get_default("x1", "0"))
            y1 = read_float(self.get_default("y1", "0"))
            x2 = read_float(self.get_default("x2", "0"))
            y2 = read_float(self.get_default("y2", "0"))
            self.move_to(x1, y1, False)
            self.line_to(x2, y2, False)
        elif self.nodename() in ("polyline", "polygone"):
            raise NotImplementedError(
                "polyline to path still need to be done :)")
        else:
            path_txt = self.get_default("d", "")
            self.from_string(path_txt)