Skip to content

Small program to determine whether a certain font has a certain character

License

Notifications You must be signed in to change notification settings

repolho/has_char

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

has_char

Small tool to determine whether a certain font contains certain characters. Usage is:

./has_char font_name < characters_to_be_tested.txt

Example:

$ echo 'I❤U' | ./has_char 'Bitstream Vera Sans'
Missing char: ❤

Font name should be exact, otherwise fontconfig will default to some other font and the program will fail:

$ ./has_char 'DejaVuSans' < file.txt
Couldn't find font DejaVuSans, aborting

$ ./has_char 'DejaVu Sans' < file.txt
Missing char: 한
Missing char: 글

To figure out the font's name, use any program that allows you to select fonts, like gtk2fontsel.

The program will return a zero status if all characters were found, and a non-zero status if any characters were not found:

$ echo '☺' | ./has_char 'Bitstream Vera Sans' && echo 'success' || echo 'failure'
Missing char: ☺
failure

$ echo ':)' | ./has_char 'Bitstream Vera Sans' && echo 'success' || echo 'failure'
success

About

Small program to determine whether a certain font has a certain character

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages