Skip to content

Commit

Permalink
try before buy!
Browse files Browse the repository at this point in the history
  • Loading branch information
crpb committed Aug 9, 2023
1 parent 8587934 commit 7ac0d80
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fnt
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,21 @@ case "$1" in
fi
# echo Previewing...
mkdir -p "${TMPDIR}"
rm "${TMPDIR}/preview.png"
PRINTED=
if curl -L -s "https://screenshots.debian.net/screenshot/fonts-$2" -o "${TMPDIR}/preview.png"; then
md5s=$($md5 "${TMPDIR}/preview.png")
if echo "$md5s" |grep b5765b390157e36eaf721c8848a4b04d >/dev/null; then
# if we get nothing / "this picture is not available" pic
if [ "$($md5 "${TMPDIR}/preview.png" | awk '{print$1}')" = "b5765b390157e36eaf721c8848a4b04d" ]; then
if curl -L -s "https://sid.ethz.ch/fonts/$2/preview.png" -o "${TMPDIR}/preview.png"; then
chafa -c 240 -w 9 -O 9 -p on --symbols all "${TMPDIR}/preview.png"
chafa -c 240 -w 9 -O 9 -p on --symbols all "${TMPDIR}/preview.png" 2>/dev/null && PRINTED=1
fi
else
chafa -c 240 -w 9 -O 9 -p on --symbols all "${TMPDIR}/preview.png" 2>/dev/null && PRINTED=1
fi
fi
if [ "$PRINTED" != "1" ]; then
echo "Couldn't retrieve a preview."
fi
#chafa --invert -c none --symbols block+border-solid "${TMPDIR}/preview.png"
#chafa -c 240 -w 9 -O 9 -p on --symbols all "${TMPDIR}/preview.png"
;;
Expand Down

0 comments on commit 7ac0d80

Please sign in to comment.