module Magick::RVG::Stylable
def add_style_primitives(gc)
For each style that has a value, add a style primitive to the gc.
def add_style_primitives(gc) @styles.each_value do |style, value| if value.respond_to? :add_primitives value.add_primitives(gc, style) else gc.__send__(style, *value) end end end
def initialize
def initialize super @styles = Styles.new end
def styles(styles)
[:word_spacing] modify the spacing between words
[:text_decoration] 'none','underline','overline','line_through'
[:text_anchor] 'start','middle','end'
[:stroke_width] stroke width
[:stroke_opacity] the stroke opacity, 0.0<=N<=1.0
[:stroke_miterlimit] miter length constraint
[:stroke_linejoin] 'miter', 'round', 'bevel'
[:stroke_linecap] 'butt', 'round', 'square'
[:stroke_dashoffset] initial distance into dash pattern
[:stroke_dasharray] dash pattern (Array)
[:stroke] color name
[:opacity] both fill and stroke opacity, 0.0<=N<=1.0
[:letter_spacing] modify the spacing between letters
[:glyph_orientation_vertical] 0, 90, 180, 270
[:glyph_orientation_horizontal] 0, 90, 180, 270
a multiple of 100 between 100 and 900.
[:font_weight] 'normal','bold','bolder','lighter', or
[:font_style] 'normal','italic','oblique'
'expanded','extra_expanded','ultra_expanded'
'condensed','semi_condensed','semi_expanded',
[:font_stretch] 'normal','ultra_condensed','extra_condensed',
[:font_size] font size in points
[:font_family] font family name, ex. 'serif'
[:font] font name or font file name
[:fill_rule] 'evenodd' or 'nozero'
[:fill_opacity] the fill opacity, 0.0<=N<=1.0
[:fill] color name
[:clip_rule] 'evenodd' or 'nozero'
[:clip_path] clipping path defined by clip_path
[:baseline_shift] modify the text baseline
the hash keys. The style names and values are:
shape object. The argument is a hash. The style names are
This method can be used with any RVG, Group, Use, Text, or
def styles(styles) @styles.set(styles) yield(self) if block_given? self end