Skip to content

Commit

Permalink
Update split.yaml
Browse files Browse the repository at this point in the history
Set css.fontWeight according to font name
  • Loading branch information
CMBill authored Sep 24, 2024
1 parent 3a3e94f commit 00bb8f3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/split.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ jobs:
for i in $(echo "$(ls ./tmp)" | grep -i '\.ttf$')
do
font_name=$(echo "$i" | sed -E 's/(.+)\.ttf$/\1/i' | tr '[:upper:]' '[:lower:]')
cn-font-split -i=./tmp/$i -o=./fonts/$font_name --renameOutputFont='[index][ext]'
case "$font_name" in
*regular)
font_weight="400"
;;
*light)
font_weight="300"
;;
*bold)
font_weight="700"
;;
*)
font_weight="400"
;;
esac
cn-font-split -i=./tmp/$i -o=./fonts/$font_name --renameOutputFont='[index][ext]' --css.fontWeight=$font_weight
echo "@import url('./$font_name/result.css');" >> ./style.css
done
echo "${{ steps.down.outputs.tag_name }}" >> VERSION
Expand Down

0 comments on commit 00bb8f3

Please sign in to comment.