iOS 9中有哪些字体可用?

iOS 9上安装了哪些字体(以及UIFont的名称)?

我找不到像iOS 7这样的列表。即使iosfonts.com没有为iOS9更新。 特别是,我想知道如果我可以在我的iOS应用程序中使用旧金山紧凑版。

遵循@matt和@ stonesam92的build议,我可以得到我正在寻找的字体列表:

 AcademyEngravedLetPlain AlNile AlNile-Bold AmericanTypewriter AmericanTypewriter-Bold AmericanTypewriter-Condensed AmericanTypewriter-CondensedBold AmericanTypewriter-CondensedLight AmericanTypewriter-Light AppleColorEmoji AppleSDGothicNeo-Bold AppleSDGothicNeo-Light AppleSDGothicNeo-Medium AppleSDGothicNeo-Regular AppleSDGothicNeo-SemiBold AppleSDGothicNeo-Thin AppleSDGothicNeo-UltraLight Arial-BoldItalicMT Arial-BoldMT Arial-ItalicMT ArialHebrew ArialHebrew-Bold ArialHebrew-Light ArialMT ArialRoundedMTBold Avenir-Black Avenir-BlackOblique Avenir-Book Avenir-BookOblique Avenir-Heavy Avenir-HeavyOblique Avenir-Light Avenir-LightOblique Avenir-Medium Avenir-MediumOblique Avenir-Oblique Avenir-Roman AvenirNext-Bold AvenirNext-BoldItalic AvenirNext-DemiBold AvenirNext-DemiBoldItalic AvenirNext-Heavy AvenirNext-HeavyItalic AvenirNext-Italic AvenirNext-Medium AvenirNext-MediumItalic AvenirNext-Regular AvenirNext-UltraLight AvenirNext-UltraLightItalic AvenirNextCondensed-Bold AvenirNextCondensed-BoldItalic AvenirNextCondensed-DemiBold AvenirNextCondensed-DemiBoldItalic AvenirNextCondensed-Heavy AvenirNextCondensed-HeavyItalic AvenirNextCondensed-Italic AvenirNextCondensed-Medium AvenirNextCondensed-MediumItalic AvenirNextCondensed-Regular AvenirNextCondensed-UltraLight AvenirNextCondensed-UltraLightItalic Baskerville Baskerville-Bold Baskerville-BoldItalic Baskerville-Italic Baskerville-SemiBold Baskerville-SemiBoldItalic BodoniOrnamentsITCTT BodoniSvtyTwoITCTT-Bold BodoniSvtyTwoITCTT-Book BodoniSvtyTwoITCTT-BookIta BodoniSvtyTwoOSITCTT-Bold BodoniSvtyTwoOSITCTT-Book BodoniSvtyTwoOSITCTT-BookIt BodoniSvtyTwoSCITCTT-Book BradleyHandITCTT-Bold ChalkboardSE-Bold ChalkboardSE-Light ChalkboardSE-Regular Chalkduster Cochin Cochin-Bold Cochin-BoldItalic Cochin-Italic Copperplate Copperplate-Bold Copperplate-Light Courier Courier-Bold Courier-BoldOblique Courier-Oblique CourierNewPS-BoldItalicMT CourierNewPS-BoldMT CourierNewPS-ItalicMT CourierNewPSMT Damascus DamascusBold DamascusLight DamascusMedium DamascusSemiBold DevanagariSangamMN DevanagariSangamMN-Bold Didot Didot-Bold Didot-Italic DiwanMishafi EuphemiaUCAS EuphemiaUCAS-Bold EuphemiaUCAS-Italic Farah Futura-CondensedExtraBold Futura-CondensedMedium Futura-Medium Futura-MediumItalic GeezaPro GeezaPro-Bold Georgia Georgia-Bold Georgia-BoldItalic Georgia-Italic GillSans GillSans-Bold GillSans-BoldItalic GillSans-Italic GillSans-Light GillSans-LightItalic GillSans-SemiBold GillSans-SemiBoldItalic GillSans-UltraBold GujaratiSangamMN GujaratiSangamMN-Bold GurmukhiMN GurmukhiMN-Bold Helvetica Helvetica-Bold Helvetica-BoldOblique Helvetica-Light Helvetica-LightOblique Helvetica-Oblique HelveticaNeue HelveticaNeue-Bold HelveticaNeue-BoldItalic HelveticaNeue-CondensedBlack HelveticaNeue-CondensedBold HelveticaNeue-Italic HelveticaNeue-Light HelveticaNeue-LightItalic HelveticaNeue-Medium HelveticaNeue-MediumItalic HelveticaNeue-Thin HelveticaNeue-ThinItalic HelveticaNeue-UltraLight HelveticaNeue-UltraLightItalic HiraginoSans-W3 HiraginoSans-W6 HiraMinProN-W3 HiraMinProN-W6 HoeflerText-Black HoeflerText-BlackItalic HoeflerText-Italic HoeflerText-Regular IowanOldStyle-Bold IowanOldStyle-BoldItalic IowanOldStyle-Italic IowanOldStyle-Roman Kailasa Kailasa-Bold KannadaSangamMN KannadaSangamMN-Bold KhmerSangamMN KohinoorBangla-Light KohinoorBangla-Regular KohinoorBangla-Semibold KohinoorDevanagari-Light KohinoorDevanagari-Regular KohinoorDevanagari-Semibold KohinoorTelugu-Light KohinoorTelugu-Medium KohinoorTelugu-Regular LaoSangamMN MalayalamSangamMN MalayalamSangamMN-Bold MarkerFelt-Thin MarkerFelt-Wide Menlo-Bold Menlo-BoldItalic Menlo-Italic Menlo-Regular Noteworthy-Bold Noteworthy-Light Optima-Bold Optima-BoldItalic Optima-ExtraBlack Optima-Italic Optima-Regular OriyaSangamMN OriyaSangamMN-Bold Palatino-Bold Palatino-BoldItalic Palatino-Italic Palatino-Roman Papyrus Papyrus-Condensed PartyLetPlain PingFangHK-Light PingFangHK-Medium PingFangHK-Regular PingFangHK-Semibold PingFangHK-Thin PingFangHK-Ultralight PingFangSC-Light PingFangSC-Medium PingFangSC-Regular PingFangSC-Semibold PingFangSC-Thin PingFangSC-Ultralight PingFangTC-Light PingFangTC-Medium PingFangTC-Regular PingFangTC-Semibold PingFangTC-Thin PingFangTC-Ultralight SavoyeLetPlain SinhalaSangamMN SinhalaSangamMN-Bold SnellRoundhand SnellRoundhand-Black SnellRoundhand-Bold Symbol TamilSangamMN TamilSangamMN-Bold Thonburi Thonburi-Bold Thonburi-Light TimesNewRomanPS-BoldItalicMT TimesNewRomanPS-BoldMT TimesNewRomanPS-ItalicMT TimesNewRomanPSMT Trebuchet-BoldItalic TrebuchetMS TrebuchetMS-Bold TrebuchetMS-Italic Verdana Verdana-Bold Verdana-BoldItalic Verdana-Italic ZapfDingbatsITC Zapfino 

您可以通过在设备上运行以下代码来打印出已安装字体的列表:

 for (NSString *family in [UIFont familyName]){ NSLog(@"Family name: %@", family); for (NSString *fontName in [UIFont fontNamesForFamilyName:family]) { NSLog(@" >Font name: %@", fontName); } } 

作为亚光州,旧金山契约不包括在这个名单。 虽然您可以从Apple下载字体,但许可协议禁止在iOS上使用它:

“重要提示:苹果旧金山紧凑型字体仅用于创build用户界面的MOCK-UPS,用于在APPLE的watchOS操作系统上运行的软件产品。”

回答你自己的问题。 在设备上运行包含以下行的应用程序:

 UIFont.familyNames().map {UIFont.fontNamesForFamilyName($0)} .forEach {(n:[String]) in n.forEach {print($0)}} 

至于旧金山,这是在设备上,而不是名称; 它是一个系统字体,只能以系统字体或通过dynamictypes说明符访问。