move template to the gen script, rewrite generation
This commit is contained in:
parent
4b81579c31
commit
c3704d83d4
4 changed files with 57 additions and 54 deletions
12
README.md
12
README.md
|
@ -1,10 +1,12 @@
|
|||
OTF version of cascadia fonts
|
||||
=============================
|
||||
|
||||
this is the cask that installs cascadia fonts, but not the dynamic ttf version
|
||||
These casks provide cascadia fonts in static otf version instead of dynamic ttf.
|
||||
|
||||
as terminals on macos display text weird when using ttf
|
||||
The reason it may be useful is because terminals on MacOS don't hint properly with dynamic ttf.
|
||||
|
||||
to update: set versoin and checksum in gen.sh and run it
|
||||
|
||||
depends on envsubst
|
||||
In case the font gets updated:
|
||||
```
|
||||
$EDITOR gen-casks
|
||||
./gen-casks
|
||||
```
|
||||
|
|
50
gen-casks
Executable file
50
gen-casks
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env zsh
|
||||
VERSION='2407.24'
|
||||
CHECKSUM='e67a68ee3386db63f48b9054bd196ea752bc6a4ebb4df35adce6733da50c8474'
|
||||
FONTS=(
|
||||
'Cascadia Code'
|
||||
'Cascadia Code PL'
|
||||
'Cascadia Code NF'
|
||||
'Cascadia Mono'
|
||||
'Cascadia Mono PL'
|
||||
'Cascadia Mono NF'
|
||||
)
|
||||
|
||||
for font in $FONTS[@]; do
|
||||
base="${font// /}"
|
||||
cask="otf-${${font:l}// /-}"
|
||||
cat > Casks/$cask.rb <<-EOF
|
||||
cask "$cask" do
|
||||
version "$VERSION"
|
||||
sha256 "$CHECKSUM"
|
||||
|
||||
url "https://github.com/microsoft/cascadia-code/releases/download/v#{version}/CascadiaCode-#{version}.zip"
|
||||
name "$font"
|
||||
homepage "https://github.com/microsoft/cascadia-code"
|
||||
|
||||
livecheck do
|
||||
url :url
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
font "otf/static/$base-Bold.otf"
|
||||
font "otf/static/$base-BoldItalic.otf"
|
||||
font "otf/static/$base-ExtraLight.otf"
|
||||
font "otf/static/$base-ExtraLightItalic.otf"
|
||||
font "otf/static/$base-Italic.otf"
|
||||
font "otf/static/$base-Light.otf"
|
||||
font "otf/static/$base-LightItalic.otf"
|
||||
font "otf/static/$base-Regular.otf"
|
||||
font "otf/static/$base-SemiBold.otf"
|
||||
font "otf/static/$base-SemiBoldItalic.otf"
|
||||
font "otf/static/$base-SemiLight.otf"
|
||||
font "otf/static/$base-SemiLightItalic.otf"
|
||||
end
|
||||
EOF
|
||||
done
|
||||
|
||||
[[ $1 != commit ]] && exit
|
||||
|
||||
git add Casks
|
||||
git commit -m "updated: $VERSION"
|
||||
git push
|
21
gen.sh
21
gen.sh
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
export VERSION=2407.24
|
||||
export CHECKSUM=e67a68ee3386db63f48b9054bd196ea752bc6a4ebb4df35adce6733da50c8474
|
||||
|
||||
NAMES=(
|
||||
'Cascadia Code'
|
||||
'Cascadia Mono'
|
||||
'Cascadia Code PL'
|
||||
'Cascadia Mono PL'
|
||||
'Cascadia Code NF'
|
||||
'Cascadia Mono NF'
|
||||
)
|
||||
|
||||
for name in $NAMES[@]; do
|
||||
NAME=$name
|
||||
FNAME=${name// /}
|
||||
PKGNAME="otf-${${name:l}// /-}"
|
||||
export NAME FNAME PKGNAME
|
||||
envsubst < template.rb > Casks/$PKGNAME.rb
|
||||
done
|
28
template.rb
28
template.rb
|
@ -1,28 +0,0 @@
|
|||
cask "$PKGNAME" do
|
||||
version "$VERSION"
|
||||
sha256 "$CHECKSUM"
|
||||
|
||||
url "https://github.com/microsoft/cascadia-code/releases/download/v#{version}/CascadiaCode-#{version}.zip"
|
||||
name "$NAME"
|
||||
homepage "https://github.com/microsoft/cascadia-code"
|
||||
|
||||
livecheck do
|
||||
url :url
|
||||
strategy :github_latest
|
||||
end
|
||||
|
||||
font "otf/static/$FNAME-Bold.otf"
|
||||
font "otf/static/$FNAME-BoldItalic.otf"
|
||||
font "otf/static/$FNAME-ExtraLight.otf"
|
||||
font "otf/static/$FNAME-ExtraLightItalic.otf"
|
||||
font "otf/static/$FNAME-Italic.otf"
|
||||
font "otf/static/$FNAME-Light.otf"
|
||||
font "otf/static/$FNAME-LightItalic.otf"
|
||||
font "otf/static/$FNAME-Regular.otf"
|
||||
font "otf/static/$FNAME-SemiBold.otf"
|
||||
font "otf/static/$FNAME-SemiBoldItalic.otf"
|
||||
font "otf/static/$FNAME-SemiLight.otf"
|
||||
font "otf/static/$FNAME-SemiLightItalic.otf"
|
||||
|
||||
# No zap stanza required
|
||||
end
|
Loading…
Reference in a new issue