Closed monkeyiq closed 10 years ago
Did you test this? I made it possible to test the code using '$ npm test' in the current master one test is failing, however (despite of your pull request).
I don't want ufoJS to become a mess, so before merging API changes like this I wan't to have more control over quality. My target is still to have ufoJS 'very' compatible with RoboFab, so I'm not very keen for a change like this.
Do you know the python logger
module? If we had a solution like that, that would solve more than this specific problem, I'd be very very happy.
I will run the 'rpm test' for this (soon) and future ufoJS PRs before sending.
I haven't looked at python logger, I'll do that shortly and see if I can alter this PR based on that knowledge (and if there is a nodejs logger like library that we might like to then also use).
One key thing that I'll be looking for in the logger (nodejs version) is the ability for the logger to throw errors or tell the caller that a thing is fatal. For loading, the function validateAndMassagePointStructures() needs to be able to selectively either throw an exception (the default) or to try to continue with just a partial read.
This is replaced by https://github.com/graphicore/ufoJS/pull/16
throw an exception in such cases which should preserve the previous behavior.
For importing glyphs metapolator can set a different callback and allow the load to proceed beyond the failing glyph.
This is for metapolator issue https://github.com/metapolator/metapolator/issues/144