Skip to content
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

Build failure with error "No module named 'fontFeatures.pathUtils'" #121

Open
MattMatic opened this issue May 16, 2024 · 3 comments
Open

Comments

@MattMatic
Copy link

MattMatic commented May 16, 2024

Building Gulzar fails with the error: No module named 'fontFeatures.pathUtils'

It seems that fontFeatures.pathUtils was available in fontFeatures v1.7.4 & 1.7.3, but is no longer in 1.8.0.

Fresh install under WSL with Win11.

@MattMatic
Copy link
Author

MattMatic commented May 16, 2024

Partial solution is to activate the venv environment, and manually install fontFeatures 1.7.4

  • source venv/bin/activate
  • pip install fontFeatures==1.7.4
  • deactivate

Although the build progresses, there are additional errors - any clues would be helpful!

. venv/bin/activate; fez2fea --omit-gdef -O0 sources/build/Gulzar.glyphs sources/build/fez/anchor-attachment.fez > sources/build/fea/anchor-attachment.fea
# Bad callback in verb LoadAnchors
# Bad callback in verb AddSpacedAnchors
# Bad callback in verb QuantizeAnchors
# top, True
# Old TE schema detected
100%|█...█| 12590/12590 [00:00<00:00, 53844.02it/s]
# At top, fixed 3850/4041 collisions
# bottom, False
100%|█...█| 50092/50092 [00:00<00:00, 79994.96it/s]
# At bottom, fixed 11880/13413 collisions
# top, False
100%|█...█| 128826/128826 [00:00<00:00, 138523.42it/s]
# At top, fixed 16953/21749 collisions
Traceback (most recent call last):
  File "/home/user/Source/Gulzar/venv/bin/fez2fea", line 44, in <module>
    print(p.fontfeatures.asFea(do_gdef=args.do_gdef))
  File "/home/user/Source/Gulzar/venv/lib/python3.10/site-packages/fontFeatures/feaLib/FontFeatures.py", line 21, in asFea
    return self.asFeaAST(**kwargs).asFea()
  File "/home/user/Source/Gulzar/venv/lib/python3.10/site-packages/fontFeatures/feaLib/FontFeatures.py", line 149, in asFeaAST
    pre = k.feaPreamble(self)
  File "/home/user/Source/Gulzar/venv/lib/python3.10/site-packages/fontFeatures/feaLib/Routine.py", line 35, in feaPreamble
    if self.flags & 0xFF00:
TypeError: unsupported operand type(s) for &: 'dict' and 'int'
make: *** [Makefile:73: sources/build/fea/anchor-attachment.fea] Error 1
make: *** Deleting file 'sources/build/fea/anchor-attachment.fea'

@MattMatic
Copy link
Author

MattMatic commented May 17, 2024

So there's also a version issue with the fez-language package...
Gulzar currently only builds with:

  • fontFeatures 1.7.4
  • fez-language 1.3.3

i.e.

  • source venv/bin/activate
  • pip install fontFeatures==1.7.4
  • pip install fez-language==1.3.3
  • deactivate

Can Gulzar be brought up to date with fontFeatures 1.8.0 and fez-language 1.4.0? (And with other package updates)

The build gets much further, but fails after Compacting GPOS (attached).
2024-05-17-SourceGulzarMake.txt

But specifically:

…
Compiling features to 'fonts/ttf/Gulzar-Regular.ttf'
Reading 'post' table from disk
Decompiling 'post' table
Reading 'maxp' table from disk
Decompiling 'maxp' table
ERROR: sources/build/features.fea:187457:5: Can't define a variable scalar in a non-variable font
make: *** [Makefile:16: fonts/ttf/Gulzar-Regular.ttf] Error 1
make: *** Deleting file 'fonts/ttf/Gulzar-Regular.ttf'

Current pip package versions:
2024-05-17-pip-packages.txt

@MattMatic
Copy link
Author

MattMatic commented May 30, 2024

Some progress, but still failing with make release. 😟
Discovered that fez-language must be version 1.3.4 (not 1.3.3!).
But hb-subset produces a "Bus error" and a zero byte file. (tried v8.5.0 and 5.3.1 of hb-subset)

After some experimentation, it appears that hb-subset cannot output to the same filename as the source. Windows gives a "Cannot open output file" error, but Linux gives a "Bus error" and nukes the file contents!

I can only conclude that the makefile is incorrect for release builds. hb-subset must have a different output filename.
After adjusting the makefile, I am also getting an error that gftools-fix-font.py is missing...

Although the debug build is producing a TTF, the GSUB table and spot-checks with shaping does not match the released version of Gulzar v1.002.

Ideally would like a binary match to have confidence that the build process is good. Even better would be a build process using current libraries!

Really want to cooperate in improving Gulzar, and add other weights, but struggling to get a solid starting point that matches the released version. 😔
Would very much appreciate some guidance to get things moving! 😊

cc: @simoncozens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant