find font duplicates

Discussion in 'Mac Apps and Mac App Store' started by renwrite, Nov 15, 2010.

  1. renwrite macrumors newbie

    Joined:
    Nov 15, 2010
    #1
    Is there any way to automatically find duplicate fonts that have different names. I have 1000's of fonts and it is slow to do it manually.
     
  2. Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #2
    cmp file1 file2

    You can use it to check if there are any differences between two files.

    EDIT: You can write a script to check every file with that command.
     
  3. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
  4. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #4
    got some

    http://www.araxis.com/find-duplicate...index-eur.html.

    I downloaded the program and it did good. Thanks! Of the over 30,000 fonts I had it found 383 that were duplicates. They seem to have similar names.

    The terminal idea seems to work if I have individual fonts that I suspect are the same and I run it, but if I am visually checking them, I can make a judgment call.

    Is there anything out there that will analyze the fonts to see if they are the same just different names? (for example Margarita Script and Yesterday script are two fonts that are identical, just different names)
     
  5. Isair, Nov 15, 2010
    Last edited: Nov 15, 2010

    Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #5
    I wrote a small console application for you that checks every file in a given folder and see if they are byte-by-byte identical or not.

    Download (For Mac OS X 10.5 & 10.6): http://www.mediafire.com/?pouh3jvq23ahrao

    Screenshot:
    [​IMG]

    If you know C++ and interested in the source, just send me a message.

    P.S: About the above screenshot, taken from one my later posts:

     
  6. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #6
    step by step

    Isair Thank you so much. I am anxious to try it. But forgive my ignorance. I will download it. The file it creates I put in the same folder as all the fonts (they are on my desktop in a folder called fonts) and in terminal I type

    ./duplicatefinder /desktop/fonts


    and then hit enter

    correct?
     
  7. Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #7
    The argument must be a full path, for example:

    ./duplicatefinder ~/desktop/fonts

    or

    ./duplicatefinder /users/your-user-name/desktop/fonts

    Also there were 2 bugs in the application which I fixed:

    1) It now skips entries in a directory if they are directories themselves.
    2) Checks duplicates correctly, there was an embarassing coding mistake on my side.

    Fixed version: http://www.mediafire.com/?oe8daqqtqq5f4v8
     
  8. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #8
    terminal

    sorry for the delay - took sick dog to vet...


    Okay, I must be doing something wrong. I downloaded the new file and put the resulting file in the same folder with the fonts.

    this is what I get from terminal...

    Last login: Mon Nov 15 11:07:34 on ttys001
    [becky-3:~] geoffandbeckyhannert% /Users/geoffandbeckyhannert/Desktop/fonts/DuplicateFinder ; exit;
    dyld: unknown required load command 0x80000022
    Trace/BPT trap
    logout

    [Process completed]
     
  9. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #9
    terminal

    I tried a few other variations in terminal and got...


    [becky-3:~] geoffandbeckyhannert% ./duplicatefinder ~/desktop/fonts
    ./duplicatefinder: Command not found.
    [becky-3:~] geoffandbeckyhannert% .duplicatefinder ~/fonts
    .duplicatefinder: Command not found.
    [becky-3:~] geoffandbeckyhannert% ./duplicatefinder ~/desktop/fonts
    ./duplicatefinder: Command not found.
    [becky-3:~] geoffandbeckyhannert% ./DuplicateFinder ~/desktop/fonts
    ./DuplicateFinder: Command not found.
    [becky-3:~] geoffandbeckyhannert%
     
  10. Isair, Nov 15, 2010
    Last edited: Nov 15, 2010

    Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #10
    You are trying to execute a program named duplicatefinder in your home directory, which does not exist. For the ease of use, so you don't have to cd to where you placed duplicatefinder each time:

    1) Put DuplicateFinder in your home directory.
    2) Open Terminal.
    3) Then write what you have been writing up to now.

    EDIT: By the way are you using 10.6 or earlier? It may not work on 10.5 and earlier systems.
     
  11. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #11
    terminal

    It is really nice of you to try to help me so much!.

    I am using 10.5.8

    Here's what I got this time


    [becky-3:~] geoffandbeckyhannert% ./DuplicateFinder ~/desktop/fonts
    dyld: unknown required load command 0x80000022
    Trace/BPT trap
     
  12. Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #12
    No problem, I actually happen to have a lot of free time :p Anyway that error happens because the base SDK I chose was 10.6, now changed it to 10.5 and recompiled for i386 architecture.

    Give this one a try with the same instructions: http://www.mediafire.com/?z40za194vxf0z6i
     
  13. redwarrior macrumors 603

    redwarrior

    Joined:
    Apr 7, 2008
    Location:
    in the Dawg house
    #13
    I fixed mine with Font Book, but it's not free ($10). It works well though. You can use it disable fonts too, if you have a lot that you don't use but want to keep them around just in case.

    Good luck. Playing around with terminal is fun at least and a good thing to be comfortable with. :)

    (Hope your dog is OK. Stresses me out something awful when mine gets sick.)
     
  14. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #14
    terminal

    Must be getting closer...

    Found 38434 entries in /Users/geoffandbeckyhannert/desktop/fonts
    Checking for duplicates, please wait...

    Segmentation fault



    (Dog, not okay, but she is getting some good love today)
     
  15. Isair, Nov 15, 2010
    Last edited: Nov 15, 2010

    Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #15
    Sorry for the late answer as I had to go somewhere. But here is a revised version, I changed too many things so I am not gonna write about them but after seeing the error you have I turned my eye on directories containing large amount of files and made my test cases on them.

    The version that should also work on your computer: http://www.mediafire.com/?vd3kb5z00gtsg02

    EDIT: I also made a version without file path/name length limitations. I doubt that it is your problem as the limit I put was 1024 characters, still also give this one a try: http://www.mediafire.com/?pouh3jvq23ahrao

    Also note that in this screenshot of one of my tests:
    [​IMG]

    It looks like it has found many identical fonts, but if you look carefully they are not font files (they don't have .ttf at the end). So don't go deleting the similarly named .ttf files by mistake :)

    P.S: Hope your dog gets well soon.

    EDIT: Now that I think, I might throw in a GUI and some more functionality and sell this for a dollar or two when Mac App Store comes up :p
     
  16. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #16
    terminal

    It ran for a long time, but I think something went wrong...

    becky-3:~] geoffandbeckyhannert% ./DuplicateFinder ~/desktop/fonts

    Found 32746 entries in /Users/geoffandbeckyhannert/desktop/fonts
    Checking for duplicates, please wait...

    Caeldera and CalistoMT are identical!
    Caeldera and Calli109 3 are identical!
    Caeldera and Calliope are identical!
    Caeldera and CasloFivForIta are identical!
    Caeldera and CasloFivForItaOsF are identical!
    Caeldera and CasloFivForRom are identical!
    Caeldera and CasloFivForRomSC are identical!
    Caeldera and CaslonFiveForty are identical!
    Caeldera and Casque are identical!
    Caeldera and CastellarMT are identical!
    Caeldera and CasteMT are identical!
    Caeldera and Castiglione are identical!
    Caeldera and CCSpi are identical!
    Caeldera and CCSpills are identical!
    Caeldera and Cecily are identical!



    and then the list just continues with more "matching" Caeldera
     
  17. renwrite thread starter macrumors newbie

    Joined:
    Nov 15, 2010
    #17
    sort

    Is there a way to sort the fonts based on their appearance so that ones that look alike are listed together? Then I could manually delete them.

    I suppose it is just a judgment call on which one to delete
     
  18. Isair, Nov 15, 2010
    Last edited: Nov 15, 2010

    Isair macrumors member

    Isair

    Joined:
    Jul 7, 2010
    Location:
    San Francisco, California
    #18
    Actually your problem is pretty much solved right now. The program works correctly, but it seems that you only want to see identical .ttf files, right? then write this:

    ./duplicatefinder /library/fonts | grep ttf

    or because you copied your fonts folder to desktop:

    ./duplicatefinder ~/desktop/fonts | grep ttf

    grep will filter the output and only show the lines containing "ttf", if there are no lines displayed, then there are no identical ttf files!

    EDIT: You might wanna change grep ttf to grep .ttf if any of your font names contain ttf in them (e.g Nottferman, made that one up). Also it is bound to take long when doing a byte-by-byte comparison of 32k files, so just wait until it is finished.

    EDIT2: Those files without an extension in the fonts directory are just files with 0 bytes of information in them, I opened up a hex editor and checked them personally. So all of them are found to be identical.
     

Share This Page