How is font metadata stored? 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.
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.