Skip to content

Commit 3bacf48

Browse files
committed
Initial commit
0 parents  commit 3bacf48

605 files changed

Lines changed: 26176 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/build.yaml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Build font and specimen
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
name: Build and test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.11
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.11"
15+
- name: Setup fontspector
16+
uses: fonttools/setup-fontspector@main
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Install toolset
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install ttfautohint libcairo2-dev python3-cairo-dev pkg-config python3-dev
23+
sudo snap install yq
24+
- uses: actions/cache@v4
25+
with:
26+
path: ./venv/
27+
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }}
28+
restore-keys: |
29+
${{ runner.os }}-venv-
30+
- name: Set artifact file name
31+
id: zip-name
32+
shell: bash
33+
# Set the archive name to repo name + "-fonts" e.g "radiocanadafonts-fonts.zip"
34+
run: echo "ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-fonts" >> $GITHUB_ENV
35+
36+
# If a new release is cut, use the release tag to auto-bump the source files
37+
# - name: Bump release
38+
# if: github.event_name == 'release'
39+
# run: |
40+
# . venv/bin/activate
41+
# SRCS=$(yq e ".sources[]" sources/config.yaml)
42+
# TAG_NAME=${GITHUB_REF/refs\/tags\//}
43+
# echo "Bumping $SRCS to $TAG_NAME"
44+
# for src in $SRCS
45+
# do
46+
# bumpfontversion sources/$src --new-version $TAG_NAME;
47+
# done
48+
49+
- name: Build font
50+
run: make build
51+
- name: Check with fontspector
52+
run: make test
53+
continue-on-error: true
54+
- name: Generate proofs
55+
run: make proof
56+
- name: Set up test result site
57+
run: cp scripts/index.html out/index.html
58+
- name: Collect deployment assets
59+
if: ${{ github.ref == 'refs/heads/main' }}
60+
uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: ./out
63+
- name: Archive artifacts
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: ${{ env.ZIP_NAME }}
67+
path: |
68+
fonts
69+
out
70+
outputs:
71+
zip_name: ${{ env.ZIP_NAME }}
72+
73+
deploy:
74+
name: Deploy results to GitHub Pages
75+
if: ${{ github.ref == 'refs/heads/main' }}
76+
needs: build
77+
runs-on: ubuntu-latest
78+
permissions:
79+
pages: write
80+
id-token: write
81+
environment:
82+
name: github-pages
83+
url: ${{ steps.deployment.outputs.page_url }}
84+
steps:
85+
- name: Deploy to GitHub Pages
86+
id: deployment
87+
uses: actions/deploy-pages@v4
88+
89+
# There are two ways a release can be created: either by pushing a tag, or by
90+
# creating a release from the GitHub UI. Pushing a tag does not automatically
91+
# create a release, so we have to do that ourselves. However, creating a
92+
# release from the GitHub UI *does* push a tag, and we don't want to create
93+
# a new release in that case because one already exists!
94+
95+
release:
96+
name: Release bundle
97+
if: contains(github.ref, 'refs/tags/')
98+
needs: build
99+
runs-on: ubuntu-latest
100+
env:
101+
ZIP_NAME: ${{ needs.build.outputs.zip_name }}
102+
GH_TOKEN: ${{ github.token }}
103+
steps:
104+
- uses: actions/checkout@v4
105+
- name: Use font artifacts from CI
106+
uses: actions/download-artifact@v5
107+
with:
108+
name: ${{ env.ZIP_NAME }}
109+
path: ${{ env.ZIP_NAME }}
110+
- name: Copy DESCRIPTION.en_us.html to release directory
111+
run: cp documentation/DESCRIPTION.en_us.html ${{ env.ZIP_NAME }}/DESCRIPTION.en_us.html
112+
- name: Copy ARTICLE.en_us.html to release directory
113+
run: cp documentation/ARTICLE.en_us.html ${{ env.ZIP_NAME }}/ARTICLE.en_us.html
114+
continue-on-error: true
115+
- name: Copy OFL.txt to release directory
116+
run: cp OFL.txt ${{ env.ZIP_NAME }}/OFL.txt
117+
- name: Remove proof/test outputs from release
118+
run: rm -rf ${{ env.ZIP_NAME }}/out
119+
- name: Set release file name
120+
shell: bash
121+
run: echo "RELEASE_ZIP_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')-${{github.ref_name}}" >> $GITHUB_ENV
122+
- name: Create release bundle
123+
run: mv ${{ env.ZIP_NAME }} ${{ env.RELEASE_ZIP_NAME }}; zip -r ${{ env.RELEASE_ZIP_NAME }}.zip ${{ env.RELEASE_ZIP_NAME }}
124+
- name: Check for release
125+
id: create_release
126+
run: |
127+
if ! gh release view ${{ github.ref_name }}; then
128+
git show -s --format=%B ${{ github.ref_name }} | tail -n +4 | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F -
129+
fi
130+
- name: Populate release
131+
run: |
132+
gh release upload ${{ github.ref_name }} ${{ env.RELEASE_ZIP_NAME }}.zip --clobber
133+
- name: Set release live
134+
run: |
135+
gh release edit ${{ github.ref_name }} --draft=false

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
/sources/build.ninja
3+
/sources/.ninja_log
4+
instance_ufos

AUTHORS.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is the official list of project authors for copyright purposes. The first name in the list (if there are several authors), will appear as "Principal design" in the "about" section of the font specimen on Google Fonts.
2+
# This file is distinct from the CONTRIBUTORS.txt file.
3+
# See the latter for an explanation.
4+
#
5+
# Names should be added to this file as:
6+
# Name or Organization <email address>
7+
8+
Andrés Briganti <info@briganti.works>
9+
Mateo Zaragoza <mateo@basement.studio>
10+
Basement.studio <hello@basement.studio>
11+
Vercel <contactus@vercel.com>

CONTRIBUTORS.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This is the list of people who have contributed to this project,
2+
# and includes those not listed in AUTHORS.txt because they are not
3+
# copyright authors. For example, company employees may be listed
4+
# here because their company holds the copyright and is listed there.
5+
#
6+
# When adding J Random Contributor's name to this file, either J's
7+
# name or J's organization's name should be added to AUTHORS.txt
8+
#
9+
# Names should be added to this file as:
10+
# Name <email address>
11+
12+
Andrés Briganti <info@briganti.works>
13+
Mateo Zaragoza <mateo@basement.studio>
14+
Basement.studio <hello@basement.studio>
15+
Vercel <contactus@vercel.com>
16+
Evil Rabbit <evilrabbit@vercel.com>
17+
José Rago <jose@basement.studio>
18+
Facundo Santana <facundo@basement.studio>
19+
Guido Ferreyra <guido@tipografia.com.ar>

LICENSE.txt

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
Copyright (c) 2023 Vercel, in collaboration with basement.studio
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
-----------------------------------------------------------
8+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9+
-----------------------------------------------------------
10+
11+
PREAMBLE
12+
The goals of the Open Font License (OFL) are to stimulate worldwide
13+
development of collaborative font projects, to support the font creation
14+
efforts of academic and linguistic communities, and to provide a free and
15+
open framework in which fonts may be shared and improved in partnership
16+
with others.
17+
18+
The OFL allows the licensed fonts to be used, studied, modified and
19+
redistributed freely as long as they are not sold by themselves. The
20+
fonts, including any derivative works, can be bundled, embedded,
21+
redistributed and/or sold with any software provided that any reserved
22+
names are not used by derivative works. The fonts and derivatives,
23+
however, cannot be released under any other type of license. The
24+
requirement for fonts to remain under this license does not apply
25+
to any document created using the fonts or their derivatives.
26+
27+
DEFINITIONS
28+
"Font Software" refers to the set of files released by the Copyright
29+
Holder(s) under this license and clearly marked as such. This may
30+
include source files, build scripts and documentation.
31+
32+
"Reserved Font Name" refers to any names specified as such after the
33+
copyright statement(s).
34+
35+
"Original Version" refers to the collection of Font Software components as
36+
distributed by the Copyright Holder(s).
37+
38+
"Modified Version" refers to any derivative made by adding to, deleting,
39+
or substituting -- in part or in whole -- any of the components of the
40+
Original Version, by changing formats or by porting the Font Software to a
41+
new environment.
42+
43+
"Author" refers to any designer, engineer, programmer, technical
44+
writer or other person who contributed to the Font Software.
45+
46+
PERMISSION AND CONDITIONS
47+
Permission is hereby granted, free of charge, to any person obtaining
48+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
49+
redistribute, and sell modified and unmodified copies of the Font
50+
Software, subject to the following conditions:
51+
52+
1) Neither the Font Software nor any of its individual components,
53+
in Original or Modified Versions, may be sold by itself.
54+
55+
2) Original or Modified Versions of the Font Software may be bundled,
56+
redistributed and/or sold with any software, provided that each copy
57+
contains the above copyright notice and this license. These can be
58+
included either as stand-alone text files, human-readable headers or
59+
in the appropriate machine-readable metadata fields within text or
60+
binary files as long as those fields can be easily viewed by the user.
61+
62+
3) No Modified Version of the Font Software may use the Reserved Font
63+
Name(s) unless explicit written permission is granted by the corresponding
64+
Copyright Holder. This restriction only applies to the primary font name as
65+
presented to the users.
66+
67+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68+
Software shall not be used to promote, endorse or advertise any
69+
Modified Version, except to acknowledge the contribution(s) of the
70+
Copyright Holder(s) and the Author(s) or with their explicit written
71+
permission.
72+
73+
5) The Font Software, modified or unmodified, in part or in whole,
74+
must be distributed entirely under this license, and must not be
75+
distributed under any other license. The requirement for fonts to
76+
remain under this license does not apply to any document created
77+
using the Font Software.
78+
79+
TERMINATION
80+
This license becomes null and void if any of the above conditions are
81+
not met.
82+
83+
DISCLAIMER
84+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92+
OTHER DEALINGS IN THE FONT SOFTWARE.

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
SOURCES=$(shell python3 scripts/read-config.py --sources )
2+
FAMILY=$(shell python3 scripts/read-config.py --family )
3+
4+
help:
5+
@echo "###"
6+
@echo "# Build targets for $(FAMILY)"
7+
@echo "###"
8+
@echo
9+
@echo " make build: Builds the fonts and places them in the fonts/ directory"
10+
@echo " make test: Tests the fonts with fontspector"
11+
@echo " make proof: Creates HTML proof documents in the proof/ directory"
12+
@echo " make images: Creates PNG specimen images in the documentation/ directory"
13+
@echo
14+
15+
build: build.stamp
16+
17+
venv: venv/touchfile
18+
19+
customize: venv
20+
. venv/bin/activate; python3 scripts/customize.py
21+
22+
build.stamp: venv sources/config.yaml $(SOURCES)
23+
rm -rf fonts
24+
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp
25+
26+
venv/touchfile: requirements.txt
27+
test -d venv || python3 -m venv venv
28+
. venv/bin/activate; pip install -Ur requirements.txt
29+
touch venv/touchfile
30+
31+
test: build.stamp
32+
which fontspector || (echo "fontspector not found. Please install it with 'cargo install fontspector'." && exit 1)
33+
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; mkdir -p out/ out/fontspector; fontspector --profile googlefonts -l warn --full-lists --succinct --html out/fontspector/fontspector-report.html --badges out/badges $$TOCHECK || echo '::warning file=sources/config.yaml,title=fontspector failures::The fontspector QA check reported errors in your font. Please check the generated report.'
34+
35+
proof: venv build.stamp
36+
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $$TOCHECK -o out/proof
37+
38+
images: venv $(DRAWBOT_OUTPUT)
39+
40+
%.png: %.py build.stamp
41+
. venv/bin/activate; python3 $< --output $@
42+
43+
clean:
44+
rm -rf venv
45+
find . -name "*.pyc" -delete
46+
47+
update-project-template:
48+
npx update-template https://github.com/googlefonts/googlefonts-project-template/
49+
50+
update: venv
51+
venv/bin/pip install --upgrade pip-tools
52+
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
53+
# the `--resolver` flag below.
54+
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
55+
venv/bin/pip-sync requirements.txt
56+
57+
git commit -m "Update requirements" requirements.txt
58+
git push

0 commit comments

Comments
 (0)