cocos2d/cocos2d-x — pull request #2150 by Weeds (2013-03-12 23:17:50+00:00)
Title: [Linux] add cache for font family -> font path mapping

As FcFontMach is quite an expensive call the results of getFontFile() are
now cached in an std::map if either a ttf file is packed with the app or
if a font file has been found by using fontconfig

Just loading the starting scene of the Test Application requires about 22.000.000 function calls somewhere in the fontconfig library, consuming about 75% of the time.
Calls to FcFontMatch are now reduced to one call per font family.