Class: Fontisan::Ufo::Contour

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#closedObject (readonly)

Returns the value of attribute closed.



9
10
11
# File 'lib/fontisan/ufo/contour.rb', line 9

def closed
  @closed
end

#pointsObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/fontisan/ufo/contour.rb', line 16

def closed?
  @closed
end

#open?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/fontisan/ufo/contour.rb', line 20

def open?
  !@closed
end

#point_countObject



24
25
26
# File 'lib/fontisan/ufo/contour.rb', line 24

def point_count
  @points.size
end