我的老闆想要更小的包裝。 我們擁有的最大資源是約5MB的備用字體(用於CJK字符)。 目前我已設法從手機中讀取備用字體。 這是一個OpenGL應用程序,我們使用FreeType進行字體渲染,這就是爲什麼我不使用UIFont。 我有工作的代碼,但我想知道是否如下閱讀/System/Library/Fonts/CGFontCache.plist爲理由從AppStore上被拒絕:能否從AppStore拒絕閱讀CGFontCache.plist?
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]);
}
感謝很多答案。想要問一下,因爲我聽說過很多蘋果拒絕爲微不足道的應用程序提供應用程序的令人討厭的故事。 –