Class: Fontisan::Ufo::Contour
- Inherits:
-
Object
- Object
- Fontisan::Ufo::Contour
- Defined in:
- lib/fontisan/ufo/contour.rb
Overview
An ordered list of points forming one closed (or open) contour in a glyph's outline.
Instance Attribute Summary collapse
-
#closed ⇒ Object
readonly
Returns the value of attribute closed.
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
- #closed? ⇒ Boolean
-
#initialize(points = [], closed: true) ⇒ Contour
constructor
A new instance of Contour.
- #open? ⇒ Boolean
- #point_count ⇒ Object
Constructor Details
#initialize(points = [], closed: true) ⇒ Contour
Returns a new instance of Contour.
11 12 13 14 |
# File 'lib/fontisan/ufo/contour.rb', line 11 def initialize(points = [], closed: true) @points = points @closed = closed end |
Instance Attribute Details
#closed ⇒ Object (readonly)
Returns the value of attribute closed.
9 10 11 |
# File 'lib/fontisan/ufo/contour.rb', line 9 def closed @closed end |
#points ⇒ Object
Returns the value of attribute points.
8 9 10 |
# File 'lib/fontisan/ufo/contour.rb', line 8 def points @points end |
Instance Method Details
#closed? ⇒ Boolean
16 17 18 |
# File 'lib/fontisan/ufo/contour.rb', line 16 def closed? @closed end |
#open? ⇒ Boolean
20 21 22 |
# File 'lib/fontisan/ufo/contour.rb', line 20 def open? !@closed end |
#point_count ⇒ Object
24 25 26 |
# File 'lib/fontisan/ufo/contour.rb', line 24 def point_count @points.size end |