-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Please implement a title in the font preview window, which should show the font name and style or the postscript name.
Use case
Fonts have often misleading names, sometimes still in the DOS 8.3 naming convention. For similar-looking fonts, it's not easy to see which font it really is if you don't see the real font name embedded in the font. Font names like bookosb.ttf
and bookosbi.ttf
don't tell much if you need a certain font, for example in LibreOffice which shows the real font names and not the file names.
Example code
fc-scan --format "%{fullname[$(( $(sed -E 's/^(.*)en.*/\1/;s/[^,]//g' <<<"$(fc-scan --format "%{fullnamelang}\n" /mnt/Fonts/bookosb.ttf)" | wc -c) -1 ))]}\n" /mnt/Fonts/bookosb.ttf
is a way to retrieve the font name wherever fontconfig
is installed, so practically everywhere on Linux. The complex line is necessary because a simple fc-scan --format "%{fullname}\n"
would return something like
Bookman Old Style Negreta,Bookman Old Style tučné,Bookman Old Style fed,Bookman Old Style Fett,Bookman Old Style Έντονα,Bookman Old Style Bold,Bookman Old Style Negrita,Bookman Old Style Lihavoitu,Bookman Old Style Gras,Bookman Old Style Félkövér,Bookman Old Style Grassetto,Bookman Old Style Vet,Bookman Old Style Halvfet,Bookman Old Style Pogrubiony,Bookman Old Style Negrito,Bookman Old Style Полужирный,Bookman Old Style Fet,Bookman Old Style Kalın,Bookman Old Style Krepko,Bookman Old Style Lodia
instead of just
Bookman Old Style Bold
Alternatively, fc-scan --format "%{postscriptname}\n"
is simpler, but returns
- BookmanOldStyle-Bold*
which needs to be parsed by the user to get the proper name for linux use.