Class Magick::RVG::Text
In: lib/rvg/text.rb
Parent: TextBase
Enum GeometryValue Stylable RVG\n[lib/rvg/clippath.rb\nlib/rvg/container.rb\nlib/rvg/deep_equal.rb\nlib/rvg/describable.rb\nlib/rvg/embellishable.rb\nlib/rvg/misc.rb\nlib/rvg/paint.rb\nlib/rvg/pathdata.rb\nlib/rvg/rvg.rb\nlib/rvg/stretchable.rb\nlib/rvg/stylable.rb\nlib/rvg/text.rb\nlib/rvg/transformable.rb\nlib/rvg/units.rb] Transformable Stretchable Embellishable Describable Duplicatable Comparable Image ImageList Enumerable Geometry OptionalMethodArguments HatchFill Draw lib/RMagick.rb lib/rvg/misc.rb ObjectData Application Pre_ObjectData_Descriptor Envelope Post_ObjectData_Descriptor IPTC Magick dot/m_14_0.png

Methods

new   tref  

Public Class methods

Define a text string starting at [x, y]. Use the RVG::TextConstructors#text method to create Text objects in a container.

 container.text(100, 100, "Simple text").styles(:font=>'Arial')

Text objects can contain Tspan objects.

 container.text(100, 100).styles(:font=>'Arial') do |t|
    t.tspan("Red text").styles(:fill=>'red')
    t.tspan("Blue text").styles(:fill=>'blue')
 end

[Source]

     # File lib/rvg/text.rb, line 150
150:             def initialize(x=0, y=0, text=nil, &block)
151:                 @cx, @cy = Magick::RVG.convert_to_float(x, y)
152:                 super(text, &block)
153:             end

Public Instance methods

Reference a Tspan object. x and y are just like x and y in RVG::TextBase#tspan

[Source]

     # File lib/rvg/text.rb, line 157
157:             def tref(obj, x=nil, y=nil)
158:                 if ! obj.kind_of?(Tspan)
159:                     raise ArgumentError, "wrong argument type #{obj.class} (expected Tspan)"
160:                 end
161:                 obj = obj.deep_copy
162:                 obj.parent = self
163:                 tref = Tref.new(obj, x, y, self)
164:                 @tspans << tref
165:                 return tref
166:             end

[Validate]