Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

API overhaul #13

Open
behdad opened this issue Nov 24, 2015 · 3 comments
Open

API overhaul #13

behdad opened this issue Nov 24, 2015 · 3 comments

Comments

@behdad
Copy link
Contributor

behdad commented Nov 24, 2015

@anthrotype can you list what you needed from cu2qu that wasn't in the module already? I see you implemented a pen. Lets design the API we want for cu2qu, agree on it, and then make the change.

Cheers

@anthrotype
Copy link
Member

The current cu2qu (or its rf module) only works with RFonts, RGlyph, RSegment, etc. objects as defined in robofab.objectsRF.

We wanted to apply the cu2qu core algorithm (i.e. the one in cu2qu.geometry module) to any environment that supports the Robofab pen protocol, be it robofab.objectsFL for use in FontLab macros, or defcon for converting UFOs to quadratic from command line scripts.

I'm going to pull a request for our Cu2QuPen soon. This currently only works on single fonts, not on interpolat-able font collections (the project we used it for only has one font!). I'm thinking of adding a drawPoints method to the GlyphCollection class, but I'm not sure that would work yet.

I also believe, like @behdad suggested in another thread, that the shared, non-environment specific stuff could be located in the cu2qu.__init__ module (which is now empty), instead of being in a separate geometry module.

I see that @jamesgk has reintroduced the max_err argument specifying the tolerance in absolute font units (#12). That's good. We actually haven't found an use for the relative max_err_em yet, as most our fonts are designed on a fixed 1000 UPM grid. I gather you introduced that because you want to be able to specify the same relative error for fonts having different UPMs. That is fine for us as far as both absolute-unit and relative-to-UPM tolerance values are accepted.

@behdad
Copy link
Contributor Author

behdad commented Nov 26, 2015

I see that @jamesgk has reintroduced the max_err argument specifying the tolerance in absolute font units (#12). That's good. We actually haven't found an use for the relative max_err_em yet, as most our fonts are designed on a fixed 1000 UPM grid. I gather you introduced that because you want to be able to specify the same relative error for fonts having different UPMs. That is fine for us as far as both absolute-unit and relative-to-UPM tolerance values are accepted.

Yes, I wanted the default to be UPM-independent.

@jamesgk
Copy link
Contributor

jamesgk commented Dec 1, 2015

@anthrotype I also noticed this version of curve_to_quadratic: https://github.com/daltonmaag/scope-one/blob/master/tools/convert.py#L125 which returns the error, I think it makes sense to have that here in place of our version. Would you mind contributing just that for now (or I can do it if you'd like)?

I think we'd like to make curve/s_to_quadratic the only public method of the main cu2qu module, and not even have a Point class (it would just take in lists, see PR #15). Then you or I could work on adding a generalized pen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants