Skip to content

Commit 0d42d5a

Browse files
authored
Initial commit
0 parents  commit 0d42d5a

27 files changed

Lines changed: 149372 additions & 0 deletions

.github/workflows/build.yaml

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

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
*~
2+
venv
3+
venv-test
4+
build.stamp
5+
proof
6+
fonts
7+
node_modules
8+
package-lock.json
9+
package.json
10+
master_ufo
11+
instance_ufos
12+
.ninja_log
13+
build.ninja
14+
15+
# OS generated files #
16+
######################
17+
.DS_Store
18+
.DS_Store?
19+
._*
20+
.Spotlight-V100
21+
.Trashes
22+
ehthumbs.db
23+
Thumbs.db
24+
25+
# Autosaved by application when editing
26+
######################
27+
*(تم الحفظ تلقائيًا).*
28+
*(automaticky uloženo).*
29+
*(Automatisch gesichert).*
30+
*(Autosaved).*
31+
*(guardado automáticamente).*
32+
*(enregistré automatiquement).*
33+
*(salvato automaticamente).*
34+
*(自動保存).*
35+
*(자동 저장됨).*
36+
*(Salvo Automaticamente).*
37+
*(Автосохранение).*
38+
*(Otomatik Kaydedildi).*
39+
*(自动存储).*
40+
*(已自動儲存).*

.templaterc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"files": [".github/**/*", "Makefile", "scripts/**/*", "requirements.txt"]
3+
}

AUTHORS.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+

CONTRIBUTORS.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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>

Makefile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
SOURCES=$(shell python3 scripts/read-config.py --sources )
2+
FAMILY=$(shell python3 scripts/read-config.py --family )
3+
DRAWBOT_SCRIPTS=$(shell ls documentation/*.py)
4+
DRAWBOT_OUTPUT=$(shell ls documentation/*.py | sed 's/\.py/.png/g')
5+
6+
help:
7+
@echo "###"
8+
@echo "# Build targets for $(FAMILY)"
9+
@echo "###"
10+
@echo
11+
@echo " make build: Builds the fonts and places them in the fonts/ directory"
12+
@echo " make test: Tests the fonts with fontspector"
13+
@echo " make proof: Creates HTML proof documents in the proof/ directory"
14+
@echo " make images: Creates PNG specimen images in the documentation/ directory"
15+
@echo
16+
17+
build: build.stamp
18+
19+
venv: venv/touchfile
20+
21+
customize: venv
22+
. venv/bin/activate; python3 scripts/customize.py
23+
24+
build.stamp: venv sources/config.yaml $(SOURCES)
25+
rm -rf fonts
26+
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp
27+
28+
venv/touchfile: requirements.txt
29+
test -d venv || python3 -m venv venv
30+
. venv/bin/activate; pip install -Ur requirements.txt
31+
touch venv/touchfile
32+
33+
test: build.stamp
34+
which fontspector || (echo "fontspector not found. Please install it with 'cargo install fontspector'." && exit 1)
35+
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 --ghmarkdown out/fontspector/fontspector-report.md --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.'
36+
37+
proof: venv build.stamp
38+
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
39+
40+
images: venv $(DRAWBOT_OUTPUT)
41+
42+
%.png: %.py build.stamp
43+
. venv/bin/activate; python3 $< --output $@
44+
45+
clean:
46+
rm -rf venv
47+
find . -name "*.pyc" -delete
48+
49+
update-project-template:
50+
npx update-template https://github.com/googlefonts/googlefonts-project-template/
51+
52+
update: venv
53+
venv/bin/pip install --upgrade pip-tools
54+
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
55+
# the `--resolver` flag below.
56+
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
57+
venv/bin/pip-sync requirements.txt
58+
59+
git commit -m "Update requirements" requirements.txt
60+
git push

OFL.txt

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

0 commit comments

Comments
 (0)