Last active
December 3, 2021 18:50
-
-
Save michaelskyba/700366b6649f4dc6fa6cba6c264d3da2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
doc=' | |
msk_display: display a short text in an image using imagemagick | |
useful for e.g. showing Japanese characters in a proper font | |
usage: msk_display "<text>" | |
sxiv is not called with &, so you might want to run msk_display ... & | |
' | |
[ -z "$1" ] \ | |
&& echo "$doc" \ | |
&& exit 1 | |
tmpfile=$(mktemp).png | |
convert -background LemonChiffon -fill black -font /usr/share/fonts/OTF/NotoSansJP-Regular.otf -pointsize 72 label:"$1" "$tmpfile" | |
sxiv "$tmpfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment