mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 13:50:38 -04:00
more script adds
This commit is contained in:
parent
a11d325a19
commit
e1df303d71
15 changed files with 621 additions and 0 deletions
26
Scripts/.old/font_glyphs.sh
Executable file
26
Scripts/.old/font_glyphs.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash -
|
||||
|
||||
Usage() { echo "$0 FontFile"; exit 1; }
|
||||
SayError() { local error=$1; shift; echo "$0: $@"; exit "$error"; }
|
||||
|
||||
[ "$#" -ne 1 ] && Usage
|
||||
width=70
|
||||
fontfile="$1"
|
||||
|
||||
[ -f "$fontfile" ] || SayError 4 'File not found'
|
||||
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' "$char"
|
||||
done
|
||||
else
|
||||
printf '%b' "\\U$start"
|
||||
fi
|
||||
done | grep -oP '.{'"$width"'}'
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue