In addition to the methods listed above, this class also implements the styles method, the shape methods and the transform methods.
RVG::Pattern.new(width=0, height=0, x=0, y=0) [ { |pattern| drawing method calls } ] -> pattern
Creates a pattern that can be used with the :fill and :stroke styles.
Define the pattern in the associated block. The pattern can be composed of shapes, text, raster images, groups, and RVG objects. You can use the use method to include graphic objects in the pattern.
+m*width and
y+n*height offsets.
pattern.g [{|grp| ...}] -> group
Calls RVG::Group.new to construct a group and adds it to the pattern. Yields to a block if one is present, passing the new group as an argument.
Returns the new group, so RVG::Group methods can be chained to this method.
pattern.image(raster_image, width=nil, height=nil, x=0, y=0) -> image
Calls RVG::Image.new to construct an image and adds it to the pattern.
Returns the new image, so RVG::Image methods can be chained to this method.
pattern.preserve_aspect_ratio(align, meet_or_slice='meet') [{|self| ...}] -> self
If you use the viewbox method and the user coordinate system does not scale uniformly to the default coordinate system, use the
preserve_aspect_ratio method to specify whether or not the content is stretched to fit. If not, you can specify how to fit the content into
the space.
Preserve_aspect_ratio yields to a block if one is present, passing self as an argument.
meet_or_slice argument is 'meet' or 'slice', this argument controls the placement of the content within the
viewport. The align argument is the concatenation of an x-alignment and a y-alignment. The values are shown in these
lists:
See the RVG class example.
Self, so other RVG::Pattern methods can be chained to this method.
pattern.rvg(width, height, x=0, y=0) [{|new_rvg| ...}] -> pattern
This method constructs a new RVG object and adds it to the pattern. Each nested RVG object can use the
viewbox method to define its own coordinate system. The rvg method yields to a block, passing the nested
RVG object as an argument. Within the block, any drawing objects added to the nested RVG object are rendered within the nested RVG object's viewport.
See the example for
preserve_aspect_ratio in class RVG.
The RVG object, so other RVG methods can be chained to this method.
pattern.text(x=0, y=0, text=nil) [{|text| ...}] -> text
Calls RVG::Text.new to construct a text object and adds it to the pattern. Yields to a block if one is present, passing the new text object as an argument.
The RVG::Text object, so other RVG::Text methods can be chained to this method.
pattern.use(obj, x=0, y=0, width=nil, height=nil) -> use
Calls RVG::Use.new to constructs a use object and adds it to the pattern.
When the referenced argument is an RVG object,
width and height can be used to specify the width and height of the viewport. If present and non-nil,
these arguments override any width and height specified when the RVG object was created. You must specify the viewport size either when creating the RVG
object or when referencing it with use.
See RVG::Use.new
The RVG::Use object, so other RVG::Use methods can be chained to this method.
pattern.viewbox(min_x, min_y, width, height) [{|self| ...}] -> self
The area of the pattern is called the viewport. By default the origin of the coordinate system for an pattern is (0,0). The user coordinates
are pixels and the width and height are established by the width and height arguments to
RVG::Pattern.new.
Use the viewbox method to superimpose a user coordinate system on the viewport. The viewbox method lets you set up a
coordinate system using the units of your choice.
The viewbox method yields to a block if one is present, passing self as an argument.
See the example for the RVG class.
Self, so other RVG::Pattern methods may be chained to viewbox.