Skip to content

Commit a4195ae

Browse files
Geist Pixel on Google Fonts (#229)
Add Geist Pixel sources, configs, and binaries for the Google Fonts build, with the pipeline changes to make it pass in CI: - Build Pixel from a dedicated venv using the gftools dev build that adds virtual-master support, pinned to googlefonts/gftools@47ec3706b. The released gftools in requirements.txt can't build the virtual-master source (it fails with "No final targets"); Sans/Mono keep the released toolchain. - Restore the hand-exported pixel statics/webfonts after the clean rebuild so copy-npm-fonts and the release zip get the consumed woff2s. - Sync the published pixel webfonts in packages/next/dist with the source and add a patch changeset so the geist npm package ships the validation fixes. Squashed from #226 into a single signed commit to satisfy the verified-signatures rule. Co-authored-by: Emma Marichal <emma.marichal@hotmail.fr>
1 parent 8b8b75f commit a4195ae

42 files changed

Lines changed: 1234 additions & 120 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.pnpm-debug.log
33
*~
44
venv
5+
venv-pixel
56
venv-test
67
build.stamp
78
proof

Makefile

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,29 @@ build: build.stamp
1616

1717
venv: venv/touchfile
1818

19+
venv-pixel: venv-pixel/touchfile
20+
1921
customize: venv
2022
. venv/bin/activate; python3 scripts/customize.py
2123

22-
build.stamp: venv sources/config-Geist.yaml $(SOURCES)
24+
build.stamp: venv venv-pixel sources/config-Geist.yaml $(SOURCES)
2325
rm -rf fonts geist-font geist-font.zip
24-
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done)
26+
# Geist Pixel uses a virtual master, which the released gftools in
27+
# requirements.txt can't build (it fails with "No final targets"). Build it
28+
# with the dev gftools in venv-pixel that has the virtual-master fix;
29+
# everything else uses venv.
30+
@for config in sources/config*.yaml; do \
31+
if [ "$$config" = "sources/config-GeistPixel.yaml" ]; then \
32+
( . venv-pixel/bin/activate && gftools builder "$$config" ); \
33+
else \
34+
( . venv/bin/activate && gftools builder "$$config" ); \
35+
fi; \
36+
done
37+
# Geist Pixel's static instances and webfonts are hand-exported from Glyphs
38+
# and committed (buildStatic:false means gftools only builds the variable, so
39+
# the clean `rm -rf fonts` above drops them). Restore the committed assets the
40+
# release zip and npm package consume.
41+
git checkout -- fonts/GeistPixel/otf fonts/GeistPixel/ttf fonts/GeistPixel/webfonts
2542
$(MAKE) copy-npm-fonts
2643
$(MAKE) create-release-zip
2744
touch build.stamp
@@ -69,6 +86,16 @@ venv/touchfile: requirements.txt
6986
. venv/bin/activate; pip install -Ur requirements.txt
7087
touch venv/touchfile
7188

89+
# Geist Pixel's virtual-master support only exists in an unreleased gftools dev
90+
# build (Simon Cozens' fix). Pin the exact commit for reproducibility; revisit
91+
# once it ships in an official gftools release and we can fold it into venv.
92+
GFTOOLS_PIXEL_REF = 47ec3706b
93+
94+
venv-pixel/touchfile: Makefile
95+
test -d venv-pixel || python3 -m venv venv-pixel
96+
. venv-pixel/bin/activate; pip install "gftools @ git+https://github.com/googlefonts/gftools@$(GFTOOLS_PIXEL_REF)"
97+
touch venv-pixel/touchfile
98+
7299
test: build.stamp
73100
which fontspector || (echo "fontspector not found. Please install it with 'cargo install fontspector'." && exit 1)
74101
TOCHECK=$$(find fonts/Geist/variable -type f 2>/dev/null); mkdir -p out/ out/fontspector; fontspector --profile googlefonts -l warn --full-lists --succinct --html out/fontspector/GeistVF-fontspector-report.html --ghmarkdown out/fontspector/GeistVF-fontspector-report.md --badges out/badges $$TOCHECK || echo '::warning file=sources/config-Geist.yaml,title=fontspector failures::The fontspector QA check reported errors in your font. Please check the generated report.'
@@ -86,7 +113,7 @@ images: venv $(DRAWBOT_OUTPUT)
86113
. venv/bin/activate; python3 $< --output $@
87114

88115
clean:
89-
rm -rf venv
116+
rm -rf venv venv-pixel
90117
find . -name "*.pyc" -delete
91118

92119
update-project-template:
84 KB
Binary file not shown.
86.2 KB
Binary file not shown.
42.4 KB
Binary file not shown.
3.47 KB
Binary file not shown.
8.58 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)