Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

determining whether font files are identical or differ using a shell script

I support 8 computers belonging to graphic artists which have a font train wreck. Over the years, the artists have stuck fonts in their ~/Library/Fonts and /Library/Fonts willy-nilly. They have traded around single files to get fonts they have needed on different computers. On a single computer they will have exactly the same fonts appearing multiple times in the two directories, and also the same fonts appearing more than once in files with slightly different names, as well as the same fonts appearing in multiple formats on the same machine, sometimes with the same version, sometimes with different versions.


And they have a LOT of fonts -- thousands of fonts in several thousand files each. Different files appear to be "broken" on the various machines. (And when I use the FontBook Validate Fonts and Validate Files, it gives me different errors for different runs.)


As a first pass I am trying to identify the files which are appearing on more than one of those 16 directories, and whether files appearing in different places are the same or different. In the Finder, I can see version information & file sizes, and can see whether they are the same or different for files with the same name. I thought that the command 'diff -rs' would tell me same/different, but I have just realized that all of the Font Suitcase files look identical to diff. And in fact they look empty to diff (diff reports that each one is identical to /dev/null.)


Is there any command which can identify same/different font suitcase files from the command line?

Posted on Jun 12, 2019 8:20 PM

Reply

Similar questions

4 replies

Jun 13, 2019 9:32 AM in response to cathy fasano

diff should be able to tell you the differences/similarities. The statement:


all of the Font Suitcase files look identical to diff. And in fact they look empty to diff (diff reports that each one is identical to /dev/null.)


is troubling to me. There's no reason why a font file should look empty. It makes me wonder specifically what command line you're running. For example, this is what I get comparing two font files:


$ diff Wingdings.ttf Wingdings\ 2.ttf 

Binary files Wingdings.ttf and Wingdings 2.ttf differ



Jun 13, 2019 11:39 AM in response to Camelot

Appreciated last night that it's only "Font Suitcase" and "PostScript Type 1 outline font" which are empty files to the command line. Which is all about the fact that these files have all of their data in the resource fork rather than the data fork. TrueType Wingdings.ttf and Wingdings\ 2.ttf have their data in the data fork, and diff knows just what to do with that.


Understanding that, my question is much more precise: is there a command that I can run in Terminal which will tell me whether two files have resource forks which are identical or different?


I can't find any documentation -- and it might not even be the same on different versions of the mac OS -- but somewhere I got the impression that the data fork and resource forks were just two files in a parent directory (kind of like a .pkg). But I would think that if that were true then the -r flag on the diff would compare both sides, and it's not.


Do a diff on either a font suitcase or PS font against /dev/null -- yep, from the command line they are empty. An ls -l will tell you that they have size zero, too. I'm trying to get access to what the Finder is telling me -- it gives me non-zero file sizes, and font version info, etc.

determining whether font files are identical or differ using a shell script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.