textorientation

# Text Orientation (To) module

class vcs.textorientation.To(To_name, To_name_src='default')[source]

The (To) Text Orientation lists text attribute set names that define the font, spacing, expansion, and color index.

This class is used to define an text orientation table entry used in VCS, or it can be used to change some or all of the text orientation attributes in an existing text orientation table entry.

Useful Functions:
# VCS Canvas Constructor
a=vcs.init()
# Show predefined text orientation objects
a.show('textorientation')
# Updates the VCS Canvas at user's request
a.update()
Make a canvas object to work with:
a=vcs.init()
Create a new instance of text orientation:
# Copies content of '7left' to 'new'
to=a.createtextorientation('new','7left')
# Copies content of 'default' to 'new'
to=a.createtextorientation('new')
Modify an existing textorientation:
to=a.gettextorientation('7left')
Overview of textorientation attributes:
  • Listing the attributes:

    # Will list all the textorientation attribute values
    to.list()
    
  • Specify the text height:

    # The height value must be an integer
    to.height=20
    
  • Specify the text angle:

    # The angle value must be in the range 0 to 360
    to.angle=0
    
  • Specify the text path:

    # Same as to.path=0
    to.path='right'
    # Same as to.path=1
    to.path='left'
    # Same as to.path=2
    to.path='up'
    # Same as to.path=3
    to.path='down'
    
  • Specify the text horizontal alignment:

    # Same as to.halign=0
    to.halign='right'
    # Same as to.halign=1
    to.halign='center'
    # Same as to.halign=2
    to.halign='right'
    
  • Specify the text vertical alignment:

    # Same as tovalign=0
    to.valign='top'
    # Same as tovalign=1
    to.valign='cap'
    # Same as tovalign=2
    to.valign='half'
    # Same as tovalign=3
    to.valign='base'
    # Same as tovalign=4
    to.valign='bottom'
    
list()[source]

Lists the current values of object attributes

Example
>>> a=vcs.init()
>>> obj=a.gettextorientation() # default
>>> obj.list() # print textorientation attributes
---------- ... ----------
...
script(script_filename=None, mode=None)[source]

Saves out a copy of the textorientation secondary method, in JSON or Python format to a designated file.

Note

If the the filename has a ‘.py’ at the end, it will produce a Python script. If no extension is given, then by default a .json file containing a JSON serialization of the object’s data will be produced.

Warning

VCS Scripts Deprecated. SCR script files are no longer generated by this function.

Example
>>> a=vcs.init()
>>> ex=a.gettextorientation()
>>> ex.script('filename.py') # append to 'filename.py'
>>> ex.script('filename','w') # make/overwrite 'filename.json'
Parameters
  • script_filename (str) – Output name of the script file. If no extension is specified, a .json object is created.

  • mode (str) – Either ‘w’ for replace, or ‘a’ for append. Defaults to ‘a’, if not specified.