Add fontfind() for finding which font provides a certain glyph

This commit is contained in:
David Thurstenson 2017-05-03 10:00:07 -05:00
parent 8602033910
commit 42c1b93936
1 changed files with 8 additions and 0 deletions

View File

@ -163,3 +163,11 @@ shot() {
maim ${opts[@]}; $pipe maim ${opts[@]}; $pipe
} }
fontfind() {
if [[ -z $1 || ${#1} -gt 1 ]]; then
printf "E: only one character accepted"
fi
local glyph=$1
FC_DEBUG=4 pango-view -qt "$glyph" 2>&1 | awk -F \" '/family: / { m = $2 } END { print m }'
}