How can I quickly rename font files with arbitrary names to their postscriptFontName values?

If you have a large folder of unsorted font files, it may be difficult to identify which adhere to what family and their style names. For this a solution could be a script to go through the metadata of all the font files and rename them according to their postscriptFontName values.
Opening each file individually to figure out the value in Glyphs is very time consuming, and should not be necessary for a simple operation as this is.

Does such a script/program exist?

I don’t think so.

But it is not difficult to write with fontTools.

1 Like

I’ll have a look at those tools, then. Thanks for the suggestion!

Update: I ended up using automator with an mdls script tucked in the middle.
It is set up as an application which receives the files and folders that are dragged onto it. The fonts are filtered out and then launches another workflow which goes through and renames each font file.

mdls? Edit: Ah, I see you mean the mdls Terminal command. Interesting, didn’t know that, thank you for that input!

Here is the specific setup, should it be of interest:
(Left is main application, right is the processing workflow)

2 Likes