My boss wants a smaller package size. The largest resource we have is the fallback font (for CJK chars) at ~5MB. Currently I've managed to read the fallback font from the phone. It's an OpenGL application and we use FreeType for font rendering so that's why I don't use UIFont. I have code that works, but I want to know if reading /System/Library/Fonts/CGFontCache.plist as below is grounds for being rejected from the AppStore:
void AddSystemFontToCache(const char* fontName, const int& fontStyle)
{
NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSASCIIStringEncoding];
NSDictionary *nsFontsDict = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/Fonts/CGFontCache.plist"];
NSDictionary *nsTraitsDict = [nsFontsDict valueForKey:@"TraitMappings"];
NSDictionary *nsMappingDict = [nsTraitsDict valueForKey:nsFontName];
NSDictionary *nsFaceNamesDict = [nsFontsDict valueForKey:@"Names"];
NSString* nsFacePath = [nsFaceNamesDict valueForKey:[nsMappingDict valueForKey:nsFontStyle]];
// This function uses FT_New_Face to read the font
AddFontToCache(fontName, [nsFacePath cStringUsingEncoding:NSASCIIStringEncoding]);
}
I have seen numerous posts on the net about people using this file in their applications and have heard nothing of Apple rejecting it. Apple will reject if you use a private API to access the file, but since you have access to the file and are just reading it from the file system with no private API, I see that there wouldn't be an issue. However, from experience, it is at the reviewers discretion to reject an app. Every reviewer is different. If it gets rejected you can always send it up to the review board.
So short answer, No, I don't feel apple would reject your app for using this.