Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iPhone上打开字体文件_Iphone_Fonts_Ios Simulator - Fatal编程技术网

在iPhone上打开字体文件

在iPhone上打开字体文件,iphone,fonts,ios-simulator,Iphone,Fonts,Ios Simulator,在iPhone设备上打开字体文件(*.ttf)时出现问题。这些文件存储在名为font的目录中。系统调用打开(2)退出,错误号为2 我们的项目中有许多文件,这些文件是毫无问题地打开的。只有字体文件失败 iPhone模拟器可以正确打开字体文件。问题只出现在设备(iPhone4)上 项目中使用C++。 你知道什么会导致这种行为吗?这就是我在项目中的做法。这是Objective-C打开OTF类型字体。不确定是否能与.ttf一起使用,但值得一试: // Load fonts NSStrin

在iPhone设备上打开字体文件(
*.ttf
)时出现问题。这些文件存储在名为
font
的目录中。系统调用打开(2)退出,错误号为2

我们的项目中有许多文件,这些文件是毫无问题地打开的。只有字体文件失败

iPhone模拟器可以正确打开字体文件。问题只出现在设备(iPhone4)上

项目中使用C++。
你知道什么会导致这种行为吗?

这就是我在项目中的做法。这是Objective-C打开OTF类型字体。不确定是否能与.ttf一起使用,但值得一试:

    // Load fonts
    NSString *fontPathLTStd = [[NSBundle mainBundle] pathForResource:@"TradeGothicLTStd" ofType:@"otf"];
    CGDataProviderRef fontDataProviderLTStd = CGDataProviderCreateWithFilename([fontPathLTStd UTF8String]);
    tradeGothicLTStdFontRef = CGFontCreateWithDataProvider(fontDataProviderLTStd);
    CGDataProviderRelease(fontDataProviderLTStd);

问题是由iPhone设备的大小写敏感行为引起的。iPhone simulator(不区分大小写)和iPhone设备(区分大小写)之间存在差异。

OP需要读取字体文件的内容,而不是创建字体。