fix-vf-meta 'unrecognized arguments' when run
I'm trying to use fix-vf-meta on some variable font TTFs.
I'm using this on a simplified build script for Libre Caslon, and trying to move it into a script for another family, as well.
However, I get the following error when I run it:
gftools: error: unrecognized arguments: ../fonts/LibreCaslonText-Roman-VF.ttf
Similarly, if I am not in a shell script, and just use the command by itself, I get the same error. Here's the actual full response:
Similarly, if I skip the whole build script and just try to run fix-vf-meta on its own, I get the following:
$ | gftools fix-vf-meta variable_ttf/EncodeSans-Condensed-VF.ttf
----------------------------------------------------------------
o-o o o--o
o | | o
| o-o o-o o-o o-o o o-o o-o o-o o-o -o- o-o
o | | | | | | | | |-' | | | | | | \
o-o o-o o-o o-o o o-o o o-o o o o- o-o
| Tools - Version 0.2.0
o-o
Basic command examples:
gftools compare-font font1.ttf font2.ttf
gftools compare-font --help
gftools --version
gftools --help
usage: gftools [-h] [--list-subcommands] [--version] subcommand
gftools: error: unrecognized arguments: variable_ttf/EncodeSans-Condensed-VF.ttf
Steps taken so far
I've pulled the latest version of the repo into my virtualenv /lib/python3.6/gftools, then did a pip install -e .
I also pip installed a couple of dependencies it was saying it needed. However, gftools --list-subcommands doesn't include this, despite the file being in the lib repo, and now the /bin as well (I think that's where it goes when installed?)
This might just be an installation error on my part, so hopefully posting it here will help another person down the line. Any insight would be greatly appreciated!
If it's relevant, here's what happens if I try to list subcommands:
$ | gftools --list-subcommands
----------------------------------------------------------------
test-gf-coverage check-bbox fix-gasp varfont-info list-widthclass check-copyright-notices dump-names fix-cmap build-font2ttf list-weightclass check-name add-font build-ofl check-category check-vtt-compatibility namelist family-html-snippet qa metadata-vs-api fix-ttfautohint list-panose list-italicangle check-font-version fix-glyph-private-encoding space-check font-weights-coverage fix-glyphs check-gf-github fix-vendorid fix-vertical-metrics rangify find-features fix-fsselection update-nameidsupdate-version unicode-names what-subsets fix-dsig compare-font ots build-vf fix-fstype nametable-from-filename fix-nonhinting list-variable-source fix-familymetadata update-families fix-nameids sanity-check font-diff ttf2cp fix-ascii-fontmetadata
(Notably, fix-vf-meta is not included in the output subcommands.)
Steps to solve:
- set up a fresh python3 virtual environment, this time in the project folder itself
virtualenv -p python3 my_virtualenv
and activate it
source my_virtualenv/bin/activate
(more info on virtualenv here)
- install gftools from github with
pip install git+https://github.com/googlefonts/gftools --no-cache-dir
- I was then getting another error:
pkg_resources.DistributionNotFound: The 'gfdiffbrowsers' distribution was not found and is required by gftools. I got past this with:
pip install git+https://github.com/googlefonts/diffbrowsers --no-cache-dir
I also had to copy my vf-autohint executable file from my original virtualenv /bin into the new one,
and get past ImportError: No module named ufoLib.pointPen with pip install ufoLib --no-cache
but those were solving the separate issues that came from just moving to a new env.
@thundernixon Let's keep this open and fix everything that was initially confusing before closing the issue. At the very least it should be in gftools --list-subcommands and have usage example available when gftools fix-vf-meta --help is run. For example, gftools add-font --help produces a simple users manual for that tool.
agree with Eli on this.
As a starting point, this gftools should be pip installable for py3. @eliheuer is this something you could work on?
This means we won't need to do pip install git+https://github.com/googlefonts/gftools
Sure, I'll look at fixing this. I just need to figure out the Orbitron avar thing I was talking to Marc about today first.
I can't tell if this is similar enough to include here or if it should go elsewhere, but after cloning the gftools repo to do a pip install -e . in the same virtual environment, I got a ContextualVersionConflict error when trying to run the add-font tool:
$ gftools add-font ~/Users/stephennixon/type-repos/google-font-repos/fonts/ofl/signika/Signika-Light.ttf
---------------------------------------------------------------
Traceback (most recent call last):
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
needed = self.resolve(parse_requirements(requirements))
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Pillow 5.4.1 (/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages), Requirement.parse('Pillow==5.3.0'), {'fontdiffenator'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/bin/gftools", line 4, in <module>
__import__('pkg_resources').require('gftools==0.2.0')
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
@_call_aside
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
f(*args, **kwargs)
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
return cls._build_from_requirements(__requires__)
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (Pillow 5.4.1 (/Users/stephennixon/type-repos/google-font-repos/signika-for-google/virtual_env/lib/python3.6/site-packages), Requirement.parse('Pillow==5.3.0'), {'fontdiffenator'})
I tried to pip uninstall gftools, then repeat the pip install -e ., but ended up with the same error.
@thundernixon Run add-font on a directory containing fonts, not an actual font. Upgrading Pillow in fontdiffenator should solve this. Let me make a pr.
Ran into a similar issue just now, and had to use pip install --upgrade Pillow==5.3.0 to upgrade my Pillow version. This got the dsig working as expected.
Sounds like someone needs to add pillow to https://github.com/googlefonts/gftools/blob/master/requirements.txt
gftools: error: unrecognized arguments: ../fonts/LibreCaslonText-Roman-VF.ttf
I get the same result after deactivating the virtualenv with gftools. Works when the environment is activated.
@alexeiva Reinstall gftools in the following manner pip install git+https://github.com/googlefonts/gftools we don't have it on pypi for py3 yet
This subcommand has been removed https://github.com/googlefonts/gftools/pull/501.