RSS/Atom feed Twitter
Site is read-only, email is disabled

how do I find the pathname of a selected font?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

how do I find the pathname of a selected font? bobdobbs 01 Oct 09:13
  how do I find the pathname of a selected font? Chris Mohler 01 Oct 19:15
   how do I find the pathname of a selected font? Chris Mohler 01 Oct 19:28
    how do I find the pathname of a selected font? GSR - FR 01 Oct 23:51
  how do I find the pathname of a selected font? Simon Budig 01 Oct 19:51
  how do I find the pathname of a selected font? Sven Neumann 02 Oct 00:25
2010-10-01 09:13:19 UTC (over 14 years ago)
postings
31

how do I find the pathname of a selected font?

Hi.

I've got lots of fonts in quiet a few directories.

I'm using a particular font in an image I'm editing. I want to discover the pathname of this font.

It looks like the name of the font that gimp displays in the font text settings pane doesn't corrospond to the filename of the actual font, so the solution isn't as simple as navigating to my main font directory and grepping for it.

Can gimp give me enough information on the font to allow me to find it?

Chris Mohler
2010-10-01 19:15:23 UTC (over 14 years ago)

how do I find the pathname of a selected font?

On Fri, Oct 1, 2010 at 2:13 AM, bobdobbs wrote:

It looks like the name of the font that gimp displays in the font text settings pane doesn't corrospond to the filename of the actual font, so the solution isn't as simple as navigating to my main font directory and grepping for it.

I had a similar problem - I had a directory containing tons of fonts that were all very badly named. I wrote this snippet to rename the files based on the actual font name (family_style.ttf) so I could find them and install as needed:
http://pastebin.com/GB6PKBim

BE WARNED: this changes the file names *in place* - there is absolutely no safety net. You might consider copying your font dir to a temporary location and then running the script there instead. For me it worked well - that whole directory is named correctly now, but I make no guarantees (may kick puppies, eat kittens, etc. ;) Also it only will do TTF files, and probably only works on linux. You need python-imaging and python-magic as well.

Another possibility would be to modify this script to output the filename and the font name on the same line - that way you could pipe that through grep and see which file matches which font.

HTH, Chris

Chris Mohler
2010-10-01 19:28:05 UTC (over 14 years ago)

how do I find the pathname of a selected font?

On Fri, Oct 1, 2010 at 12:15 PM, Chris Mohler wrote:

Another possibility would be to modify this script to output the filename and the font name on the same line

After rereading that script, I saw it was quite easy to modify so it only lists the font name and file name on the same line: http://pastebin.com/ztbgPJhZ

I only tested it once but it seems to work OK. On a fairly stock Ubuntu I only had to install python-magic.

Chris

Simon Budig
2010-10-01 19:51:01 UTC (over 14 years ago)

how do I find the pathname of a selected font?

bobdobbs (forums@gimpusers.com) wrote:

I've got lots of fonts in quiet a few directories.

I'm using a particular font in an image I'm editing. I want to discover the pathname of this font.

It looks like the name of the font that gimp displays in the font text settings pane doesn't corrospond to the filename of the actual font, so the solution isn't as simple as navigating to my main font directory and grepping for it.

Can gimp give me enough information on the font to allow me to find it?

Not exactly Gimp, but try this:

simon@mezzanine:~$ fc-list "DejaVu Sans" : file /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-BoldOblique.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-ExtraLight.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Bold.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf: /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansCondensed-Oblique.ttf:

Hope this helps, Simon

GSR - FR
2010-10-01 23:51:18 UTC (over 14 years ago)

how do I find the pathname of a selected font?

Hi,
cr33dog@gmail.com (2010-10-01 at 1228.05 -0500):

On Fri, Oct 1, 2010 at 12:15 PM, Chris Mohler wrote:

Another possibility would be to modify this script to output the filename and the font name on the same line

After rereading that script, I saw it was quite easy to modify so it only lists the font name and file name on the same line: http://pastebin.com/ztbgPJhZ

I only tested it once but it seems to work OK. On a fairly stock Ubuntu I only had to install python-magic.

In Unix based systems it would be worth to try with symlinks: keep the original named files somewhere, make the apps see symlinks that have usable names and point to the real files; or even hardlinks, if same partition.

GSR

Sven Neumann
2010-10-02 00:25:35 UTC (over 14 years ago)

how do I find the pathname of a selected font?

On Fri, 2010-10-01 at 09:13 +0200, bobdobbs wrote:

I've got lots of fonts in quiet a few directories.

I'm using a particular font in an image I'm editing. I want to discover the pathname of this font.

It looks like the name of the font that gimp displays in the font text settings pane doesn't corrospond to the filename of the actual font, so the solution isn't as simple as navigating to my main font directory and grepping for it.

Can gimp give me enough information on the font to allow me to find it?

No, but the tools that come with fontconfig can. There's the fc-list command-line utility that can list all available fonts with their filenames. Try "fc-list : family style file". For details see the fc-list manual page.

Sven