Skip to content

Commit

Permalink
moving to cli build
Browse files Browse the repository at this point in the history
  • Loading branch information
SargisYonan committed Jul 23, 2024
1 parent c221846 commit ee76ac8
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 28,505 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
venv
*(Autosaved).glyphs
nohadra/*
ufos/*
!nohadra/*.glyphs
48 changes: 32 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
OUTPUT_DIRS := nohadra
# Directory containing the Glyphs source files
GLYPHS_DIR := glyphs
GLYPH_FILES := $(foreach dir, $(GLYPHS_DIR), $(shell find $(dir) -name '*.glyphs' | grep -v ' (Autosaved).glyphs'))
# Directory to store the intermediate master UFO files
UFO_DIR := ufos
# Directory to store the generated font files
OUTPUT_DIR := fonts
FONT_EXTENSIONS := otf ttf woff woff2
FONTS_DIR := fonts

GLYPH_FILES := $(foreach dir, $(OUTPUT_DIRS), $(shell find $(dir) -name '*.glyphs' | grep -v ' (Autosaved).glyphs'))

SAMPLE_DIR := samples

all: build generate-png install test
Expand All @@ -14,27 +16,40 @@ venv/created: requirements.txt
touch venv/created

venv: venv/created
. venv/bin/activate

open:
for file in $(GLYPH_FILES); do \
if [ -f "$$file" ]; then \
open -a /Applications/Glyphs\ 3.app "$$file"; \
fi \
done
# Ensure the output directories exist
$(UFO_DIR):
mkdir -p $(UFO_DIR)

build:
for file in $(GLYPH_FILES); do \
if [ -f "$$file" ]; then \
osascript scripts/exportfont.scpt "$$file"; \
fi \
done
# Rule to generate master UFOs from Glyphs files
$(UFO_DIR)/%.designspace: $(GLYPHS_DIR)/%.glyphs | $(UFO_DIR) venv
. venv/bin/activate && \
fontmake -g $< -o ufo --output-dir $(UFO_DIR)

# Ensure the output directory exists
$(OUTPUT_DIR):
mkdir -p $(OUTPUT_DIR)

# Rule to build OTF fonts from master UFOs
$(OUTPUT_DIR)/%.otf: $(UFO_DIR)/%.designspace | $(OUTPUT_DIR) venv
. venv/bin/activate && \
fontmake -m $< -o otf --output-dir $(OUTPUT_DIR)

build: $(GLYPH_FILES:$(GLYPHS_DIR)/%.glyphs=$(OUTPUT_DIR)/%.otf)

install: build
./install_fonts.sh

test: venv
. venv/bin/activate; \
for file in $(FONTS_DIR)/*.otf; do \
for file in $(OUTPUT_DIR)/*.otf; do \
if [ -f "$$file" ]; then \
fontbakery check-opentype $$file; \
fontbakery check-universal $$file; \
Expand All @@ -43,20 +58,21 @@ test: venv

clean:
@for ext in $(FONT_EXTENSIONS); do \
for file in $(OUTPUT_DIRS)/*.$$ext; do \
for file in $(GLYPHS_DIR)/*.$$ext; do \
if [ -f "$$file" ]; then \
rm $$file; \
fi; \
done; \
done; \
rm -rf venv; \
rm -rf $(FONTS_DIR)/*
rm -rf samples/*
rm -rf $(OUTPUT_DIR)/*
rm -rf samples/*.png
rm -rf $(UFO_DIR)

# Target to generate PNG with Syriac sample text using Python
generate-png: venv
. venv/bin/activate && \
for file in $(FONTS_DIR)/*.otf; do \
for file in $(OUTPUT_DIR)/*.otf; do \
font=$$(basename "$$file" .otf); \
python3 scripts/render_text.py "$$file" "ܥܠ ܐܪܥܐ ܫܠܡܐ ܘܣܒܪܐ ܛܒܐ ܠܒܪܢܫ̈ܐ" "$(SAMPLE_DIR)/$$font.png"; \
python3 scripts/render_text.py "$$file" "ܢܘܗܕܪܐ" "$(SAMPLE_DIR)/$$font-nohadra-sample.png"; \
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The Nohadra Syriac Font family includes Syriac typefaces with square, block-like
<img src="samples/NohadraSyriac-Sapna-nohadra-sapna-text.png" alt="" width="400"/>
</p>

Sapna is a monospaced and minimal block style Syriac typeface. [View sample text](samples/index-sapna.html)
Sapna is a monospaced and minimal block style Syriac typeface.
<!-- [View sample text](samples/index-sapna.html) -->


<p align="center">
Expand All @@ -30,7 +31,8 @@ Sapna is a monospaced and minimal block style Syriac typeface. [View sample text
<img src="samples/NohadraSyriac-Amedia-nohadra-amedia-text.png" alt="" width="400"/>
</p>

Amedia offers the same look and feel as Sapna, but with rounder edges. [View sample text](samples/index-amedia.html)
Amedia offers the same look and feel as Sapna, but with rounder edges.
<!-- [View sample text](samples/index-amedia.html) -->

<p align="center">
<img src="samples/NohadraSyriac-Amedia.png" alt="" width="3000"/>
Expand Down
Binary file modified fonts/NohadraSyriac-Amedia.otf
Binary file not shown.
Binary file modified fonts/NohadraSyriac-Sapna.otf
Binary file not shown.
Loading

0 comments on commit ee76ac8

Please sign in to comment.