class RVG::Tspan < TextBase

Table of Contents

class methods

instance methods

shared methods

In addition to the methods listed above, class RVG::Tspan also implements the styles method.

class methods

new

RVG::Tspan.new(text=nil, x=0, y=0) [ { |tspan| ...} ] -> aTspan

Description

This method may be invoked indirectly via the tspan method in RVG::Text.

Tspan objects are containers, so this method yields to a block if one is present. The only objects that a tspan can contain are other tspans. Styles defined on a tspan propogate to any tspans contained within it.

Arguments

All arguments are optional.

text
A string. If present, this string is drawn at the current text position. By default the string is positioned with the lower-left corner of the first glyph at the current text position. Use the :text_anchor style to override this behavior. After the string is rendered, the current text position is moved to the end of the string.
x, y
Specify a new current text position within the current user coordinate system.

Examples

tspan example

instance methods

d

tspan.d(dx[, dy=0]) [ { |self| ...} ] -> self

Description

The dx and dy arguments are added to the the current text position to form a new current text position. Yields to a block if one is present.

Arguments

dx, dy
The distance, in the user coordinate system, to be added to the current text position.

Example

tspan example 2

Returns

self

rotate

tspan.rotate(degrees) [ { |self| ...} ] -> self

Description

Rotates the text about the current text position by the specified number of degrees. Yields to a block if one is present.

Arguments

degrees
The amount of rotation

Example

tspan example 3

Returns

self

tspan

tspan.tspan(string=0, x=nil, y=0) [ { |tspan| ...} ] -> aTspan

Description

Calls RVG::Tspan.new to construct a tspan and adds it to the tspan. Yields to a block if one is present, passing the new tspan as an argument. Styles defined on the container tspan propogate to the contained tspan.

Arguments

string
A text string.
x, y
A new initial text position

Returns

The new tspan, so other RVG::Tspan methods can be chained to it.