-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also open/save JSON UFOs #1017
Also open/save JSON UFOs #1017
Conversation
Hm. Maybe we want a (hard|optional) dep on |
d730add
to
dca67ca
Compare
hm maybe not for now. That will install not only cattrs but also orjson, which is a native dep.. They don't publish win32 wheels to PyPI for example, only win_amd64 (or fontmake CI windows runners currently test on win32 FWIW). |
a22711f
to
213c83f
Compare
in the end, I added an optional 'json' to |
958cedf
to
d8d2012
Compare
…option the old --save-ufo-as-zip is deprecated (hidden) and the new --ufo-structure option will supersede it
and always sort_keys=True so output is deterministic
orjson doesn't provide win32 (32-bit) python wheels for windows, only 64-bit (win_amd64). build from source takes total CI time to 5 min (from 2) so no good. I tried to only install 64-bit wheels but environment markers don't let me select what I want.
d8d2012
to
c426c7a
Compare
Fixes #859
EDIT(anthrotype):
This PR adds the ability to parse and dump UFOs serialized as JSON using ufoLib2. This is experimental and unofficial (not meant to be a replacement for UFO format!) and as such subject to change. Thus we do not recommended not to rely on this for long-term storage of font source data at the moment.
You can enable this by installing fontmake with the 'json' extra, e.g.
pip install fontmake[json]
(orfontmake[all]
which installs all the other extras including this). This will in turn install two additional ufoLib2 dependencies, i.e.cattrs
andorjson
. Onlycattrs
is strictly required for this feature to work, butorjson
makes (de)serialization much faster than pure-python built-injson
module (on CPython at least).Also note, the
--save-ufo-as-zip
option is deprecated (though it will continue to work) and replaced by a new--ufo-structure
option that defaults to "package" (.ufo), and can take two additional values "zip" (for .ufoz) and "json" for ufoLib2's json-flavored UFOs.