Class: Magick::RVG::Utility::DefaultTextStrategy
- Inherits:
-
TextStrategy
- Object
- TextStrategy
- Magick::RVG::Utility::DefaultTextStrategy
- Defined in:
- lib/rvg/misc.rb
Overview
Handle "easy" text
Instance Method Summary collapse
Methods inherited from TextStrategy
#glyph_metrics, #initialize, #render_glyph, #shift_baseline, #text_rel_coords
Constructor Details
This class inherits a constructor from Magick::RVG::Utility::TextStrategy
Instance Method Details
#render(x, y, text) ⇒ Object
278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/rvg/misc.rb', line 278 def render(x, y, text) @ctx.gc.text(x, y, 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 |