diff options
author | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2023-06-30 02:55:40 -0700 |
---|---|---|
committer | Haoran S. Diao (刁浩然) <0@hairydiode.xyz> | 2023-06-30 02:55:40 -0700 |
commit | ec1d430daf529802729aa1ab622ad1a2d7c53cd3 (patch) | |
tree | 2c07d7ccc87530527ef3254fef45880000b3bbe5 /fontd | |
parent | ac9b480f8d95a5bcb50dfe0dc2cf914b23572e1e (diff) |
Added ability to display entire strings of text
Diffstat (limited to 'fontd')
-rwxr-xr-x | fontd | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2,6 +2,7 @@ #USAGE # fontd CHAR DIR # display CHAR if found in any bdf fonts in DIR/ +# NOTE: CHAR must be in decimal encoding point format of bdf #gets font size, it can take multiple fonts as input so only get the first one #and assume they're all the same size @@ -10,7 +11,7 @@ size=$(cat $2/*bdf | 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}/STARTCHAR $1$/{if(fflag==0){cflag=1;fflag=1}}/BITMAP/{if (cflag==1){bflag=1};next}/ENDCHAR/{cflag=0;bflag=0}bflag") +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") #convert to binary, cols depends on size bin=$(echo $bdf | xxd -r -ps | xxd -b -c $(($size/8))|\ |