-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
How can you build the font with certain features enabled? #1348
Comments
Interesting! Our CI uses docker image and it seems to work: https://github.com/tonsky/FiraCode/blob/master/.github/workflows/build.yml One difference might be that this docker image was built from a different Dockerfile? I am not sure how to check for that |
Check with tonsky/firacode:latest maybe? |
Doesn't seem to be working, the [thomas@mango-os FiraCode-6.2 $] doas make PWD=`pwd`
docker build -t tonsky/firacode:latest .
Sending build context to Docker daemon 16.83MB
Step 1/4 : FROM python:3
---> a5d7930b60cc
Step 2/4 : WORKDIR /opt
---> Using cache
---> d95a74d9c1dc
Step 3/4 : RUN pip install --upgrade Pillow==5.4.1 idna==2.8 requests==2.21.0 urllib3==1.24.1 pycairo==1.20.1 gftools==0.7.4 fontmake==2.4.0 fontbakery==0.8.0
---> Using cache
---> b7618fbeefd5
Step 4/4 : RUN apt-get update && apt-get install -y ttfautohint && apt-get install -y woff2 && apt-get install -y sfnt2woff-zopfli
---> Using cache
---> 43c13ef81cc3
Successfully built 43c13ef81cc3
Successfully tagged tonsky/firacode:latest
docker run --rm -v /home/thomas/down/fonts/FiraCode-6.2:/opt tonsky/firacode:latest ./script/build.sh
Making distr/ttf/FiraCode-Light.ttf
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.classes:Parsing "FiraCode.glyphs" file into <GSFont>
INFO:fontmake.font_project:Interpolating master UFOs from designspace
INFO:fontmake.font_project:Generating instance UFO for "Fira Code Light"
INFO:fontmake.font_project:Building TTF for FiraCode-Light
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters.base:Running EraseOpenCornersFilter on FiraCode-Light
INFO:ufo2ft.filters.base:Running DecomposeComponentsFilter on FiraCode-Light
INFO:ufo2ft.filters.base:Running RemoveOverlapsFilter on FiraCode-Light
INFO:ufo2ft.filters.base:Running CubicToQuadraticFilter on FiraCode-Light
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 345, 2: 2869, 3: 1186, 4: 369, 5: 40, 6: 7
INFO:ufo2ft:Building OpenType tables
fontmake: Error: In 'FiraCode.glyphs' -> 'master_ufo/FiraCode.designspace' -> 'master_ufo/instance_ufo/FiraCode-Light.ufo': Compiling UFO failed: master_ufo/instance_ufo/FiraCode-Light.ufo/features.fea:2031:1: Expected glyph class definition or statement: got NAME featureNames
make: *** [Makefile:7: build] Error 1 Heres the diff showing the changes I made to the 4c4
< docker build -t fira:latest .
---
> docker build -t tonsky/firacode:latest .
7c7
< docker run --rm -v ${PWD}:/opt fira:latest ./script/build.sh
---
> docker run --rm -v ${PWD}:/opt tonsky/firacode:latest ./script/build.sh |
Also once I get building to actually work, how could I go about replacing certain default ligatures with their variants? |
I have re-checked on a fresh machine and fresh checkout, it builds ok with the Docker. Have you modified the FiraCode.glyphs file maybe? As for modification, you might need to modify glyphs file. The way I would go about it I’d take ss02 code (search for Alternatively, find |
Nope, it's from a fresh clone of the repo, I haven't modified anything. Perhaps I am doing something wrong running the Also to make sure that I am actually doing this properly, here are all my steps: $ git clone https://github.com/tonsky/FiraCode.git
$ cd FiraCode
$ doas dockerd --dns=8.8.8.8 # This is in another terminal
$ doas make PWD=`pwd` |
Funny, I thought Docker is meant to be reproducible :) I am no expert in it, can’t help you, unfortunately |
Do you have any idea what the error means though? Perhaps I can try to find a way to fix it. Also I got the whole "docker needs me to be root" thing sorted out and that doesn't seem to be the issue |
Well, fontmake doesn’t like the glyphs file for some reason 🤷♂️ |
What exact commands are you running to build it? I can try on another machine tomorrow. |
|
I managed to get a build to work! For anyone in the future with the same issue, here is what I did: $ doas rm -rf /var/lib/docker # Remove all the cache
$ doas dockerd --dns=8.8.8.8 & >&2 2>/dev/null # Start the docker daemon
$ docker run --rm -v $(PWD):/opt tonsky/firacode:latest ./script/build.sh # Build everything Why it didn't work the previous times? No clue, but it works now so that's all I care about. I'll update later with my results at patching in the desired features as defaults. |
How can I enable a feature such as |
|
If only it was that easy:
|
Interesting! Maybe remove block related to cv25? |
Tried that and got this:
|
Find and remove references to it? |
You must only copy the parts inside the lookups to The original FiraCode.glyphs (the actual file uses
should become
Then from the root of the git repo you can use the docker command from above to build the font. Your finished font will be in |
Resolved via #1387 |
…f just the rules like an overly-cautious reading of tonsky/FiraCode#1348 (comment) would suggest.
…nstead of just the rules like an overly-cautious reading of tonsky/FiraCode#1348 (comment) would suggest." This reverts commit 1cacd16. Fixes some ligatures like ellipses and circumflex-equals.
* Switch away from flake-utils. * Better pset organization. * Update flake.lock * Glyph-editing script. * Add logging. * Account for different ligature block endings; open file exclusively for writing to fix length difference bug. * Update flake.lock * Testing reveals that the whole lookup block can be removed, instead of just the rules like an overly-cautious reading of tonsky/FiraCode#1348 (comment) would suggest. * Revert "Testing reveals that the whole lookup block can be removed, instead of just the rules like an overly-cautious reading of tonsky/FiraCode#1348 (comment) would suggest." This reverts commit 1cacd16. Fixes some ligatures like ellipses and circumflex-equals.
I would like to have the alternative ligatures for <= and >= (feature
ss02
) however emacs (the editor I use) doesn't have support for enabling font features. Would it be possible to just build the font from source with my desired features as the defaults? If so, how can I go about doing so?I tried to investigate this myself, and decided that as a start I should see if I can simply build the thing without any changes, however from a clean clone of the repository I execute the following:
and I get the following error as output:
as someone who has no idea about anything related to fonts, how can I deal with this error?
The text was updated successfully, but these errors were encountered: