Package libavg :: Module avg :: Class Words

Class Words




A words node displays formatted text. Rendering is done by pango. All properties are set in pixels. International and multi-byte character sets are fully supported. Words nodes should use UTF-8 to encode international characters.

Instance Methods
 
getGlyphPos(i)
Returns the position of the glyph at byte index i in the layout.
 
getGlyphSize(i)
Returns the size of the glyph at byte index i in the layout.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Inherited from RasterNode
 
getBitmap()
Returns a copy of the bitmap that the node contains.
 
getOrigVertexCoords()
Returns the unwarped coordinate of all vertices as a list of lists.
 
getWarpedVertexCoords()
Returnes the current coordinate of all vertices as a list of lists.
 
setWarpedVertexCoords(grid)
Changes the current coordinates of all vertices.
    Inherited from Node
 
__eq__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
__ne__(...)
 
getAbsPos(relpos)
Transforms a position in coordinates relative to the node to a position in window coordinates.
 
getMediaSize()
Returns the size in pixels of the media in the node.
 
getParent()
Returns the container (AVGNode or DivNode) the node is in.
 
getRelPos(abspos)
Transforms a position in window coordinates to a position in coordinates relative to the node.
 
releaseEventCapture(cursorid)
Restores normal mouse operation after a call to setEventCapture().
 
setEventCapture(cursorid)
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position.
 
setEventHandler(type, source, pyfunc)
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs.
 
unlink()
Removes a node from it's parent container.
Static Methods
 
getFontFamilies(...)
 
getFontVariants(...)
Properties
  alignment
The paragraph alignment.
  color
The color of the text in standard html color notation: FF0000 is red, 00FF00 green, etc.
  font
The family name of the truetype font to use.
  indent
The indentation of the first line of the paragraph.
  linespacing
The number of pixels between different lines of a paragraph.
  parawidth
The width at which to word-wrap.
  rawtextmode
Sets whether the text should be parsed (False) or set as raw string (True).
  size
The font size in pixels.
  text
The string to display.
  variant
The variant (bold, italic, etc.) of the truetype font to use.

Inherited from object: __class__

    Inherited from RasterNode
  blendmode
The method of compositing the node with the nodes under it.
  maxtileheight
The maximum width and height of the tiles used for warping.
  maxtilewidth
The maximum width and height of the tiles used for warping.
    Inherited from Node
  active
If this attribute is true, the node behaves as usual.
  angle
The angle that the node is rotated to in radians.
  height
  id
A unique identifier that can be used to reference the node.
  opacity
A measure of the node's transparency.
  pivotx
x coordinate of the point that the node is rotated around.
  pivoty
y coordinate of the point that the node is rotated around.
  pos
The position of the node's top left corner relative to it's parent node.
  sensitive
A node only reacts to events if sensitive is true.
  width
  x
The position of the node's left edge relative to it's parent node.
  y
The position of the node's top edge relative to it's parent node.
Method Details

getGlyphPos(i)

 
Returns the position of the glyph at byte index i in the layout. The position is a Point2D, in pixels, and relative to the words node.
Returns:
pos

getGlyphSize(i)

 
Returns the size of the glyph at byte index i in the layout. The position is a Point2D, in pixels.
Returns:
pos


Property Details

alignment

The paragraph alignment. Possible values are 'left', 'center' and 'right'.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

color

The color of the text in standard html color notation: FF0000 is red, 00FF00 green, etc.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

font

The family name of the truetype font to use. This font must be installed in the system (for instance using the installfonts.sh script in the main libavg source directory) or available in a fonts/ subdirectory of the current directory.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

indent

The indentation of the first line of the paragraph.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

linespacing

The number of pixels between different lines of a paragraph.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

parawidth

The width at which to word-wrap.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

rawtextmode

Sets whether the text should be parsed (False) or set as raw string (True).
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

size

The font size in pixels. Fractional sizes are supported.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

text

The string to display. In the avg file, this is either the text attribute of the words node or the content of the words node itself. In the second case, the string can be formatted using the pango text attribute markup language described at http://developer.gnome.org/doc/API/2.0/pango/PangoMarkupFormat.html. Markup can also be used if the text is set using python. Markup parsing is controlled with 'parsetext' property
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)

variant

The variant (bold, italic, etc.) of the truetype font to use. To figure out which variants are available, use the showfonts utility under src/utils.
Get Method:
unreachable.<unnamed Boost.Python function>(...)
Set Method:
unreachable.<unnamed Boost.Python function>(...)