Skip to content

Commit

Permalink
updated project template, regenerated fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
juandelperal committed Mar 13, 2024
1 parent 7a5529c commit f0c712f
Show file tree
Hide file tree
Showing 180 changed files with 232 additions and 16 deletions.
46 changes: 33 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,55 @@
SOURCES=$(shell yq e '.sources.[] | sub("^","sources/")' sources/config.yaml )
FAMILY=$(shell yq e '.familyName' sources/config.yaml )
SOURCES=$(shell python3 scripts/read-config.py --sources )
FAMILY=$(shell python3 scripts/read-config.py --family )

help:
@echo "###"
@echo "# Build targets for $(FAMILY)"
@echo "###"
@echo
@echo " make build: Builds the fonts and places them in the fonts/ directory"
@echo " make test: Tests the fonts with fontbakery"
@echo " make proof: Creates HTML proof documents in the proof/ directory"
@echo " make build: Builds the fonts and places them in the fonts/ directory"
@echo " make test: Tests the fonts with fontbakery"
@echo " make proof: Creates HTML proof documents in the proof/ directory"
@echo

build: build.stamp sources/config.yaml $(SOURCES)
build: build.stamp

venv: venv/touchfile

build.stamp: venv
. venv/bin/activate; gftools builder sources/config.yaml; gftools builder sources/config-subrayada.yaml; python3 sources/vtt/hinting.py; sh alternates.sh; touch build.stamp
venv-test: venv-test/touchfile

customize: venv
. venv/bin/activate; python3 scripts/customize.py

build.stamp: venv sources/config.yaml $(SOURCES)
rm -rf fonts
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp
python3 sources/vtt/hinting.py; sh alternates.sh

venv/touchfile: requirements.txt
test -d venv || python3 -m venv venv
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/touchfile

test: venv build.stamp
. venv/bin/activate; mkdir fontbakery; fontbakery check-googlefonts --html fontbakery/fontbakery-report.html --ghmarkdown fontbakery/fontbakery-report.md $(shell find fonts -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; gftools gen-html proof $(shell find fonts/ttf -type f) -o proof
. venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $(shell find fonts/ttf -type f) -o out/proof

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

clean:
rm -rf venv
rm -rf sources/masters
find -iname "*.pyc" -delete
find . -name "*.pyc" -delete

update-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/

update:
pip install --upgrade $(dependency); pip freeze > requirements.txt
Binary file modified fonts-alternates/otf/MontserratAlternates-Black.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-BlackItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Bold.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-BoldItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-ExtraBold.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-ExtraBoldItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-ExtraLight.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-ExtraLightItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Italic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Light.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-LightItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Medium.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-MediumItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Regular.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-SemiBold.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-SemiBoldItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-Thin.otf
Binary file not shown.
Binary file modified fonts-alternates/otf/MontserratAlternates-ThinItalic.otf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Black.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-BlackItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Bold.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-BoldItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-ExtraBold.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-ExtraBoldItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-ExtraLight.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-ExtraLightItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Italic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Light.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-LightItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Medium.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-MediumItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Regular.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-SemiBold.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-SemiBoldItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-Thin.ttf
Binary file not shown.
Binary file modified fonts-alternates/ttf/MontserratAlternates-ThinItalic.ttf
Binary file not shown.
Binary file modified fonts-alternates/variable/MontserratAlternates-Italic[wght].ttf
Binary file not shown.
Binary file modified fonts-alternates/variable/MontserratAlternates[wght].ttf
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Black.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-BlackItalic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Bold.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-BoldItalic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-ExtraBold.woff2
Binary file not shown.
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-ExtraLight.woff2
Binary file not shown.
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Italic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Italic[wght].woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Light.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-LightItalic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Medium.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-MediumItalic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Regular.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-SemiBold.woff2
Binary file not shown.
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-Thin.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates-ThinItalic.woff2
Binary file not shown.
Binary file modified fonts-alternates/webfonts/MontserratAlternates[wght].woff2
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Black.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-BlackItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Bold.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-BoldItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-ExtraBold.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-ExtraBoldItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-ExtraLight.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-ExtraLightItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Italic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Light.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-LightItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Medium.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-MediumItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Regular.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-SemiBold.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-SemiBoldItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-Thin.otf
Binary file not shown.
Binary file modified fonts-subrayada/otf/MontserratSubrayada-ThinItalic.otf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Black.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-BlackItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Bold.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-BoldItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-ExtraBold.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-ExtraBoldItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-ExtraLight.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-ExtraLightItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Italic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Light.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-LightItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Medium.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-MediumItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Regular.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-SemiBold.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-SemiBoldItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-Thin.ttf
Binary file not shown.
Binary file modified fonts-subrayada/ttf/MontserratSubrayada-ThinItalic.ttf
Binary file not shown.
Binary file modified fonts-subrayada/variable/MontserratSubrayada-Italic[wght].ttf
Binary file not shown.
Binary file modified fonts-subrayada/variable/MontserratSubrayada[wght].ttf
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Black.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-BlackItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Bold.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-BoldItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-ExtraBold.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-ExtraBoldItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-ExtraLight.woff2
Binary file not shown.
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Italic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Italic[wght].woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Light.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-LightItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Medium.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-MediumItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Regular.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-SemiBold.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-SemiBoldItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-Thin.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada-ThinItalic.woff2
Binary file not shown.
Binary file modified fonts-subrayada/webfonts/MontserratSubrayada[wght].woff2
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Black.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-BlackItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Bold.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-BoldItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-ExtraBold.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-ExtraBoldItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-ExtraLight.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-ExtraLightItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Italic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Light.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-LightItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Medium.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-MediumItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Regular.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-SemiBold.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-SemiBoldItalic.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-Thin.otf
Binary file not shown.
Binary file modified fonts/otf/Montserrat-ThinItalic.otf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Black.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-BlackItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Bold.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-BoldItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-ExtraBold.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-ExtraBoldItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-ExtraLight.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-ExtraLightItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Italic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Light.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-LightItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Medium.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-MediumItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Regular.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-SemiBold.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-SemiBoldItalic.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-Thin.ttf
Binary file not shown.
Binary file modified fonts/ttf/Montserrat-ThinItalic.ttf
Binary file not shown.
Binary file modified fonts/variable/Montserrat-Italic[wght].ttf
Binary file not shown.
Binary file modified fonts/variable/Montserrat[wght].ttf
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Black.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-BlackItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Bold.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-BoldItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-ExtraBold.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-ExtraBoldItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-ExtraLight.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-ExtraLightItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Italic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Italic[wght].woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Light.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-LightItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Medium.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-MediumItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Regular.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-SemiBold.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-SemiBoldItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-Thin.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat-ThinItalic.woff2
Binary file not shown.
Binary file modified fonts/webfonts/Montserrat[wght].woff2
Binary file not shown.
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
vttmisc
vttlib
opentype-feature-freezer
gftools[qa]==0.9.48
fontmake>=2.4
fontbakery[googlefonts]
gftools[qa]==0.9.48
drawbot-skia>=0.4.8
sh>=1.14.2
bumpfontversion>=0.2.0
diffenator2>=0.2.5
bumpfontversion>=0.2.0
fontbakery[googlefonts]
123 changes: 123 additions & 0 deletions scripts/customize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/usr/bin/env python3

# This script is run by the user using `make customize` after the repository
# is cloned. If you are reading this because `make customize` failed,
# skip down to the section headed "INITIALIZATION STEPS".

from sh import git
import datetime
import re
import sys
from urllib.parse import quote
import subprocess
import requests

BASE_OWNER = "googlefonts"
BASE_REPONAME = "googlefonts-project-template"
DUMMY_URL = "https://yourname.github.io/your-font-repository-name"
LATEST_OFL = "https://raw.githubusercontent.com/googlefonts/googlefonts-project-template/main/OFL.txt"


def repo_url(owner, name):
return f"https://github.com/{owner}/{name}"


def web_url(owner, name):
return f"https://{owner}.github.io/{name}"


def raw_url(owner, name):
return f"https://raw.githubusercontent.com/{owner}/{name}"


def lose(msg, e=None):
print(msg)
print("You will need to do the initialization steps manually.")
print("Read scripts/customize.py for more instructions how to do this.")
if e:
print(
"\nHere's an additional error message which may help diagnose the problem."
)
raise e
sys.exit(1)


try:
my_repo_url = git.remote("get-url", "origin")
except Exception as e:
lose("Could not use git to find my own repository URL", e)

m = re.match(r"(?:https://github.com/|[email protected]:)(.*)/(.*)/?", str(my_repo_url))
if not m:
lose(
f"My git repository URL ({my_repo_url}) didn't look what I expected - are you hosting this on github?"
)

owner, reponame = m[1], m[2]

if owner == BASE_OWNER and reponame == BASE_REPONAME:
print("I am being run on the upstream repository; don't do that")
sys.exit()

# INITIALIZATION STEPS

# First, the README file contains URLs to pages in the `gh-pages` branch of the
# repo. When initially cloned, these URLs will point to the
# googlefonts/Unified-Font-Repository itself. But downstream users want links
# and badges about their own font, not ours! So any URLs need to be adjusted to
# refer to the end user's repository.

# We will also pin the dependencies so future builds are reproducible.

readme = open("README.md").read()
ghpages_url = web_url(owner, reponame)
project_url = repo_url(owner, reponame)

print("Fixing URLs:", web_url(BASE_OWNER, BASE_REPONAME), "->", ghpages_url)

readme = readme.replace(web_url(BASE_OWNER, BASE_REPONAME), ghpages_url)
# In the badges, the URLs to raw.githubusercontent.com are URL-encoded as they
# are passed to shields.io.
readme = readme.replace(
quote(raw_url(BASE_OWNER, BASE_REPONAME), safe=""),
quote(raw_url(owner, reponame), safe=""),
)

print("Fixing URLs:", DUMMY_URL, "->", ghpages_url)
readme = readme.replace(f"`{DUMMY_URL}`", ghpages_url)

with open("README.md", "w") as fh:
fh.write(readme)

git.add("README.md")

# Fix the OFL
year = datetime.date.today().year
title = reponame.title()
copyright = f"Copyright {year} The {title} Project Authors ({project_url})\n"
print("Fetching the latest OFL..")
ofl = requests.get(LATEST_OFL).text.splitlines()
print("Writing an OFL for you")
print(copyright)
with open("OFL.txt", "w") as fh:
fh.write(copyright)
fh.write("\n".join(ofl[1:]))

git.add("OFL.txt")

# Pin the dependencies
print("Pinning dependencies")
dependencies = subprocess.check_output(["pip", "freeze"])
with open("requirements.txt", "wb") as dependency_file:
dependency_file.write(dependencies)
git.add("requirements.txt")

# Did anything change?
result = git.status("--porcelain")
if any(line.startswith("M ") for line in result.splitlines()):
git.commit("-m", "Customize repository")

print("Pushing changes to GitHub")
git.push()
else:
print("Nothing changed, no need to push")
19 changes: 19 additions & 0 deletions scripts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My Font development</title>
</head>
<body>
<h1>My Font testing pages</h1>
<ul>
<li>
<a href="fontbakery/fontbakery-report.html">FontBakery Report</a>
</li>
<li>
<a href="proof/diffenator2-report.html">Diffenator2 Report</a>
</li>
</ul>
</body>
</html>
45 changes: 45 additions & 0 deletions scripts/read-config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
# Yes, this is a Bad YAML Parser, but at this stage we are not in the
# venv and do not know what modules the user has available, so for
# maximum compatibility, we are just assuming a plain Python distribution.
import argparse
import re
import sys
import os

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")
args = parser.parse_args()

with open(os.path.join("sources", "config.yaml")) as config:
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)

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 sources:
print(" ".join(sources))
sys.exit(0)
else:
print("Could not determine sources from config file!")
sys.exit(1)
8 changes: 8 additions & 0 deletions scripts/update-custom-filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import requests

GF_Latin_All = "https://github.com/googlefonts/glyphsets/raw/main/GF_glyphsets/Latin/glyphs/CustomFilter_GF_Latin.plist"
dest = "sources/CustomFilter_GF_Latin_All.plist"

r = requests.get(GF_Latin_All)
with open(dest, "wb") as f:
f.write(r.content)

0 comments on commit f0c712f

Please sign in to comment.