Cosimo Lupo
f02813bd54
[cu2qu/ufo] return set of modified glyph names from fonts_to_quadratic
...
In ufo2ft preProcessor, we need to know which specific glyphs were actually modified (converted to quadratic), in order to do other things while processing filters, not simply if the fonts were modified as a whole; thus, here I changed fonts_to_quadratic to return the set of modified glyph names instead of just True/False. The change is backward compatible because code that checks whether the returned value is True/False will continue to work since bool(set) is True for non-empty set, False for empty ones.
2024-03-04 12:11:09 +00:00
Behdad Esfahbod
990afce0db
[cu2qu] One more annotation
2023-04-22 12:37:12 -06:00
Behdad Esfahbod
027f644d12
[cu2qu] Micro-optimize cython code
...
By defining some core functions as cfunc, so they inline.
Almost 10% speedup.
2023-04-22 12:29:08 -06:00
Behdad Esfahbod
0cb46862e0
[cu2qu] Remove another division hack
2023-04-22 12:17:57 -06:00
Behdad Esfahbod
3470b7494a
[cu2qu] Remove old hack
...
Python3 optimizes const division, and Cython doesn't need it anyway.
2023-04-22 12:13:27 -06:00
Cosimo Lupo
0df4997661
prevent cython.compiled raise AttributeError if cython not properly installed
...
It's possible sometimes that 'import cython' does not fail but then 'cython.compiled' raises AttributeError.
It actually happened in our internal production environment...
Similar issue to https://github.com/pydantic/pydantic/pull/573 and https://github.com/ipython/ipython/issues/13294
2023-03-02 17:43:38 +00:00
Behdad Esfahbod
52a8e3b1a4
[cu2qu.ufo] Simplify logic
2023-02-22 10:14:53 -07:00
Behdad Esfahbod
690ffca963
[cu2qu.cli] Add --mixed
...
Untested.
2023-02-22 10:03:45 -07:00
Behdad Esfahbod
2a93984df4
[cu2qu.ufo] Black
2023-02-22 09:55:20 -07:00
Behdad Esfahbod
1f2a8b7d27
[cu2qu.ufo] Try to be smarter about "modified"
2023-02-22 09:51:59 -07:00
Behdad Esfahbod
c8b74fd6dc
[cu2qu.ufo] Add all_quadratic=True
2023-02-22 09:36:09 -07:00
Behdad Esfahbod
a21b71ef01
[cu2qu] Add all_quadratic=True parameter
...
If set to False, then either a single quadratic or a single cubic
is returned.
2023-02-21 13:14:01 -07:00
Behdad Esfahbod
fdc7714679
[cu2qu] Reduce benchmark conversion error
...
To match qu2cu's.
2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ff5d758b27
[cu2qu.benchmark] Remove unused parameter
2023-02-18 09:46:56 -07:00
Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Behdad Esfahbod
4669372b46
[cu2qu.benchmark] Document main()
2022-08-25 14:38:35 -06:00
Behdad Esfahbod
80033bb2a0
[cu2qu] Move benchmark code into cu2qu.benchmark module
2022-08-25 14:37:59 -06:00
Cosimo Lupo
0dc2f820bd
cu2qu/cli: latest ufoLib2 no longer does Font(path); must use Font.open(path)
...
https://github.com/fonttools/fonttools/runs/4211314586?check_suite_focus=true#step:5:598
2021-11-15 12:22:33 +00:00
Simon Cozens
ecc764ecc0
[docs] Document cu2qu library ( #1937 )
...
[docs] Document cu2qu library
Reorganise the documentation so that everything is in one place and users are more clearly pointed to the modules which are likely to be useful for their purposes. (I still think it’s worth having at least a brief reference to ``cu2qu.cli`` in there, as a way of reminding users that there is a command-line implementation.) Docstrings are provided for non-API methods where I could understand them - trusting these will be useful for future maintainers.
2020-05-15 10:53:41 +01:00
Simon Cozens
2cef07af80
[doc] Add help options to fonttools CLI ( #1920 )
...
This adds a `help` verb (and `--help` option) to the `fonttools` command line tool. Submodules will be listed in the help text if they have an importable `main` function with a docstring, and `main`'s docstring will be used as the one-line description for the help text.
2020-05-12 06:31:13 +01:00
Simon Cozens
eda4a2717e
Use Python3 inheritance style for super.___init__
...
Avoids cases where super() argument is not enclosing class: https://help.semmle.com/wiki/display/PYTHON/First+argument+to+super%28%29+is+not+enclosing+class
2020-05-07 21:09:20 +01:00
Cosimo Lupo
d91724d76c
Revert "[doc] Add help options to fonttools CLI"
2020-05-04 17:37:24 +01:00
Simon Cozens
02f23a214c
[doc] Add help options to fonttools CLI
2020-05-03 22:59:54 +01:00
Cosimo Lupo
7cc4c7eb46
cu2qu: clarify DEFAULT_MAX_ERR is relative to EM, Cu2QuPen.max_err is absolute
2020-04-06 13:12:37 +01:00
Cosimo Lupo
0dd76bb98c
cu2qu.cli: try use defcon if ufoLib2 is not installed
2020-04-03 16:58:01 +01:00
Cosimo Lupo
868348c9c0
cu2qu.cli: use multiProcessing.Pool.starmap
2020-04-03 16:45:47 +01:00
Cosimo Lupo
c4aeec87dc
use ufoLib2 for cu2qu.cli and tests
...
the tests are skipped if ufoLib2 is not installed.
2020-04-01 19:23:57 +01:00
Cosimo Lupo
76cc29dda4
cu2qu: fix up imports for cu2qu.ufo, cli, and related tests
2020-04-01 19:01:32 +01:00
Cosimo Lupo
71b254fcdb
Revert "cu2qu.errors: remove unused exceptions"
...
This reverts commit 2e51226dedc6a03f3de8a70220e52d0026cc0d95.
2020-04-01 18:49:12 +01:00
Cosimo Lupo
6ebc8249be
Move ufo.py, cli.py, __main__.py to fontTools/cu2qu
2020-04-01 18:46:48 +01:00
Cosimo Lupo
97941ad7a5
cu2qu: restore sub-package folder
2020-04-01 18:31:47 +01:00
Cosimo Lupo
3f414cdb08
cu2qu: remove sub-package, make single module
2020-03-31 13:42:18 +01:00
Cosimo Lupo
c2e8403937
cu2qu: remove from __future__ imports
2020-03-31 13:38:51 +01:00
Cosimo Lupo
00058833f2
Move cu2qu.pens to fontTools.pens.cu2quPen
2020-03-31 13:34:46 +01:00
Cosimo Lupo
080c565b5c
cu2qu: remove __version__ from cu2qu module
...
use fontTools own version now
2020-03-31 13:25:32 +01:00
Cosimo Lupo
5d5cddfc08
Replace cu2qu.cython shadow module with mock namespace
2020-03-31 13:23:19 +01:00
Cosimo Lupo
2e51226ded
cu2qu.errors: remove unused exceptions
2020-03-31 12:53:17 +01:00
Cosimo Lupo
731b4944a6
cu2qu: fix up imports
2020-03-31 12:48:51 +01:00
Cosimo Lupo
f9a3961c66
cu2qu: move all modules to Lib/fontTools/cu2qu
2020-03-31 12:32:50 +01:00