-
Notifications
You must be signed in to change notification settings - Fork 12
83 lines (73 loc) · 2.67 KB
/
build.yml
File metadata and controls
83 lines (73 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build NotoSansPro Font
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- 'tools/fontslist/urls.txt'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Fonts From URLs
run: |
set -e
mkdir -p tools/fontslist build
count=0
while read -r path; do
[[ "$path" =~ ^\s*(#|$) ]] && continue
if [[ "$path" =~ :// ]]; then
url="$path"
else
url="https://${path#//}"
fi
file="${url##*/}"
echo "Downloading $url"
wget --timeout=30 --tries=3 -O "tools/fontslist/$file" "$url"
count=$((count+1))
done < tools/fontslist/urls.txt
echo "Download complete: $count font files"
- name: Build and Merge All Fonts
run: |
set -euo pipefail
chmod +x tools/{otfccdump,merge-otd,otfccbuild}
workdir=$(mktemp -d)
trap 'rm -rf "$workdir"' EXIT
echo "Converting fonts to .otd..."
for font in tools/fontslist/*.{ttf,otf}; do
[[ -e "$font" ]] || continue
base=$(basename "$font" | sed 's/\.\(ttf\|otf\)$//')
out="$workdir/${base}.otd"
echo " ➡️ $font → $out"
if ! ./tools/otfccdump --ignore-hints "$font" -o "$out"; then
echo "⚠️ Warning: failed to process $font, skipping." >&2
continue
fi
done
echo "Collecting .otd files and sorting by size..."
mapfile -t otd_files < <(ls -1S "$workdir"/*.otd)
if [[ ${#otd_files[@]} -eq 0 ]]; then
echo "❌ No .otd files found, exiting."
exit 1
fi
echo "Merging .otd files into notosanspro.otd..."
./tools/merge-otd -o notosanspro.otd -n "Noto Sans Pro;400;5;Normal" "${otd_files[@]}"
echo "Building final OpenType font NotoSansPro.otf..."
./tools/otfccbuild notosanspro.otd -O1 -o build/NotoSansPro.otf
cp notosanspro.otd build/
cp -r tools/fontslist build/
echo "✅ Build complete: build/NotoSansPro.otf, build/notosanspro.otd"
- name: Remove Emoji Overlap
run: |
python3 -m pip install --upgrade pip
pip install fonttools
git clone --depth=1 https://github.com/googlefonts/noto-emoji.git
python script/remove_emoji_overlap.py noto-emoji/colrv1/all.toml build/NotoSansPro.otf
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NotoSansPro-Build-OUTPUT
path: build