graphicore / ufoJS

Javascript API for the Unified Font Object
lib.ufojs.org
GNU General Public License v3.0
52 stars 10 forks source link

Add optional precision argument to Glyphset.writeGlyph, the writeGlyph Module and the Contructor of GLIFPointPen #9

Closed graphicore closed 10 years ago

graphicore commented 10 years ago

see #8

The relevant part:

I'm tempted to add precision as optional argument to GlyphSet.writeGlyph, the GlifLib/writeGlyph module and the Constructor of GLIFPointPen

Because then, we would only have to do this._glyphSet.writeGlyph(false, glyph.id, ufoData, drawFunc, {precision: precision}) in ExportController.js (of metapolator). Which seems to me like the intended behavior, to round all points in a glyph. If it is useful to round only specific points, this proposal is not good of course.

Adding precision to writeGlyph would also enable us to round the coordinates of guidelines (and anchors and the transformation matrix attributes of Components need rounding, too, more ?) using the precision argument, which is what an author would most probably want.