diff options
Diffstat (limited to 'clock/mkicons.sh')
| -rwxr-xr-x | clock/mkicons.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clock/mkicons.sh b/clock/mkicons.sh new file mode 100755 index 0000000..7825e80 --- /dev/null +++ b/clock/mkicons.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# mkicons.sh - build the weather icon subset font for the KWGT clock +# Copyright (C) 2026 Danilo M. <danix@danix.xyz> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# Build the weather icon font: Material Symbols Rounded (Apache-2.0), outline +# style at weight 400, cut down to the glyphs the preset's weather formula uses. +# Needs fontTools (build-time only). +# +# usage: mkicons.sh <MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf> <out.ttf> +# +# Codepoints: sunny clear_night partly_cloudy_day partly_cloudy_night cloud +# foggy air rainy_light rainy thunderstorm weather_mix weather_snowy +# weather_hail tornado. +set -e +tmp=$(mktemp) +trap 'rm -f "$tmp"' EXIT +fonttools varLib.instancer "$1" FILL=0 GRAD=0 opsz=24 wght=400 -o "$tmp" +pyftsubset "$tmp" --output-file="$2" --layout-features='' --name-IDs='*' \ + --unicodes=e81a,f159,f172,f174,f15c,e818,efd8,f61e,f176,ebdb,f60b,e2cd,f67f,e199 |
