Getting a Full Dump of fontconfig Font Info

By Erik Letson, July 26th, 2020 (blog index)


I whipped up the script below recently. It will produce a huge amount of information about the fonts installed on your GNU/Linux system. It takes a single optional argument which is the location of the file to dump the info to. If you don't provide it with a file location, it will create "fontdump.txt" in the cwd. I tested it with Gentoo. Consider it released under the terms of the CC0 licencse. Hopefully it is some help to you!

    #!/bin/bash

    if [ $# -eq 0 ]; then
        TARGET="fontdump.txt"
    else
        TARGET=$1
    fi

    fc-list : file | grep 'ttf\|otf' | sed 's/\://g' | while read l; do fc-query "$l" >> $TARGET; done
    printf "Dumped all font information at $TARGET\n"
    unset l
            

Return to blog index