dia r4330 - in trunk: . plug-ins/python



Author: hans
Date: Tue Mar 24 12:36:49 2009
New Revision: 4330
URL: http://svn.gnome.org/viewvc/dia?rev=4330&view=rev

Log:
2009-03-24  Hans Breuer  <hans breuer org>

	* plug-ins/python/diastddia.py : almost finished, a bug left in Arc's 
	curve_distance calculation. Implemented the insane load/save property
	name mapping - bug #576468, implmented draw_text and draw_arc. Some 
	comments on bezier related file format weakness.



Modified:
   trunk/ChangeLog
   trunk/plug-ins/python/diastddia.py

Modified: trunk/plug-ins/python/diastddia.py
==============================================================================
--- trunk/plug-ins/python/diastddia.py	(original)
+++ trunk/plug-ins/python/diastddia.py	Tue Mar 24 12:36:49 2009
@@ -224,8 +224,36 @@
 		self._bezier("Beziergon", points, color, 1)
 
 	def draw_string (self, text, pos, alignment, color) :
-		pass #FIXME
-
+		self.oid = self.oid + 1
+		self.f.write('''
+    <dia:object type="Standard - Text" version="1" id="O%d">
+      <dia:attribute name="obj_pos">
+        <dia:point val="%.3f,%.3f"/>
+      </dia:attribute>
+      <dia:attribute name="text">
+        <dia:composite type="text">
+          <dia:attribute name="string">
+            <dia:string>#%s#</dia:string>
+          </dia:attribute>
+          <dia:attribute name="font">
+            <dia:font family="%s" style="%d"/>
+          </dia:attribute>
+          <dia:attribute name="height">
+            <dia:real val="%.3f"/>
+          </dia:attribute>
+          <dia:attribute name="color">
+            <dia:color val="%s"/>
+          </dia:attribute>
+          <dia:attribute name="alignment">
+            <dia:enum val="%d"/>
+          </dia:attribute>
+        </dia:composite>
+      </dia:attribute>
+      <dia:attribute name="valign">
+        <dia:enum val="3"/>
+      </dia:attribute>
+      </dia:object>''' % (self.oid, pos.x, pos.y, text, self.font.family, self.font.style, self.font_size,
+			self._rgb(color), alignment))
 	def draw_image (self, point, width, height, image) :
 		fname = image.filename
 		# do something better than absolute pathes



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]