CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

svgfig::Text Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def SVG

Public Attributes

 attr
 d
 x
 y

Static Public Attributes

dictionary defaults = {"stroke":"none", "fill":"black", "font-size":5}

Detailed Description

Draws at text string at a specified point in local coordinates.

x, y                   required      location of the point in local coordinates
d                      required      text/Unicode string
attribute=value pairs  keyword list  SVG attributes 

Definition at line 1834 of file svgfig.py.


Constructor & Destructor Documentation

def svgfig::Text::__init__ (   self,
  x,
  y,
  d,
  attr 
)

Definition at line 1847 of file svgfig.py.

01848                                      :
01849     self.x = x
01850     self.y = y
01851     self.d = str(d)
01852     self.attr = dict(self.defaults)
01853     self.attr.update(attr)


Member Function Documentation

def svgfig::Text::__repr__ (   self)

Definition at line 1844 of file svgfig.py.

01845                     :
01846     return "<Text %s at (%g, %g) %s>" % (repr(self.d), self.x, self.y, self.attr)

def svgfig::Text::SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 1854 of file svgfig.py.

01855                            :
01856     """Apply the transformation "trans" and return an SVG object."""
01857     if isinstance(trans, basestring): trans = totrans(trans)
01858 
01859     X, Y = self.x, self.y
01860     if trans != None: X, Y = trans(X, Y)
01861     return SVG("text", self.d, x=X, y=Y, **self.attr)


Member Data Documentation

Definition at line 1847 of file svgfig.py.

Definition at line 1847 of file svgfig.py.

dictionary svgfig::Text::defaults = {"stroke":"none", "fill":"black", "font-size":5} [static]

Definition at line 1842 of file svgfig.py.

Definition at line 1847 of file svgfig.py.

Definition at line 1847 of file svgfig.py.