RMagick 2.13.1: RVG Reference: RVG::Tspan Class

###### RMagick 2.13.1 User's Guide and Reference

# class RVG::Tspan < TextBase

## class methods

### new

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

#### 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 propagate 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

## 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

#### 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

#### Returns

self

### tspan

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

#### 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 propagate 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.