diff options
| author | gamerdonkey | 2024-09-14 16:00:46 -0500 |
|---|---|---|
| committer | gamerdonkey | 2024-09-14 16:00:46 -0500 |
| commit | 8909bb8e8c915d105daaf7d1fd03546af5ab4d94 (patch) | |
| tree | 41c989043795df4a21f1c6ecbf674a46b77a7b94 /components/fasani__adafruit_gfx/fontconvert/makefonts.sh | |
| parent | 35ff74c9be46e16030d1184a506451e1d3805c25 (diff) | |
| download | esp32-inova-led-controller-8909bb8e8c915d105daaf7d1fd03546af5ab4d94.tar.gz esp32-inova-led-controller-8909bb8e8c915d105daaf7d1fd03546af5ab4d94.tar.bz2 esp32-inova-led-controller-8909bb8e8c915d105daaf7d1fd03546af5ab4d94.zip | |
Changing to use an Adafruit_GFX library from components repo.
Diffstat (limited to 'components/fasani__adafruit_gfx/fontconvert/makefonts.sh')
| -rwxr-xr-x | components/fasani__adafruit_gfx/fontconvert/makefonts.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/components/fasani__adafruit_gfx/fontconvert/makefonts.sh b/components/fasani__adafruit_gfx/fontconvert/makefonts.sh new file mode 100755 index 0000000..35f07ea --- /dev/null +++ b/components/fasani__adafruit_gfx/fontconvert/makefonts.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Ugly little Bash script, generates a set of .h files for GFX using +# GNU FreeFont sources. There are three fonts: 'Mono' (Courier-like), +# 'Sans' (Helvetica-like) and 'Serif' (Times-like); four styles: regular, +# bold, oblique or italic, and bold+oblique or bold+italic; and four +# sizes: 9, 12, 18 and 24 point. No real error checking or anything, +# this just powers through all the combinations, calling the fontconvert +# utility and redirecting the output to a .h file for each combo. + +# Adafruit_GFX repository does not include the source outline fonts +# (huge zipfile, different license) but they're easily acquired: +# http://savannah.gnu.org/projects/freefont/ + +convert=./fontconvert +inpath=~/Desktop/freefont/ +outpath=../Fonts/ +fonts=(FreeMono FreeSans FreeSerif) +styles=("" Bold Italic BoldItalic Oblique BoldOblique) +sizes=(9 12 18 24) + +for f in ${fonts[*]} +do + for index in ${!styles[*]} + do + st=${styles[$index]} + for si in ${sizes[*]} + do + infile=$inpath$f$st".ttf" + if [ -f $infile ] # Does source combination exist? + then + outfile=$outpath$f$st$si"pt7b.h" +# printf "%s %s %s > %s\n" $convert $infile $si $outfile + $convert $infile $si > $outfile + fi + done + done +done |
