This module is mixed into classes that can have styles.
This method can be used with any RVG, Group, Use, Text, or shape object. The argument is a hash. The style names are the hash keys. The style names and values are:
modify the text baseline
clipping path defined by clip_path
‘evenodd’ or ‘nozero’
color name
the fill opacity, 0.0<=N<=1.0
‘evenodd’ or ‘nozero’
font name or font file name
font family name, ex. ‘serif’
font size in points
‘normal’,’ultra_condensed’,’extra_condensed’, ‘condensed’,’semi_condensed’,’semi_expanded’, ‘expanded’,’extra_expanded’,’ultra_expanded‘
‘normal’,’italic’,’oblique’
‘normal’,’bold’,’bolder’,’lighter’, or a multiple of 100 between 100 and 900.
0, 90, 180, 270
0, 90, 180, 270
modify the spacing between letters
both fill and stroke opacity, 0.0<=N<=1.0
color name
dash pattern (Array)
initial distance into dash pattern
‘butt’, ‘round’, ‘square’
‘miter’, ‘round’, ‘bevel’
miter length constraint
the stroke opacity, 0.0<=N<=1.0
stroke width
‘start’,’middle’,’end’
‘none’,’underline’,’overline’,’line_through‘
modify the spacing between words
‘lr-tb’, ‘lr’, ‘rt-tb’, ‘rl’, ‘tb-rl’, ‘tb’
# File lib/rvg/stylable.rb, line 114 114: def styles(styles) 115: @styles.set(styles) 116: yield(self) if block_given? 117: self 118: end
For each style that has a value, add a style primitive to the gc. Use splat to splat out Array arguments such as stroke_dasharray.
# File lib/rvg/stylable.rb, line 63 63: def add_style_primitives(gc) 64: @styles.each_value do |style, value| 65: if value.respond_to? :add_primitives 66: value.add_primitives(gc, style) 67: else 68: gc.__send__(style, *value) 69: end 70: end 71: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.