Class: Text2Path::SvgPath

Inherits:
Savage::Path show all
Defined in:
lib/text2path/svg_path.rb

Overview

specification: www.w3.org/TR/SVG/paths.html#PathElement

Attributes:

d
transform (not implemented)
pathLength (not implemented)

Instance Attribute Summary

Attributes inherited from Savage::Path

#subpaths

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Savage::Path

#closed?, #directions, #initialize, #move_to, #to_command, #transform

Methods included from Savage::Transformable

#rotate, #scale, #skew_x, #skew_y, #transform, #translate

Methods included from Savage::DirectionProxy

included

Methods included from Savage::Utils

#bool_to_int

Constructor Details

This class inherits a constructor from Savage::Path

Class Method Details

.parse(str) ⇒ Object



16
17
18
19
20
# File 'lib/text2path/svg_path.rb', line 16

def parse( str )
  Savage::Parser.parse( str ).tap do |p|
    yield p if block_given?
  end
end

Instance Method Details

#advance(dx = 0, dy = 0) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/text2path/svg_path.rb', line 23

def advance( dx=0, dy=0 )
  subpaths.each do |p|
    #p.move_to dx, dy
    p.directions.each do |dir|
    end
  end
end