Module Magick::RVG::Stylable
In: lib/rvg/stylable.rb
Enum GeometryValue Stylable RVG\n[lib/rvg/clippath.rb\nlib/rvg/container.rb\nlib/rvg/deep_equal.rb\nlib/rvg/describable.rb\nlib/rvg/embellishable.rb\nlib/rvg/misc.rb\nlib/rvg/paint.rb\nlib/rvg/pathdata.rb\nlib/rvg/rvg.rb\nlib/rvg/stretchable.rb\nlib/rvg/stylable.rb\nlib/rvg/text.rb\nlib/rvg/transformable.rb\nlib/rvg/units.rb] Transformable Stretchable Embellishable Describable Duplicatable Comparable Image ImageList Array Geometry HatchFill Draw lib/RMagick.rb lib/rvg/units.rb Magick Module: Magick

This module is mixed into classes that can have styles.

Methods

Public Class methods

[Source]

    # File lib/rvg/stylable.rb, line 72
72:         def initialize
73:             super
74:             @styles = Styles.new
75:         end

Public Instance methods

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:

:clip_path
clipping path defined by clip_path
:clip_rule
‘evenodd’ or ‘nozero’
:fill
color name
:fill_opacity
the fill opacity, 0.0<=N<=1.0
:fill_rule
‘evenodd’ or ‘nozero’
:font
font name or font file name
:font_family
font family name, ex. ‘serif’
:font_size
font size in points
:font_stretch
‘normal’,’ultra_condensed’,’extra_condensed’, ‘condensed’,’semi_condensed’,’semi_expanded’, ‘expanded’,’extra_expanded’,’ultra_expanded‘
:font_style
‘normal’,’italic’,’oblique’
:font_weight
‘normal’,’bold’,’bolder’,’lighter’, or a multiple of 100 between 100 and 900.
:opacity
both fill and stroke opacity, 0.0<=N<=1.0
:stroke
color name
:stroke_dasharray
dash pattern (Array)
:stroke_dashoffset
initial distance into dash pattern
:stroke_linecap
‘butt’, ‘round’, ‘square’
:stroke_linejoin
‘miter’, ‘round’, ‘bevel’
:stroke_miterlimit
miter length constraint
:stroke_opacity
the stroke opacity, 0.0<=N<=1.0
:stroke_width
stroke width
:text_anchor
‘start’,’middle’,’end’
:text_decoration
‘none’,’underline’,’overline’,’line_through‘

[Source]

     # File lib/rvg/stylable.rb, line 107
107:         def styles(styles)
108:             @styles.set(styles)
109:             yield(self) if block_given?
110:             self
111:         end

Private Instance methods

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.

[Source]

    # File lib/rvg/stylable.rb, line 62
62:         def add_style_primitives(gc)
63:             @styles.each_value do |style, value|
64:                 if value.respond_to? :add_primitives
65:                     value.add_primitives(gc, style)
66:                 else
67:                     gc.__send__(style, *value)
68:                 end
69:             end
70:         end

[Validate]