Class: Magick::RVG::TextBase

Inherits:
Object
  • Object
show all
Includes:
Duplicatable, Stylable
Defined in:
lib/rvg/text.rb

Overview

Base class for Tspan, Tref and Text.

Direct Known Subclasses

Text

Instance Method Summary collapse

Methods included from Duplicatable

#deep_copy

Methods included from Stylable

#styles

Instance Method Details

#d(x, y = 0) {|_self| ... } ⇒ Object

Add x and y to the current text position.

Yields:

  • (_self)

Yield Parameters:



37
38
39
40
41
# File 'lib/rvg/text.rb', line 37

def d(x, y = 0)
  @dx, @dy = Magick::RVG.convert_to_float(x, y)
  yield(self) if block_given?
  self
end

#rotate(degrees) {|_self| ... } ⇒ Object

Rotate the text about the current text position.

Yields:

  • (_self)

Yield Parameters:



44
45
46
47
48
# File 'lib/rvg/text.rb', line 44

def rotate(degrees)
  @rotation = Magick::RVG.convert_to_float(degrees)[0]
  yield(self) if block_given?
  self
end

#tspan(text, x = nil, y = nil) ⇒ Object

Create a new text chunk. Each chunk can have its own initial position and styles. If x and y are omitted the text starts at the current text position.



29
30
31
32
33
34
# File 'lib/rvg/text.rb', line 29

def tspan(text, x = nil, y = nil)
  tspan = Tspan.new(text, x, y)
  tspan.parent = self
  @tspans << tspan
  tspan
end