Class Magick::RVG::Utility::DefaultTextStrategy
In: lib/rvg/misc.rb
Parent: TextStrategy
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 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

Handle "easy" text

Methods

render  

Public Instance methods

[Source]

     # File lib/rvg/misc.rb, line 319
319:                 def render(x, y, text)
320:                     @ctx.gc.text(x, y, enquote(text))
321:                     tm = @ctx.shadow.get_type_metrics(text)
322:                     dx = case @ctx.text_attrs.text_anchor
323:                             when :start
324:                                  tm.width
325:                             when :middle
326:                                  tm.width / 2
327:                             when :end
328:                                  0
329:                           end
330:                     [dx, 0]
331:                 end

[Validate]