Skip to content

Commit

Permalink
Updating GoogleFonts Repository Template
Browse files Browse the repository at this point in the history
  • Loading branch information
d-sargent committed Jan 30, 2024
1 parent fa68d58 commit ab67496
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 184,964 deletions.
3 changes: 0 additions & 3 deletions .templaterc.json

This file was deleted.

16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ build: build.stamp

venv: venv/touchfile

venv-test: venv-test/touchfile

build.stamp: venv .init.stamp sources/config.yaml $(SOURCES)
rm -rf fonts
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp
Expand All @@ -30,17 +32,21 @@ 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 --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.'
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; 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
Expand Down
128 changes: 7 additions & 121 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,121 +1,7 @@
absl-py==1.4.0
appdirs==1.4.4
attrs==23.1.0
axisregistry==0.4.3
babelfont==3.0.1
beautifulsoup4==4.12.2
beziers==0.5.0
blackrenderer==0.6.0
booleanOperations==0.9.0
Brotli==1.0.9
bump2version==1.0.1
bumpfontversion==0.4.1
cattrs==23.1.2
certifi==2023.7.22
cffi==1.15.1
cffsubr==0.2.9.post1
charset-normalizer==3.2.0
click==8.1.7
cmarkgfm==2022.10.27
collidoscope==0.6.5
colorlog==6.7.0
commandlines==0.4.1
compreffor==0.5.4
cryptography==41.0.3
cu2qu==1.6.7.post2
defcon==0.10.2
dehinter==4.0.0
Deprecated==1.2.14
diffenator2==0.2.12
drawbot-skia==0.5.0
exceptiongroup==1.1.3
font-v==2.1.0
fontbakery==0.8.13
fontFeatures==1.8.0
fontmake==3.7.1
fontMath==0.9.3
fonttools==4.42.0
freetype-py==2.4.0
fs==2.4.16
gflanguages==0.5.4
gftools==0.9.33
gitdb==4.0.10
GitPython==3.1.32
glyphsets==0.6.2
glyphsLib==6.3.0
h11==0.14.0
hyperglot==0.4.5
idna==3.4
Jinja2==3.1.2
kurbopy==0.9.0
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
munkres==1.1.4
nanoemoji==0.15.1
ninja==1.11.1
numpy==1.25.2
openstep-plist==0.3.0.post1
opentype-sanitizer==9.1.0
opentypespec==1.9.1
orjson==3.9.5
outcome==1.2.0
packaging==23.1
picosvg==0.22.1
Pillow==10.0.0
pip-api==0.0.30
pngquant-cli==2.17.0.post5
protobuf==3.20.3
pyahocorasick==2.0.0
pybind11==2.11.1
pyclipper==1.3.0.post4
pycparser==2.21
pygit2==1.12.2
PyGithub==1.59.1
Pygments==2.16.1
PyJWT==2.8.0
PyNaCl==1.5.0
pyparsing==3.1.1
PySocks==1.7.1
python-bidi==0.4.2
python-dateutil==2.8.2
PyYAML==6.0.1
regex==2023.8.8
requests==2.31.0
resvg-cli==0.22.0.post3
rich==13.5.2
rstr==3.2.1
selenium==4.11.2
sh==2.0.6
six==1.16.0
skia-pathops==0.8.0
skia-python==87.5
smmap==5.0.0
sniffio==1.3.0
sortedcontainers==2.4.0
soupsieve==2.4.1
sre-yield==1.2
statmake==0.6.0
strictyaml==1.7.3
stringbrewer==0.0.1
tabulate==0.9.0
toml==0.10.2
tqdm==4.66.1
trio==0.22.2
trio-websocket==0.10.3
ttfautohint-py==0.5.1
typing_extensions==4.7.1
ufo2ft==2.33.4
ufoLib2==0.16.0
ufolint==1.2.0
uharfbuzz==0.37.2
unicodedata2==15.0.0
Unidecode==1.3.6
urllib3==2.0.4
vharfbuzz==0.2.0
vttLib==0.12.0
wrapt==1.15.0
wsproto==1.2.0
youseedee==0.3.0
zopfli==0.2.2
fontmake>=2.4
gftools[qa]>=0.9.23
drawbot-skia>=0.4.8
sh>=1.14.2
bumpfontversion>=0.2.0
diffenator2>=0.2.5

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)
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)
Loading

0 comments on commit ab67496

Please sign in to comment.