Fatal error in a UFO file?



  • I have a font file that stopped being able to be saved (I was changing the default layer a couple of times), so I just closed it without saving. Unfortunately I am not unable to open it. I receive an error box stating that the document can't be opened, that the file isn't in the correct format. The little note underneath states No 'glyphs' directory for layer 'finals'. Fortunately I have not lost too much work, but I was wondering if there was a brute way to get the file open, and just how touchy RoboFont is about changing default layers? Cheers


  • admin

    hello @Colo-in-NYC,

    it looks like the layercontents.plist and the layer folders inside your UFO are out-of-sync. you can fix it manually using a text editor, just follow the steps below.

    first, open the UFO package by right-clicking on the .ufo file in Finder and choosing Show Package Contents from the contextual menu. you will see a folder structure similar to this:

    myFont.ufo
    ├── layercontents.plist
    ├── ...
    ├── glyphs
    │   ├── A_.glif
    │   ├── a.glif
    │   └── ...
    ├── glyphs.myLayer1
    │   ├── A_.glif
    │   ├── a.glif
    │   └── ...
    └── glyphs.myLayer2
        ├── A_.glif
        ├── a.glif
        └── ...
    

    now open layercontents.plist in a plain text editor. you will see something like this:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <array>
        <array>
          <string>foreground</string>
          <string>glyphs</string>
        </array>
        <array>
          <string>test1</string>
          <string>glyphs.test1</string>
        </array>
        <array>
          <string>test3</string>
          <string>glyphs.test3</string>
        </array>
      </array>
    </plist>
    

    notice how the layercontents.plist includes a layer named test3 pointing to the subfolder glyphs.test3, which does not exist inside the UFO package. your layercontents.plist probably contains a similar error.

    to repair the UFO, update layercontents.plist with the correct layer and subfolder names, and save the file. you should now be able to open the UFO in RoboFont.

    good luck, let us know if it works!



  • @gferreira Thank you!