Module: Fontisan::Ufo::Compile::Filters::ReverseContourDirection
- Defined in:
- lib/fontisan/ufo/compile/filters/reverse_contour_direction.rb
Overview
Reverses the point order in every contour. TrueType fonts use clockwise winding for outer contours (opposite of the PostScript/UFO convention). Applying this filter before TTF compilation ensures correct glyph rendering.
Class Method Summary collapse
-
.run(glyphs, **_opts) ⇒ Array<Fontisan::Ufo::Glyph>
The same array, mutated in place.
Class Method Details
.run(glyphs, **_opts) ⇒ Array<Fontisan::Ufo::Glyph>
Returns the same array, mutated in place.
15 16 17 18 19 20 21 22 |
# File 'lib/fontisan/ufo/compile/filters/reverse_contour_direction.rb', line 15 def self.run(glyphs, **_opts) glyphs.each do |glyph| glyph.contours.each do |contour| contour.points.reverse! end end glyphs end |