-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (92 loc) · 4.26 KB
/
create-images.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Create Images
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
typeface: ["Zenbones-Mono", "Zenbones-Slab", "Zenbones-Brainy", "Zenbones-Proto"]
steps:
- uses: actions/checkout@v4
- name: Set up ImageMagick
run: |
sudo apt-get install imagemagick
export PATH=$PATH:/usr/bin:/usr/local/bin:/usr/local/imagemagick/bin
- name: Download release file
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release download --pattern ${{ matrix.typeface }}.tar.gz
- name: Install font
run: |
tar xzf ${{ matrix.typeface }}.tar.gz
sudo cp ${{ matrix.typeface }}/TTF/*.ttf /usr/local/share/fonts
sudo fc-cache -f -v
- name: Generate specimen image
run: |
rm -rf images
mkdir images
cd images
convert -size 1200x630 xc:'#f0edec' -gravity north -font ${{ matrix.typeface }} -pointsize 128 -fill '#2c363c' \
-draw "text 0,10 'Aa'" \
-gravity center \
-font ${{ matrix.typeface }} -pointsize 40 -fill '#2c363c' \
-draw "text 0,30 'ABC.DEF.GHI.JKL.MNO.PQRS.TUV.WXYZ abc.def.ghi.jkl.mno.pqrs.tuv.wxyz'" \
-gravity center \
-font ${{ matrix.typeface }} -pointsize 40 -fill '#2c363c' \
-draw "text 0,90 '!iIlL17|¦ ¢coO08BbDQ $5SZ2zs 96µm float il1[]={1-2/3.4,5+6=7/8%90};'" \
-gravity center \
-font ${{ matrix.typeface }} -pointsize 40 -fill '#2c363c' \
-draw "text 0,150 '1234567890 ,._-+= >< «¯-¬_» ~–÷+× {*}[]()<>\`+-=$/#_%^@\&|~?\'\" !,.;:'" \
-font ${{ matrix.typeface }} -pointsize 40 -fill '#2c363c' \
-draw "text 0,210 'CG6Qg9q¶ Þẞðþſß ΓΔΛαβγδιλμνξπτυχ∂ ЖЗКНРУЭЯавжзклмнруфчьыэя <= != =='" \
${{ matrix.typeface }}-specimen.png
- name: Upload specimen images
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.typeface }}-specimen
path: images/${{ matrix.typeface }}-specimen.png
- name: Generate weights image
run: |
convert -size 1200x390 xc:'#f0edec' \
-gravity north -font ${{ matrix.typeface }} -pointsize 45 -fill '#2c363c' \
-draw "text 0,20 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Italic -pointsize 45 -fill '#2c363c' \
-draw "text 0,80 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Semibold -pointsize 45 -fill '#2c363c' \
-draw "text 0,140 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Semibold-Italic -pointsize 45 -fill '#2c363c' \
-draw "text 0,200 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Bold -pointsize 45 -fill '#2c363c' \
-draw "text 0,260 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Bold-Italic -pointsize 45 -fill '#2c363c' \
-draw "text 0,320 'A quick brown fox jumps over the lazy dog'" \
-gravity north -font ${{ matrix.typeface }}-Semibold -pointsize 45 -fill '#2c363c' \
${{ matrix.typeface }}-weights.png
- name: Upload weight images
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.typeface }}-weights
path: ${{ matrix.typeface }}-weights.png
commit:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
path: images
merge-multiple: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: "chore(build): update images"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"