diff --git a/vascadia.sh b/vascadia.sh deleted file mode 100755 index 123b7bf..0000000 --- a/vascadia.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env zsh -### -# https://github.com/microsoft/cascadia-code -# ss01 - handwritten italic -# ss02 - lua not equals ~= -# ss03 - serbian locale -# ss19 - slashed zero 0 -# ss20 - graphical control characters -### -# opentype-feature-freezer is necessary, install with pipx or pip -# pip install --upgrade opentype-feature-freezer -### -# This script generates an archive with "baked in" stylistic sets -# for the best compatibility. -### - -VERSION=2407.24 - -NAME=Vascadia -WDIR=$HOME/vascadia - -SS=ss01,ss02,ss19,ss20 - -SRC=CascadiaCode-$VERSION.zip -URL=https://github.com/microsoft/cascadia-code/releases/download/v$VERSION/$SRC - -function prep { - typeset archive=$WDIR/$SRC - mkdir -p $WDIR - [[ -r $archive ]] || wget -P $WDIR $URL - unzip $archive 'otf/**' -d $WDIR -} - -function venv { - typeset venv_dir=$WDIR/.venv - python3 -m venv $venv_dir - source $venv_dir/bin/activate - pip install --upgrade pip opentype-feature-freezer -} - -function convert { - typeset dst_dir=$WDIR/$NAME - mkdir -p $dst_dir - while read -r src; do - # an ugly hack to replace C with V, don't judge me - dst=V${src##*/C} - - pyftfeatfreeze -f $SS -R Cascadia/$NAME $src $dst_dir/$dst - done -} - -function cleanup { - typeset source=$WDIR/$NAME - typeset archive=$source-$VERSION.zip - zip -rv $archive $source - rm -rv $source $WDIR/otf -} - -function main { - set -ex - prep - venv - convert < <(find $WDIR/otf -type f -name '*.otf') - cleanup -} - -main $@ diff --git a/vcascadia-gen.sh b/vcascadia-gen.sh new file mode 100755 index 0000000..4f0dc8d --- /dev/null +++ b/vcascadia-gen.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env zsh +### +# https://github.com/microsoft/cascadia-code +# ss01 - handwritten italic +# ss02 - lua not equals ~= +# ss03 - serbian locale +# ss19 - slashed zero 0 +# ss20 - graphical control characters +### +# opentype-feature-freezer is necessary, install with pipx or pip +# pipx install --upgrade opentype-feature-freezer +### + +title='Cascadia Mono NF' +orig=CascadiaMonoNF +name=VascadiaMod +arch=$name.tgz +ss=ss01,ss19,ss20 + +for font in $orig*.otf; do + src=$font + dst=${font/$orig/$name} + + pyftfeatfreeze -f $ss -R "$title/$name" $src $dst +done + +eval tar -acvf $arch $name*