Skip to content

Commit

Permalink
Add missing glyphs
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienSozeau committed Jan 7, 2025
1 parent 9b44480 commit 90147b9
Show file tree
Hide file tree
Showing 14 changed files with 112,334 additions and 32,986 deletions.
37 changes: 35 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
*~
venv
.DS_Store
venv-test
build.stamp
node_modules
package-lock.json
package.json
master_ufo
instance_ufos
.ninja_log
build.ninja
build.stamp

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Autosaved by application when editing
######################
*(تم الحفظ تلقائيًا).*
*(automaticky uloženo).*
*(Automatisch gesichert).*
*(Autosaved).*
*(guardado automáticamente).*
*(enregistré automatiquement).*
*(salvato automaticamente).*
*(自動保存).*
*(자동 저장됨).*
*(Salvo Automaticamente).*
*(Автосохранение).*
*(Otomatik Kaydedildi).*
*(自动存储).*
*(已自動儲存).*
45 changes: 31 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,53 @@ build: build.stamp

venv: venv/touchfile

build.stamp: venv .init.stamp sources/config.yaml $(SOURCES)
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

.init.stamp: venv
. venv/bin/activate; python3 scripts/first-run.py

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 -p docs/ docs/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges docs/fontbakery --html docs/fontbakery/fontbakery-report.html --ghmarkdown docs/fontbakery/fontbakery-report.md $(shell find fonts/ttf -type f) -o docs/fontbakery || 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
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv-test/bin/activate; mkdir -p docs/ docs/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges docs/badges --html docs/fontbakery/fontbakery-report.html --ghmarkdown docs/fontbakery/fontbakery-report.md $$TOCHECK || 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 docs/ docs/proof; diffenator2 proof $(shell find fonts/ttf -type f) -o docs/proof
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 docs/ docs/proof; diffenator2 proof $$TOCHECK -o docs/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-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/

update:
pip install --upgrade $(dependency); pip freeze > requirements.txt
update: venv venv-test
venv/bin/pip install --upgrade pip-tools
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
# the `--resolver` flag below.
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
venv/bin/pip-sync requirements.txt

venv-test/bin/pip install --upgrade pip-tools
venv-test/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements-test.in
venv-test/bin/pip-sync requirements-test.txt

git commit -m "Update requirements" requirements.txt requirements-test.txt
git push
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[![][Fontbakery]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][Universal]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][GF Profile]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][Outline Correctness]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][Shaping]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)

[Fontbakery]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/fontbakery/overall.json
[GF Profile]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/fontbakery/GoogleFonts.json
[Outline Correctness]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/fontbakery/OutlineCorrectnessChecks.json
[Shaping]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/fontbakery/ShapingChecks.json
[Universal]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/fontbakery/Universal.json
[![][Outline Checks]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][Font File Checks]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)
[![][OpenType Specification Checks]](https://noirblancrouge.github.io/LibertineSuper/fontbakery/fontbakery-report.html)

[Fontbakery]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/badges/overall.json
[Outline Checks]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/badges/OutlineChecks.json
[Font File Checks]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/badges/FontFileChecks.json
[Universal]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/badges/UniversalProfileChecks.json
[OpenType Specification Checks]: https://img.shields.io/endpoint?url=https://noirblancrouge.github.io/LibertineSuper/badges/OpenTypeSpecificationChecks.json

![Cover](https://raw.githubusercontent.com/noirblancrouge/LibertineSuper/master/documentation/images/libertinesuper.jpg)

Expand Down
137 changes: 137 additions & 0 deletions documentation/image1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# This script is meant to be run from the root level
# of your font's git repository. For example, from a Unix terminal:
# $ git clone my-font
# $ cd my-font
# $ python3 documentation/image1.py --output documentation/image1.png

# Import moduels from external python packages: https://pypi.org/
from drawbot_skia.drawbot import *
from fontTools.ttLib import TTFont
from fontTools.misc.fixedTools import floatToFixedToStr

# Import moduels from the Python Standard Library: https://docs.python.org/3/library/
import subprocess
import sys
import argparse

# Constants, these are the main "settings" for the image
WIDTH, HEIGHT, MARGIN, FRAMES = 2048, 1024, 128, 1
FONT_PATH = "fonts/ttf/RadioCanadaDisplay-Regular.ttf"
FONT_LICENSE = "OFL v1.1"
AUXILIARY_FONT = "Helvetica"
AUXILIARY_FONT_SIZE = 48

BIG_TEXT = "AaBb"
BIG_TEXT_FONT_SIZE = 730
BIG_TEXT_SIDE_MARGIN = MARGIN * 1
BIG_TEXT_BOTTOM_MARGIN = MARGIN * 2

GRID_VIEW = False # Toggle this for a grid overlay

# Handel the "--output" flag
# For example: $ python3 documentation/image1.py --output documentation/image1.png
parser = argparse.ArgumentParser()
parser.add_argument("--output", metavar="PNG", help="where to write the PNG file")
args = parser.parse_args()

# Load the font with the parts of fonttools that are imported with the line:
# from fontTools.ttLib import TTFont
# Docs Link: https://fonttools.readthedocs.io/en/latest/ttLib/ttFont.html
ttFont = TTFont(FONT_PATH)

# Constants that are worked out dynamically
MY_URL = subprocess.check_output("git remote get-url origin", shell=True).decode()
MY_HASH = subprocess.check_output("git rev-parse --short HEAD", shell=True).decode()
FONT_NAME = ttFont["name"].getDebugName(4)
FONT_VERSION = "v%s" % floatToFixedToStr(ttFont["head"].fontRevision, 16)


# Draws a grid
def grid():
stroke(1, 0, 0, 0.75)
strokeWidth(2)
STEP_X, STEP_Y = 0, 0
INCREMENT_X, INCREMENT_Y = MARGIN / 2, MARGIN / 2
rect(MARGIN, MARGIN, WIDTH - (MARGIN * 2), HEIGHT - (MARGIN * 2))
for x in range(29):
polygon((MARGIN + STEP_X, MARGIN), (MARGIN + STEP_X, HEIGHT - MARGIN))
STEP_X += INCREMENT_X
for y in range(29):
polygon((MARGIN, MARGIN + STEP_Y), (WIDTH - MARGIN, MARGIN + STEP_Y))
STEP_Y += INCREMENT_Y
polygon((WIDTH / 2, 0), (WIDTH / 2, HEIGHT))
polygon((0, HEIGHT / 2), (WIDTH, HEIGHT / 2))


# Remap input range to VF axis range
# This is useful for animation
# (E.g. sinewave(-1,1) to wght(100,900))
def remap(value, inputMin, inputMax, outputMin, outputMax):
inputSpan = inputMax - inputMin # FIND INPUT RANGE SPAN
outputSpan = outputMax - outputMin # FIND OUTPUT RANGE SPAN
valueScaled = float(value - inputMin) / float(inputSpan)
return outputMin + (valueScaled * outputSpan)


# Draw the page/frame and a grid if "GRID_VIEW" is set to "True"
def draw_background():
newPage(WIDTH, HEIGHT)
fill(0)
rect(-2, -2, WIDTH + 2, HEIGHT + 2)
if GRID_VIEW:
grid()
else:
pass


# Draw main text
def draw_main_text():
fill(1)
stroke(None)
font(FONT_PATH)
fontSize(BIG_TEXT_FONT_SIZE)
# Adjust this line to center main text manually.
# TODO: This should be done automatically when drawbot-skia
# has support for textBox() and FormattedString
#text(BIG_TEXT, ((WIDTH / 2) - MARGIN * 4.75, (HEIGHT / 2) - MARGIN * 2.5))
text(BIG_TEXT, (BIG_TEXT_SIDE_MARGIN, BIG_TEXT_BOTTOM_MARGIN))


# Divider lines
def draw_divider_lines():
stroke(1)
strokeWidth(5)
lineCap("round")
line((MARGIN, HEIGHT - (MARGIN * 1.5)), (WIDTH - MARGIN, HEIGHT - (MARGIN * 1.5)))
line((MARGIN, MARGIN + (MARGIN / 2)), (WIDTH - MARGIN, MARGIN + (MARGIN / 2)))
stroke(None)


# Draw text describing the font and it's git status & repo URL
def draw_auxiliary_text():
# Setup
font(AUXILIARY_FONT)
fontSize(AUXILIARY_FONT_SIZE)
POS_TOP_LEFT = (MARGIN, HEIGHT - MARGIN * 1.25)
POS_TOP_RIGHT = (WIDTH - MARGIN, HEIGHT - MARGIN * 1.25)
POS_BOTTOM_LEFT = (MARGIN, MARGIN)
POS_BOTTOM_RIGHT = (WIDTH - MARGIN * 0.95, MARGIN)
URL_AND_HASH = MY_URL + "at commit " + MY_HASH
URL_AND_HASH = URL_AND_HASH.replace("\n", " ")
# Draw Text
text(FONT_NAME, POS_TOP_LEFT, align="left")
text(FONT_VERSION, POS_TOP_RIGHT, align="right")
text(URL_AND_HASH, POS_BOTTOM_LEFT, align="left")
text(FONT_LICENSE, POS_BOTTOM_RIGHT, align="right")


# Build and save the image
if __name__ == "__main__":
draw_background()
draw_main_text()
draw_divider_lines()
draw_auxiliary_text()
# Save output, using the "--output" flag location
saveImage(args.output)
# Print done in the terminal
print("DrawBot: Done")
7 changes: 7 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"rangeStrategy": "bump"
}
2 changes: 2 additions & 0 deletions requirements-test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fontbakery[googlefonts]>=0.9.2
gftools[qa]>=0.9.23
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Placeholder file, update the requirements by running `make update`.
-r requirements-test.in
6 changes: 6 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fontmake>=3.9.0
gftools[qa]>=0.9.54
drawbot-skia>=0.5.0
sh>=2.0.6
bumpfontversion>=0.4.1
diffenator2>=0.3.8
Loading

0 comments on commit 90147b9

Please sign in to comment.