graphicore / ufoJS

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

Allow a callback to record glyphs which load badly. The default is to #12

Closed monkeyiq closed 10 years ago

monkeyiq commented 10 years ago

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

graphicore commented 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.

monkeyiq commented 10 years ago

I will run the 'rpm test' for this (soon) and future ufoJS PRs before sending.

monkeyiq commented 10 years ago

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).

monkeyiq commented 10 years ago

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.

monkeyiq commented 10 years ago

This is replaced by https://github.com/graphicore/ufoJS/pull/16