If you want to know which font is being used for a certain character, try this:
FC_DEBUG=4 pango-view -q -t '{character}' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1
FC_DEBUG=4 will cause fontconfig to print its attempts to match a font that contains that character. The last font listed is the one that matched. Here are some examples:
$ FC_DEBUG=4 pango-view -q -t 'ᚠ' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 FreeMono $ FC_DEBUG=4 pango-view -q -t 'ളം' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 Lohit Malayalam $ FC_DEBUG=4 pango-view -q -t 'दी' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 Lohit Hindi
You might want to take a look at pango-view’s window to make sure the font used is actually the one you were trying to figure out. To do that, drop the -q
option and simply press q
to quit once you’re done. You might have to tell pango-view to use sans, serif or mono fonts with the --font
option. For example, in my system, I get:
$ FC_DEBUG=4 pango-view --font='sans' -t '語' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 AR PL New Kai $ FC_DEBUG=4 pango-view --font='serif' -t '語' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 AR PL New Sung $ FC_DEBUG=4 pango-view --font='mono' -t '語' 2>&1 | \ grep -o 'family: "[^"]\+' | cut -c 10- | tail -n 1 AR PL New Sung Mono
You can use “pango-view -q” instead of hitting “q” to quit every time.
Thanks for the tip. I’ve included it above.
Pingback: Fixing My Missing Degree Celsius Symbol – QSC Tech Blogs
Pingback: Find out if a font contains certain characters | repolinux