summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfontd8
1 files changed, 4 insertions, 4 deletions
diff --git a/fontd b/fontd
index 0925f3f..80ac94c 100755
--- a/fontd
+++ b/fontd
@@ -12,14 +12,14 @@ eval fonts="$2/*bdf"
size=$(cat $fonts | grep -m 1 PIXEL_SIZE | awk '{print $2}')
#get bdf bitmap info from bdf
-#fflag ensures only one result even with multiple bdfs, cflag finds the char,
-#bflag labels just the bitmap part
-bdf=$(cat $2/*bdf | awk "NR==1{fflag=0}/ENCODING $1$/{if(fflag==0){cflag=1;fflag=1}}/BITMAP/{if (cflag==1){bflag=1};next}/ENDCHAR/{cflag=0;bflag=0}bflag")
+#cflag labels the character part; bflag labels just the bitmap part, on first
+#ENDCHAR after finding the bitmap it exits
+bdf=$(cat $2/*bdf | awk "/ENCODING $1$/{cflag=1}/BITMAP/{if (cflag==1){bflag=1};next}/ENDCHAR/{if (bflag==1){exit}}bflag")
#convert to binary, cols depends on size
bin=$(echo $bdf | xxd -r -ps | xxd -b -c $(($size/8))|\
#strip all the formating, bbrll takes 0s and 1s as input
-sed 's/^.*://g;s/\s[^[:space:]]*$//;s/\s//g')
+sed 's/^.*://g;s/\s[^[:space:]]*$//;s/[^01]//g')
#saving it as a var removed newlines, must add in with sed, send to bbrll to
# display