Hello, On Thu, 21 Aug 2014, David C. Rankin wrote: [..]
$ fc-list | \ grep true | \ sed -e 's|^.*/||' -e 's/:style=\(\<.*\>\).*$/ - \1/' -e 's/,.*$//' | \ sort
The output:
andalemo.ttf: Andale Mono - Regular arialbd.ttf: Arial - Bold [..]
fc-list -f "%{file|basename}: %{family} - %{style|basename}\n" | sort see /usr/share/doc/packages/fontconfig-devel/fcpatternformat.html and 'fc-list -v | less' Also: less /usr/share/fonts/truetype/fonts.dir
I also recall another command that allowed you to query individual font files and return the fontname, but I cannot seem to find reference to it. It was something like:
$ someutil /path/to/fonts/truetype/ttfname.ttf fontname
If anyone know of another utility that will read individual files and dump just the fontname, I'd appreciate you reminding me what it is :)
A not quite finished (for TeX's MF/PK/GF fonts ;) script ... ==== ~/bin/fontname [or put it in /usr/local/bin] ==== #!/bin/bash ttfinfo() { # ttf2pt1 -pft -Gf -Ouost "$1" - 2>/dev/null | type1info /dev/stdin ttf2pt1 -pft -Gf -Ouost "$1" - 2>/dev/null | tr '\r' '\n' | \ awk '/\/FullName/ { print gensub(".*/FullName.*\\(([^)]*)\\)([[:space:]]readonly)?[[:space:]]+def[[:space:]]*.*", "\\1", 1, $0); }' } type1info() { tr '\r' '\n' < "$1" | awk '/\/FullName/ { print gensub(".*/FullName.*\\(([^)]*)\\)([[:space:]]readonly)?[[:space:]]+def[[:space:]]*.*", "\\1", 1, $0); }' } bdfinfo() { awk ' /^FACE_NAME/{ $1=""; gsub("\"",""); sub("^[[:space:]]",""); if($1) { face="[" $0 "]"; }; } /^FONT[[:space:]]/{ split($2, name, "-"); for(i=2; i < 7; i++) { printf("%s ", name[i]); } for(i=14; i <= length(name); i++) { enc=enc "-" name[i]; } sub("^-", "", enc); sub("-$", "", enc); } END { printf("%s %s\n", enc, face); }' "$1" } for f; do case "$f" in *.[bB][dD][fF]) printf "%s: %s\n" "$f" "$(bdfinfo "$f")";; *.[oOtT][tT][fF]) printf "%s: %s\n" "$f" "$(ttfinfo "$f")";; *.[pP][fF][aAbB]) printf "%s: %s\n" "$f" "$(type1info "$f")";; esac done ==== $ fontname /usr/share/fonts/truetype/arial* \ /usr/share/fonts/truetype/andalemo.ttf /usr/share/fonts/truetype/arial.ttf: Arial /usr/share/fonts/truetype/arialals.ttf: Arial Alternative Symbol /usr/share/fonts/truetype/arialalt.ttf: Arial Alternative Regular /usr/share/fonts/truetype/arialbd.ttf: Arial Bold /usr/share/fonts/truetype/arialbi.ttf: Arial Bold Italic /usr/share/fonts/truetype/ariali.ttf: Arial Italic /usr/share/fonts/truetype/arialn.ttf: Arial Narrow /usr/share/fonts/truetype/arialnb.ttf: Arial Narrow Bold /usr/share/fonts/truetype/arialnbi.ttf: Arial Narrow Bold Italic /usr/share/fonts/truetype/arialni.ttf: Arial Narrow Italic /usr/share/fonts/truetype/andalemo.ttf: Andale Mono I guess I should add support for compressed BDF and PCF (both compressed and uncompressed) files. ttf2pt1 is packaged as ttf2pt1. HTH, -dnh -- Why are there always boycotts? Shouldn't there be girlcotts too? -- argon on #Linux -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org