class Magick::RVG::Utility::DefaultTextStrategy

Handle “easy” text

Public Instance Methods

render(x, y, text) click to toggle source
# File lib/rvg/misc.rb, line 300
def render(x, y, text)
  @ctx.gc.text(x, y, enquote(text))
  tm = @ctx.shadow.get_type_metrics(text)
  dx = case @ctx.text_attrs.text_anchor
      when :start
         tm.width
      when :middle
         tm.width / 2
      when :end
         0
      end
  [dx, 0]
end