我想在我的ios應用程序中使用HelveticaNeue-UltraLight。我將字體文件作爲資源添加到我的項目中,並在plist文件中添加「應用程序提供的字體」鍵。文件名是HelveticaNeue.dfont,我已將它添加到關鍵數組中。自定義字體在ios不工作
當我檢查可用的字體我現在可以看到它... ...
NSArray *fonts = [UIFont fontNamesForFamilyName:@"Helvetica Neue"];
for(NSString *string in fonts){
NSLog(@"%@", string);
}
1-07-08 17:32:57.866 myApp[5159:207] HelveticaNeue-Bold
2011-07-08 17:32:57.866 myApp[5159:207] HelveticaNeue-CondensedBlack
2011-07-08 17:32:57.867 myApp[5159:207] HelveticaNeue-Medium
2011-07-08 17:32:57.867 myApp[5159:207] HelveticaNeue
2011-07-08 17:32:57.868 myApp[5159:207] HelveticaNeue-Light
2011-07-08 17:32:57.868 myApp[5159:207] HelveticaNeue-CondensedBold
2011-07-08 17:32:57.868 myApp[5159:207] HelveticaNeue-LightItalic
2011-07-08 17:32:57.869 myApp[5159:207] HelveticaNeue-UltraLightItalic
2011-07-08 17:32:57.869 myApp[5159:207] HelveticaNeue-UltraLight // HERE IT IS!
2011-07-08 17:32:57.869 myApp[5159:207] HelveticaNeue-BoldItalic
2011-07-08 17:32:57.870 myApp[5159:207] HelveticaNeue-Italic
但是,當我嘗試把它[UIFont fontWithName:@「HelveticaNeue-超輕」大小:12]我剛獲得HelveticaNeue-Light ..
我沒有收到任何錯誤或警告。 請幫忙!
我嘗試了幾個空白模式,沒有去...我也看到了鏈接..謝謝!它真的讓我困惑,HelveticaNeue-UltraLightItalic確實可行! –
這是過時的,但我仍然在這裏,所以FYI正確的格式現在是HelveticaNeue-UltraLight,請參閱http://iosfonts.com/獲取完整列表。 –