-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated project template, regenerated fonts
- Loading branch information
1 parent
7a5529c
commit f0c712f
Showing
180 changed files
with
232 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/otf/MontserratAlternates-ExtraBoldItalic.otf
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/otf/MontserratAlternates-ExtraLightItalic.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-92 Bytes
(100%)
fonts-alternates/otf/MontserratAlternates-MediumItalic.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-72 Bytes
(100%)
fonts-alternates/otf/MontserratAlternates-SemiBoldItalic.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-84 Bytes
(100%)
fonts-alternates/ttf/MontserratAlternates-ExtraBoldItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/ttf/MontserratAlternates-ExtraLightItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-96 Bytes
(100%)
fonts-alternates/ttf/MontserratAlternates-MediumItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-80 Bytes
(100%)
fonts-alternates/ttf/MontserratAlternates-SemiBoldItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-112 Bytes
(100%)
fonts-alternates/variable/MontserratAlternates-Italic[wght].ttf
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-84 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Black.woff2
Binary file not shown.
Binary file modified
BIN
-64 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-BlackItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-60 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-BoldItalic.woff2
Binary file not shown.
Binary file modified
BIN
-84 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-ExtraBold.woff2
Binary file not shown.
Binary file modified
BIN
-84 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-ExtraBoldItalic.woff2
Binary file not shown.
Binary file modified
BIN
-76 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-ExtraLight.woff2
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-ExtraLightItalic.woff2
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Italic.woff2
Binary file not shown.
Binary file modified
BIN
-112 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Italic[wght].woff2
Binary file not shown.
Binary file modified
BIN
-76 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Light.woff2
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-LightItalic.woff2
Binary file not shown.
Binary file modified
BIN
-32 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Medium.woff2
Binary file not shown.
Binary file modified
BIN
-96 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-MediumItalic.woff2
Binary file not shown.
Binary file modified
BIN
-88 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-Regular.woff2
Binary file not shown.
Binary file modified
BIN
-76 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-SemiBold.woff2
Binary file not shown.
Binary file modified
BIN
-80 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-SemiBoldItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-76 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates-ThinItalic.woff2
Binary file not shown.
Binary file modified
BIN
-124 Bytes
(100%)
fonts-alternates/webfonts/MontserratAlternates[wght].woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-2.07 KB
(100%)
fonts-subrayada/otf/MontserratSubrayada-ExtraBoldItalic.otf
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-2.21 KB
(100%)
fonts-subrayada/otf/MontserratSubrayada-ExtraLightItalic.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-3.33 KB
(99%)
fonts-subrayada/ttf/MontserratSubrayada-ExtraLightItalic.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-4.49 KB
(99%)
fonts-subrayada/variable/MontserratSubrayada-Italic[wght].ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-792 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-BlackItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-812 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-BoldItalic.woff2
Binary file not shown.
Binary file modified
BIN
-1004 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-ExtraBold.woff2
Binary file not shown.
Binary file modified
BIN
-960 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-ExtraBoldItalic.woff2
Binary file not shown.
Binary file modified
BIN
-996 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-ExtraLight.woff2
Binary file not shown.
Binary file modified
BIN
-1.18 KB
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-ExtraLightItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-1.62 KB
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-Italic[wght].woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-876 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-LightItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-956 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-MediumItalic.woff2
Binary file not shown.
Binary file modified
BIN
-1004 Bytes
(99%)
fonts-subrayada/webfonts/MontserratSubrayada-Regular.woff2
Binary file not shown.
Binary file modified
BIN
-408 Bytes
(100%)
fonts-subrayada/webfonts/MontserratSubrayada-SemiBold.woff2
Binary file not shown.
Binary file modified
BIN
-392 Bytes
(100%)
fonts-subrayada/webfonts/MontserratSubrayada-SemiBoldItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-252 Bytes
(100%)
fonts-subrayada/webfonts/MontserratSubrayada-ThinItalic.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |