You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
758 B

#!/bin/bash -
Usage() { echo "$0 FontFile"; exit 1; }
SayError() { local error=$1; shift; echo "$0: $*"; exit "$error"; }
#[ "$#" -ne 1 ] && Usage
width=70
fontfile="$1"
echo "$fontfile"
[ -f "$fontfile" ] || SayError 4 "File not found: ${fontfile}"
list=$(fc-query --format='%{charset}\n' "$fontfile")
for range in $list
do IFS=- read start end <<<"$range"
# if [ "$end" ]
# then
# start=$((16#$start))
# end=$((16#$end))
# for((i=start;i<=end;i++)); do
# #printf -v char '\\U%x' "$i"
# printf '%b\n' "$char"
# done
# else
printf '%b\n' "\\U${start}"
# printf '%b - %b\n' "\\U$start" $char
# fi
done | cat -e
#| ggrep -oP '.{'"$width"'}'