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 precision kwarg to GLIFPointPen.addPoint #8

Closed rrthomas closed 10 years ago

rrthomas commented 10 years ago

Needed for metapolator/metapolator#127

graphicore commented 10 years ago

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. 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. Components would need rounding, too, as well as their transformation matrix atrributes …) using the precision argument, which is what an author would most probably want, I think.

graphicore commented 10 years ago

I'll pull this change and schedule what I mentioned above as a task. So this is not blocking your task anymore. We'll later rewrite your changes in https://github.com/rrthomas/metapolator/commit/104b7510d54b8da80b2f51f02ac12a159aafd327#diff-6460c217c153fb1c97fd9985bd4750c1

Is that ok?

rrthomas commented 10 years ago

OK, thanks.