1

Right after downloading a font, you can see it has a lot of metadata. For example, if you download the Sansation font and run mdls Sansation_Regular.ttf you will get this output:

com_apple_ats_name_family      = (
    Sansation
)
com_apple_ats_name_fond        = (
    "Sansation Regular"
)
com_apple_ats_name_full        = (
    "Sansation Regular"
)
com_apple_ats_name_postscript  = (
    "Sansation Regular"
)
com_apple_ats_name_style       = (
    Regular
)
com_apple_ats_names            = (
    "Bernd Montag",
    Regular,
    Sansation,
    "Sansation Regular",
    "Version 1.31",
    "\U00a9 2011 Bernd Montag"
)
kMDItemAuthors                 = (
    "Bernd Montag"
)
kMDItemContentCreationDate     = 2012-10-31 15:59:10 +0000
kMDItemContentModificationDate = 2012-10-31 15:59:10 +0000
kMDItemContentType             = "public.truetype-ttf-font"
kMDItemContentTypeTree         = (
    "public.truetype-ttf-font",
    "public.truetype-font",
    "public.font",
    "public.data",
    "public.item"
)
kMDItemCopyright               = "© 2011 Bernd Montag"
kMDItemDateAdded               = 2013-11-21 16:21:51 +0000
kMDItemDisplayName             = "Sansation_Regular.ttf"
kMDItemFonts                   = (
    Regular,
    Sansation,
    "Sansation Regular"
)
kMDItemFSContentChangeDate     = 2012-10-31 15:59:10 +0000
kMDItemFSCreationDate          = 2012-10-31 15:59:10 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "Sansation_Regular.ttf"
kMDItemFSNodeCount             = 78464
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 78464
kMDItemFSTypeCode              = ""
kMDItemKind                    = "TrueType font"
kMDItemLogicalSize             = 78464
kMDItemPhysicalSize            = 81920
kMDItemVersion                 = "Version 1.31"

Now, if you check this file in a git repository, push it to a remote server and clone that repository, a lot of metadata is lost in the process. After being cloned, running mdls Sansation_Regular.ttf gives the following output:

kMDItemFSContentChangeDate = 2013-11-21 16:31:26 +0000
kMDItemFSCreationDate      = 2013-11-21 16:31:26 +0000
kMDItemFSCreatorCode       = ""
kMDItemFSFinderFlags       = 0
kMDItemFSHasCustomIcon     = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery      = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "Sansation_Regular.ttf"
kMDItemFSNodeCount         = 78464
kMDItemFSOwnerGroupID      = 0
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = (null)
kMDItemFSTypeCode          = ""

I tried to run mdimport Sansation_Regular.ttf but the lost attributes did not come back.

What happened? Is there a way to ask the system to recreate all the missing metadata attributes?

I’m running OS X 10.8.5.

  • I think you have an issue with Spotlight indexing. Some missing attributes should be there (e.g. kMDItemContentType). You should have a look to debugging information: mdimport -d 4 Sansation_Regular.ttf. – Nicolas Bachschmidt Nov 21 '13 at 17:24
  • if you zip the file and inspect it on the command line via unzip, it seems to have a resource-fork. I didn't find no tool no more to inspect that thing though. – Karsten Nov 21 '13 at 17:25
  • I just tried what you outlined, checking the fonts into a git repository, then cloning that repository, and all the Spotlight metadata got indexed the same for me in the cloned repo. So it does seem like this might be something particular to your system. – Brian Webster Nov 21 '13 at 18:08
  • @Nicolas mdimport -d 4 Sansation_Regular.ttf does not print anything and exits with status code 0. @Karsten According to How to programmatically access file resource forks on Snow Leopard? you can access the resource fork with Sansation_Regular.ttf/..namedfork/rsrc but it is empty. @Brian I’m using OS X 10.8.5 so maybe this issue is resolved in Mavericks? – 0xced Nov 21 '13 at 21:54
1

It turns out the metadata was not available because I cloned the repository inside the /tmp directory which is not indexed by Spotlight. Cloning the repository somewhere indexed by Spotlight works fine.

| improve this answer | |
0

Those com_apple_ats_name_family keys look like extended attribute names with the "."s replaced with "_"s. Try running xattr -l Sansation_Regular.ttf on the original file and see if it has a bunch of extended attributes that aren't being copied along with the file when you check it in.

| improve this answer | |
  • The only extended attribute returned by xattr -l Sansation_Regular.ttf is com.apple.quarantine. So it seems those are not stored as extended attributes. – 0xced Nov 21 '13 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .