Behdad Esfahbod
6be1737965
[cython] Minor add inline
2018-10-06 21:07:13 +02:00
Cosimo Lupo
0f80ff7b2c
cu2qu: add a COMPILED flag to check if cu2qu is running in compiled/interpreted mode
2018-09-26 19:02:02 +01:00
Cosimo Lupo
73d3ce4bc1
cu2qu: add language_level=3 and define_macros to enable coverage
2018-09-26 19:02:02 +01:00
Cosimo Lupo
c13ce2faee
cu2qu: return float('NaN') instead of None so return val matches signature
...
Otherwise I get 'TypeError: must be real number, not NoneType' when running tests with
the compiled cu2qu extension module
2018-09-26 19:02:02 +01:00
Cosimo Lupo
337c302488
cli: add missing __future__ import absolute_import
2018-09-26 19:00:59 +01:00
Cosimo Lupo
672b446c89
move cu2qu/__init__py to cu2qu/cu2qu.py so we can make an optional Extension module
2018-09-26 19:00:59 +01:00
Cosimo Lupo
d37bbef646
use setuptools_scm for getting package version from git tags
2018-09-26 18:59:03 +01:00
Cosimo Lupo
1d2b159911
Add copy of Cython.Shadow as cu2qu.cython
2018-09-26 18:59:03 +01:00
Behdad Esfahbod
f85240f005
[cython] Remove a couple intermediates
2018-09-26 11:08:25 -04:00
Behdad Esfahbod
36d1b69d7e
[cython] More
2018-09-25 18:04:27 -04:00
Behdad Esfahbod
0c361f5cc4
[cython] Some more
2018-09-25 18:01:48 -04:00
Behdad Esfahbod
3efd0839a1
[cython] Add a few @cython.cfunc
2018-09-25 17:52:16 -04:00
Behdad Esfahbod
1f9c4a9e6b
[cython] Some more annotations
2018-09-25 17:29:08 -04:00
Behdad Esfahbod
ffdeb86420
Add cython shim
2018-09-25 17:21:54 -04:00
Behdad Esfahbod
f07bf0c266
[cython] Add some cython annotations
...
Compare:
Python:
behdad:cu2qu 0$ python __init__.py
curve_to_quadratic: 62.7us
curves_to_quadratic: 163.2us
Cython:
behdad:cu2qu 0$ cython --embed -a __init__.py && gcc __init__.c `python-config --cflags --libs` -O3 && ./a.out
curve_to_quadratic: 30.4us
curves_to_quadratic: 77.8us
Cython without this commit:
behdad:cu2qu 0$ cython --embed -a __init__.py && gcc __init__.c `python-config --cflags --libs` -O3 && ./a.out
curve_to_quadratic: 43.9us
curves_to_quadratic: 113.3us
So, 2x speedup compared to Python. 1.5x speedup compared to Cython without annotations.
More to be done.
2018-09-25 17:18:15 -04:00
Behdad Esfahbod
ed9da8db80
Add benchmarking to __init__
...
I haven't removed tools/benchmark.py. Probably should.
Also, improved the timeit parameters over benchmark.py.
2018-09-25 16:05:40 -04:00
Cosimo Lupo
81878eef6b
Bump version: 1.5.0 → 1.5.1.dev0
2018-04-11 12:01:33 +01:00
Cosimo Lupo
7e9043a61e
Release 1.5.0
2018-04-10 21:48:46 +01:00
Cosimo Lupo
5b59be68fb
Bump version: 1.4.1.dev0 → 1.5.0.dev0
2018-04-10 21:25:19 +01:00
Cosimo Lupo
ccdf7ad140
cli: add -e/--conversion-error and --keep-direction options
2018-04-10 21:24:15 +01:00
Cosimo Lupo
06c4d5973b
cli: minor
2018-04-10 21:04:05 +01:00
Cosimo Lupo
4a8b44356d
Add __main__.py to call cli.main() as 'python -m cu2qu'
2018-04-10 19:04:21 +01:00
Cosimo Lupo
ac8fdf7dc9
add cu2qu.cli module exporting a main() function for console script
...
requires defcon
2018-04-10 19:04:21 +01:00
Cosimo Lupo
0a2593b2c5
[cu2qu.ufo] remember the curve type in lib to skip converting twice
2018-04-10 18:22:32 +01:00
Cosimo Lupo
7064562174
Bump version: 1.4.0 → 1.4.1.dev0
2018-01-18 17:07:01 +00:00
Cosimo Lupo
dba25f6059
Release 1.4.0
2018-01-18 17:05:31 +00:00
Cosimo Lupo
ed9080df79
Bump version: 1.3.1.dev0 → 1.4.0.dev0
2018-01-18 16:55:50 +00:00
Cosimo Lupo
e07d582755
minor: prettify indentation of incompatible segments message
2018-01-18 16:53:47 +00:00
Cosimo Lupo
0b41ba3521
_set_segments must now handle 'curveTo' segments as well
...
since we let them pass now, and we only stop at the end
2018-01-18 14:33:49 +00:00
Cosimo Lupo
b627a778bf
Don't stop at first incompatibilty, log errors, raise at the end
...
Based on Miguel Sousa's original PR and the following discussion:
https://github.com/googlei18n/cu2qu/pull/114
Instead of raising an error at the first incompatible glyph, we
let it continue (keeping the original contours unmodified when
that happens), and use logging to print error messages.
A new `IncompatibleFontsError` exception is raised at the end of
`fonts_to_quadratic` if any glyph has incompatible number or types
of segments. The exception instance has a `glyph_errors` attribute
(dict) which collects all the individual IncompatibleGlyphsError
keyed by glyph name.
2018-01-18 13:21:08 +00:00
Cosimo Lupo
fbb41aeb1b
Bump version: 1.3.0 → 1.3.1.dev0
2017-10-31 19:57:57 +00:00
Cosimo Lupo
932d030d6f
Release 1.3.0
2017-10-31 19:57:00 +00:00
Cosimo Lupo
824a9d22bc
Bump version: 1.2.1.dev0 → 1.3.0.dev0
2017-10-31 19:43:56 +00:00
Cosimo Lupo
718228cb32
ufo: minor
...
No need to be verbose here. Message is never read anyway.
2017-10-31 19:10:35 +00:00
Cosimo Lupo
e648ef3f89
ufo: must scale max_err_em list by UPEM
...
When the 'max_err_em' argument is a float, we multiply it
by the font.info.unitsPerEm. However we were not doing it when
the argument is a list of floats...
2017-10-31 18:23:21 +00:00
Cosimo Lupo
fabada54b1
ufo: minor
...
_segments_to_quadratic is private, and always gets not-None 'stats' argument.
This if-branch is always true. Removed.
2017-10-31 18:22:56 +00:00
Cosimo Lupo
09c5856428
ufo: don't drop single points in GetSegmentsPen
...
We dropped robofab support. There is no reason to arbitrarily
drop any contour points. Anchors are handled as anchors in
latest ufoLib+defcon, also for UFO2. No more need to special-case.
2017-10-31 18:21:20 +00:00
Cosimo Lupo
6c22995a5f
pens: deprecate 'ignore_single_points' argument
...
This was needed for when we were supporting the old robofab.ufoLib
where anchors were represented as single-point-with-a-name contours.
With latest ufoLib, even when glif format is 1, anchors are
stored separately and are not drawn with pens (only proper contours
and components are passed on in the draw method).
So there is no longer need to special-case single points.
It's not the job of the cu2qu pens to filter those out.
2017-10-31 17:57:53 +00:00
Cosimo Lupo
9be3901795
move Lib/cu2qu/test to tests/ folder
...
There is no need to install the test suite with the package.
Let's put it outside like it's recommended by pytest.
2017-10-31 12:58:09 +00:00
Cosimo Lupo
af0a06081a
remove robofab imports
...
fonts_to_quadratic may still work with Robofab fonts, it's just
that the point pens will be imported from standalone ufoLib
2017-10-31 12:35:26 +00:00
Cosimo Lupo
4d07b533fc
Move benchmark.py and ufo_benchmark.py to tools/
...
These modules are only useful for development, should not be installed
with the library
2017-10-31 12:35:26 +00:00
Cosimo Lupo
df10cdea05
Use fonttools' ReverseContourPen
...
Fixes #51
2017-10-30 18:56:02 +00:00
Cosimo Lupo
c21ee24eec
[pens_test] fix test_stats test
...
This test would have failed with the incorrect count.
2017-10-25 19:05:40 +01:00
Cosimo Lupo
13abea3ca5
[pens] fix number of segments reported in stats
...
It appears we were reporting the 'stats' differently in the pens and
in the main ufo module.
https://github.com/googlei18n/cu2qu/blob/7a2f638/Lib/cu2qu/ufo.py#L148
You can git blame me, sorry.
Funny how it's been broken for almost two years :)
2017-10-25 18:49:19 +01:00
Behdad Esfahbod
7a2f6383e4
Simplify log message
2017-07-28 16:41:52 +01:00
Cosimo Lupo
a9f5d463ae
Bump version: 1.2.0 → 1.2.1.dev0
2017-05-24 19:16:46 +01:00
Cosimo Lupo
611512bd60
Release 1.2.0
2017-05-24 19:16:16 +01:00
Cosimo Lupo
815afa1a5a
Bump version: 1.1.2.dev0 → 1.2.0.dev0
2017-05-24 19:14:23 +01:00
Cosimo Lupo
153404077d
[pens] remove ReverseContourPointPen copy; import it from ufoLib (v2.1.0)
...
... or from robofab (I haven't tested the latter though)
2017-05-24 19:05:14 +01:00
Denis Moyogo Jacquerye
b1626bd0e8
Change the default approximation error from 0.0025 to 0.001
2017-05-23 16:09:48 +01:00