I copied the ReverseContourPointPen from the robofab.pens. I think it's useful for the Cu2QuPen to
have a `reverse_direction` argument which inverts the contours' winding direction. I didn't want to
add a dependency on robofab, since things are in transitions... We will add it to the future "penBox"
package (or whatever it'll be called) once that is set up.
It doesn't seem to be a good idea to round some points in a glyph but
not others. With this change, control points (which don't change)
that were equivalent to other non-curve points before conversion will
remain so. This can be significant when drawing with pen objects.
The rounding has been there since the initial commit; it's not clear
that it serves a purpose.
This is hopefully the last non-backwards-compatible API change. We
take a list of fonts in rf.fonts_to_quadratic so that we can spell out
its keyword arguments explicitly. Also, only one max error argument is
accepted.
Using built-in types (mostly tuples) seems to cut the running time
overall by about one half. Spelling out linear interpolation in the
bezier_at functions actually cuts the running time by another 10%,
but I'm not sure if it's worth it given that this code looks a bit
nicer.
I like this new order better, since max_err seems to be the more
important parameter, and it corresponds more closely with the actual
font object params (which can be lists) than max_n (which is always
a single value).
This should be more compatible between fonts with different UPM. In
fact, it should work within a single call with such fonts.
The default max error is now 0.0025 em, which is about 5 units for a
2048 UPM font.
There should be no changed functionality here. Just cleaning:
- Consistent variable naming style
- Consistent quote types for strings
- No lines over 80 characters
- At least some comment for every function
- Get rid of excessive error catching