Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhu committed Dec 16, 2023
1 parent 087a08c commit 2092e3f
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 132 deletions.
32 changes: 18 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ build: build.stamp

venv: venv/touchfile

venv-test: venv-test/touchfile

build.stamp: venv .init.stamp sources/config.yaml $(SOURCES)
. venv/bin/activate; rm -rf fonts/; gftools builder sources/config.yaml
. venv/bin/activate; fonttools varLib.instancer fonts/variable/Urbanist\[ital,wght\].ttf ital=0 -o fonts/variable/Urbanist\[wght\].ttf --update-name-table
. venv/bin/activate; fonttools varLib.instancer fonts/variable/Urbanist\[ital,wght\].ttf ital=1 -o fonts/variable/Urbanist-Italic\[wght\].ttf --update-name-table
touch build.stamp
rm -rf fonts
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp

.init.stamp: venv
. venv/bin/activate; python3 scripts/first-run.py
Expand All @@ -32,24 +32,28 @@ venv/touchfile: requirements.txt
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/touchfile

test: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $(shell find fonts/ttf -type f)
venv-test/touchfile: requirements-test.txt
test -d venv-test || python3 -m venv venv-test
. venv-test/bin/activate; pip install -Ur requirements-test.txt
touch venv-test/touchfile

test: venv-test build.stamp
. venv-test/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $(shell find fonts/ttf -type f) || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'

proof: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/proof; gftools gen-html proof $(shell find fonts/ttf -type f) -o out/proof
. venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $(shell find fonts/ttf -type f) -o out/proof

images: venv build.stamp $(DRAWBOT_OUTPUT)
git add documentation/*.png && git commit -m "Rebuild images" documentation/*.png
images: venv $(DRAWBOT_OUTPUT)

%.png: %.py build.stamp
python3 $< --output $@
. venv/bin/activate; python3 $< --output $@

clean:
rm -rf venv
find . -name "*.pyc" | xargs rm delete
find . -name "*.pyc" -delete

update-ufr:
npx update-template https://github.com/googlefonts/Unified-Font-Repository/
update-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/

update:
pip install --upgrade $(dependency); pip freeze > requirements.txt
pip install --upgrade $(dependency); pip freeze > requirements.txt
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fontbakery[googlefonts]>=0.9.2
gftools[qa]>=0.9.23
193 changes: 110 additions & 83 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,106 +1,133 @@
absl-py==1.1.0
absl-py==2.0.0
afdko==4.0.0
appdirs==1.4.4
attrs==21.4.0
autopep8==1.6.0
axisregistry==0.3.5
babelfont==2.0.2
beautifulsoup4==4.11.1
beziers==0.4.0
attrs==23.1.0
axisregistry==0.4.5
babelfont==3.0.1
beautifulsoup4==4.12.2
beziers==0.5.0
blackrenderer==0.6.0
booleanOperations==0.9.0
Brotli==1.0.9
browserstack-local==1.2.2
Brotli==1.1.0
bump2version==1.0.1
bumpfontversion==0.4.1
cattrs==22.1.0
certifi==2023.7.22
cffi==1.15.1
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cffsubr==0.2.9.post1
charset-normalizer==2.1.0
click==8.1.3
cmarkgfm==0.8.0
collidoscope==0.4.1
colorlog==6.6.0
charset-normalizer==3.3.2
click==8.1.7
cmarkgfm==2022.10.27
collidoscope==0.6.5
colorlog==6.8.0
commandlines==0.4.1
commonmark==0.9.1
compreffor==0.5.2
cu2qu==1.6.7.post1
defcon==0.10.1
compreffor==0.5.5
cryptography==41.0.7
cu2qu==1.6.7.post2
defcon==0.10.3
dehinter==4.0.0
Deprecated==1.2.13
drawbot-skia==0.4.8
exceptiongroup==1.0.0rc8
Deprecated==1.2.14
diffenator2==0.3.5
docopt==0.6.2
drawbot-skia==0.5.0
exceptiongroup==1.2.0
font-v==2.1.0
fontbakery==0.8.9
fontdiffenator==0.9.12
fontFeatures==1.7.2
fontmake==3.4.0
fontMath==0.9.2
fontParts==0.10.6
fontbakery==0.10.8
fontFeatures==1.8.0
fontmake==3.7.1
fontMath==0.9.3
fontParts==0.12.1
fontPens==0.2.4
fonttools==4.34.4
fonttools==4.46.0
freetype-py==2.3.0
fs==2.4.16
gfdiffbrowsers==0.1.7
gflanguages==0.4.0
gftools[qa]==0.9.14
gitdb==4.0.9
GitPython==3.1.35
glyphsets==0.5.2
glyphsLib==6.0.6
glyphtools==0.8.0
hyperglot==0.4.0
idna==3.3
gflanguages==0.5.13
gftools==0.9.41
gitdb==4.0.11
GitPython==3.1.40
glyphsets==0.6.11
glyphsLib==6.6.0
h11==0.14.0
hyperglot==0.4.5
idna==3.6
Jinja2==3.1.2
lxml==4.9.1
MarkupSafe==2.1.1
numpy==1.23.1
openstep-plist==0.3.0
opentype-sanitizer==8.2.1
opentypespec==1.8.4
Pillow==10.0.1
pip-api==0.0.29
protobuf==3.19.4
psutil==5.9.1
pybind11==2.9.2
pybrowserstack-screenshots==0.1
pycairo==1.21.0
pyclipper==1.3.0.post3
pycodestyle==2.8.0
kurbopy==0.10.40
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
munkres==1.1.4
MutatorMath==3.0.1
nanoemoji==0.15.1
ninja==1.11.1.1
num2words==0.5.13
numpy==1.26.2
openstep-plist==0.3.1
opentype-sanitizer==9.1.0
opentypespec==1.9.1
orjson==3.9.10
outcome==1.3.0.post0
packaging==23.2
picosvg==0.22.1
Pillow==10.1.0
pip-api==0.0.30
pngquant-cli==2.17.0.post5
protobuf==3.20.3
psautohint==2.4.0
pyahocorasick==2.0.0
pybind11==2.11.1
pycairo==1.25.1
pyclipper==1.3.0.post5
pycparser==2.21
pygit2==1.9.2
PyGithub==1.55
Pygments==2.15.0
PyJWT==2.4.0
pygit2==1.13.3
PyGithub==2.1.1
Pygments==2.17.2
PyJWT==2.8.0
PyNaCl==1.5.0
pyparsing==3.0.9
pyparsing==3.1.1
PySocks==1.7.1
python-bidi==0.4.2
python-dateutil==2.8.2
PyYAML==6.0
PyYAML==6.0.1
regex==2023.10.3
requests==2.31.0
rich==12.4.4
rstr==3.2.0
sh==1.14.2
simplejson==3.17.6
resvg-cli==0.22.0.post3
rich==13.7.0
rstr==3.2.2
selenium==4.16.0
sh==2.0.6
shaperglot==0.3.1
six==1.16.0
skia-pathops==0.7.2
skia-python==87.4
smmap==5.0.0
soupsieve==2.3.2.post1
skia-pathops==0.8.0.post1
skia-python==87.5
smmap==5.0.1
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.5
sre-yield==1.2
statmake==0.5.1
strictyaml==1.6.1
statmake==0.6.0
strictyaml==1.7.3
stringbrewer==0.0.1
tabulate==0.8.10
tabulate==0.9.0
termcolor==2.4.0
toml==0.10.2
tqdm==4.66.1
trio==0.23.2
trio-websocket==0.11.1
ttfautohint-py==0.5.1
typing_extensions==4.3.0
ufo2ft==2.28.0
ufoLib2==0.13.1
typing_extensions==4.9.0
ufo2ft==2.33.4
ufoLib2==0.16.0
ufolint==1.2.0
uharfbuzz==0.27.0
unicodedata2==14.0.0
Unidecode==1.3.4
urllib3==1.26.17
vharfbuzz==0.1.4
vttLib==0.11.0
wrapt==1.14.1
ufonormalizer==0.6.1
ufoProcessor==1.9.0
uharfbuzz==0.37.3
unicodedata2==15.1.0
Unidecode==1.3.7
urllib3==2.1.0
vharfbuzz==0.2.0
vttLib==0.12.0
wrapt==1.16.0
wsproto==1.2.0
youseedee==0.3.0
zopfli==0.2.3
8 changes: 4 additions & 4 deletions scripts/first-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from urllib.parse import quote
import subprocess

BASE_OWNER = "coreyhu"
BASE_REPONAME = "Urbanist"
DUMMY_URL = f"https://{BASE_OWNER}.github.io/{BASE_REPONAME}"
BASE_OWNER = "googlefonts"
BASE_REPONAME = "googlefonts-project-template"
DUMMY_URL = "https://yourname.github.io/your-font-repository-name"


def repo_url(owner, name):
Expand Down Expand Up @@ -124,4 +124,4 @@ def lose(msg, e=None):

# Finally, we add a "touch file" called ".init.stamp" to the repository which
# prevents this first-run process from being run again.
touch()
touch()
10 changes: 2 additions & 8 deletions scripts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ <h1>My Font testing pages</h1>
<a href="fontbakery/fontbakery-report.html">FontBakery Report</a>
</li>
<li>
<a href="proof/glyphs.html">All glyphs</a>
</li>
<li>
<a href="proof/text.html">Sample text</a>
</li>
<li>
<a href="proof/waterfall.html">Waterfall test</a>
<a href="proof/diffenator2-report.html">Diffenator2 Report</a>
</li>
</ul>
</body>
</html>
</html>
46 changes: 23 additions & 23 deletions scripts/read-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@

parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--sources',action='store_true')
group.add_argument('--family',action='store_true')
group.add_argument("--sources", action="store_true")
group.add_argument("--family", action="store_true")
args = parser.parse_args()

with open(os.path.join("sources", "config.yaml")) as config:
data = config.read()
data = config.read()

if args.family:
m = re.search(r"(?m)^familyName: (.*)", data)
if m:
print(m[1])
sys.exit(0)
else:
print("Could not determine family name from config file!")
sys.exit(1)
m = re.search(r"(?m)^familyName: (.*)", data)
if m:
print(m[1])
sys.exit(0)
else:
print("Could not determine family name from config file!")
sys.exit(1)

toggle = False
sources = []
for line in data.splitlines():
if re.match("^sources:", line):
toggle = True
continue
if toggle:
m = re.match(r"^\s+-\s*(.*)", line)
if m:
sources.append("sources/"+m[1])
else:
toggle = False
if re.match("^sources:", line):
toggle = True
continue
if toggle:
m = re.match(r"^\s*-\s*(.*)", line)
if m:
sources.append("sources/" + m[1])
else:
toggle = False
if sources:
print(" ".join(sources))
sys.exit(0)
print(" ".join(sources))
sys.exit(0)
else:
print("Could not determine sources from config file!")
sys.exit(1)
print("Could not determine sources from config file!")
sys.exit(1)

0 comments on commit 2092e3f

Please sign in to comment.