iPhoneアプリケーションに600個のフォントファイルがありますが、アプリケーションはそれらの600個のファイルが含まれている.xibファイルを見つけることができません。600個のファイルを削除すると、.xibファイルは問題なく正しくロードされます。
アプリケーション内のリソースファイル数の制限を確認しましたが、ありません。また、ファイルのサイズはわずか100MBでOKです。何が問題なのかわかりません。
さて、良いニュースと悪いニュースがあります。悪いニュースは、Apple が iPhone でこれほど多くのフォントを望む人を想定していなかったので、おそらく iOS でいくつかのソフト リミットに達しているということです。
良いニュース (一種) は、CGFonts と CTFonts をファイルから直接ロードできることです。リンクを参照してください。これの悪い点は、Core Graphics または Core Text で描画を行う必要があることです。これらは無料でブリッジされていないためです。
ありがとうございました。これはうまくいきました。ただし、古いレイヤーの代わりに、書き込むために新しいレイヤーを作成する必要があります。
これが完全なコードスニペットです
#import <CoreText/CoreText.h>
#import <QuartzCore/QuartzCore.h>
CTFontRef ctfont = [self newCustomFontWithName:@"cs" ofType:@"ttf" attributes:nil];
CATextLayer * normalTextLayer_ = [[CATextLayer alloc] init];
normalTextLayer_.font = ctfont;
normalTextLayer_.string = @"alleluja";
normalTextLayer_.wrapped = YES;
normalTextLayer_.foregroundColor = [[UIColor purpleColor] CGColor];
normalTextLayer_.fontSize = 20.f;
normalTextLayer_.alignmentMode = kCAAlignmentCenter;
normalTextLayer_.frame = CGRectMake(0.f, 10.f, 320.f, 32.f);
[self.view.layer addSublayer:normalTextLayer_];
CTFontRef cttFont = [self newCustomFontWithName:@"cs" ofType:@"ttf" attributes:nil];
NSString *fontName = [(NSString *)CTFontCopyName(cttFont, kCTFontPostScriptNameKey) autorelease];
CGFloat fontSize = CTFontGetSize(cttFont);
NSLog(@"%f fontName = '%@'",fontSize,fontName);
UIFont *font = [UIFont fontWithName:fontName size:fontSize];
UITextView * xx = [[UITextView alloc] initWithFrame:CGRectMake(0, 100, 320, 200)];
xx.text = @"alleluja";
xx.font = font;
[self.view addSubview:xx];