Class: Ucode::Glyphs::LastResort::Glif::Outline
- Inherits:
-
Struct
- Object
- Struct
- Ucode::Glyphs::LastResort::Glif::Outline
- Defined in:
- lib/ucode/glyphs/last_resort/glif.rb
Overview
Parsed outline value object.
Instance Attribute Summary collapse
-
#advance ⇒ Object
Returns the value of attribute advance.
-
#contours ⇒ Object
Returns the value of attribute contours.
Instance Method Summary collapse
Instance Attribute Details
#advance ⇒ Object
Returns the value of attribute advance
44 45 46 |
# File 'lib/ucode/glyphs/last_resort/glif.rb', line 44 def advance @advance end |
#contours ⇒ Object
Returns the value of attribute contours
44 45 46 |
# File 'lib/ucode/glyphs/last_resort/glif.rb', line 44 def contours @contours end |
Instance Method Details
#bbox ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ucode/glyphs/last_resort/glif.rb', line 45 def bbox return nil if contours.empty? xs = [] ys = [] contours.each do |contour| contour.points.each do |point| xs << point.x ys << point.y end end return nil if xs.empty? { min_x: xs.min, min_y: ys.min, max_x: xs.max, max_y: ys.max } end |