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


#1

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?


#2

I don’t think so.


#3

But it is not difficult to write with fontTools.


#4

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


#5

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.


#6

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


#7

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