class RSVGR::Text

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/rsvgr.rb, line 209
def initialize *args
  @x = 0.5
  @y = 0.5
  @size = 0.8
  @anchor = "middle"
  @baseline = "central"
  @fill_color = "black"
  @stroke_color = "none"
  super
end

Public Instance Methods

to_s() click to toggle source
# File lib/rsvgr.rb, line 219
def to_s
  "<text"                                                 +
  "#{" id=\"#{@id}\"" if @id}"                            +
  "#{" visibility=\"#{@visibility}\"" if @visibility}"    +
  " x=\"#{DEFAULT_SIZE * @x}\""                           +
  " y=\"#{DEFAULT_SIZE * @y}\""                           +
  " font-size=\"#{DEFAULT_SIZE * @size}\""                +
  " text-anchor=\"#{@anchor}\""                           +
  " dominant-baseline=\"#{@baseline}\""                   +
  " fill=\"#{@fill_color}\""                              +
  " stroke=\"#{@stroke_color}\""                          +
  # "#{" style=\"#{@style}\"" if @style}"                   +
  ">\n" + to_s_children + "</text>\n"
end