实用小技巧(六):打印ios里所有字体

版本记录

版本号 时间
V1.0 2017.06.23

前言

很多app都有建立小组或者社区的功能,或者给某人添加几个描述标签等等,这些功能都需要动态的添加标签视图,这一篇就讲述一下添加方法。感兴趣的可以看看我写的其他小技巧
1. 实用小技巧(一):UIScrollView中上下左右滚动方向的判断

2. 实用小技巧(二):屏幕横竖屏的判断和相关逻辑
3.实用小技巧(三):点击手势屏蔽子视图的响应
4.实用小技巧(四):动态的增删标签视图
5.实用小技巧(五):通过相册或者相机更改图标

详情

  很多时候我们都需要设置字体的颜色,ios有自己的字体库,比如PingFangSC库名字,它里面也包含了很多其他的字体,下面我们就用代码打印出来字体。先看代码。

#pragma mark - Object Private Function

- (void)getFontNames
{
    NSArray *familyNames = [UIFont familyNames];
    
    for (NSString *familyName in familyNames) {
        printf("familyNames = %s\n",[familyName UTF8String]);
        
        NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
        
        for (NSString *fontName in fontNames) {
            printf("\tfontName = %s\n",[fontName UTF8String]);
        }
    }
}

下面我们就看输出结果。

familyNames = Copperplate
    fontName = Copperplate-Light
    fontName = Copperplate
    fontName = Copperplate-Bold
familyNames = Heiti SC
familyNames = Kohinoor Telugu
    fontName = KohinoorTelugu-Regular
    fontName = KohinoorTelugu-Medium
    fontName = KohinoorTelugu-Light
familyNames = Thonburi
    fontName = Thonburi
    fontName = Thonburi-Bold
    fontName = Thonburi-Light
familyNames = Heiti TC
familyNames = Courier New
    fontName = CourierNewPS-BoldMT
    fontName = CourierNewPS-ItalicMT
    fontName = CourierNewPSMT
    fontName = CourierNewPS-BoldItalicMT
familyNames = Gill Sans
    fontName = GillSans-Italic
    fontName = GillSans-Bold
    fontName = GillSans-BoldItalic
    fontName = GillSans-LightItalic
    fontName = GillSans
    fontName = GillSans-Light
    fontName = GillSans-SemiBold
    fontName = GillSans-SemiBoldItalic
    fontName = GillSans-UltraBold
familyNames = Apple SD Gothic Neo
    fontName = AppleSDGothicNeo-Bold
    fontName = AppleSDGothicNeo-UltraLight
    fontName = AppleSDGothicNeo-Thin
    fontName = AppleSDGothicNeo-Regular
    fontName = AppleSDGothicNeo-Light
    fontName = AppleSDGothicNeo-Medium
    fontName = AppleSDGothicNeo-SemiBold
familyNames = Marker Felt
    fontName = MarkerFelt-Thin
    fontName = MarkerFelt-Wide
familyNames = Avenir Next Condensed
    fontName = AvenirNextCondensed-BoldItalic
    fontName = AvenirNextCondensed-Heavy
    fontName = AvenirNextCondensed-Medium
    fontName = AvenirNextCondensed-Regular
    fontName = AvenirNextCondensed-HeavyItalic
    fontName = AvenirNextCondensed-MediumItalic
    fontName = AvenirNextCondensed-Italic
    fontName = AvenirNextCondensed-UltraLightItalic
    fontName = AvenirNextCondensed-UltraLight
    fontName = AvenirNextCondensed-DemiBold
    fontName = AvenirNextCondensed-Bold
    fontName = AvenirNextCondensed-DemiBoldItalic
familyNames = Tamil Sangam MN
    fontName = TamilSangamMN
    fontName = TamilSangamMN-Bold
familyNames = Helvetica Neue
    fontName = HelveticaNeue-Italic
    fontName = HelveticaNeue-Bold
    fontName = HelveticaNeue-UltraLight
    fontName = HelveticaNeue-CondensedBlack
    fontName = HelveticaNeue-BoldItalic
    fontName = HelveticaNeue-CondensedBold
    fontName = HelveticaNeue-Medium
    fontName = HelveticaNeue-Light
    fontName = HelveticaNeue-Thin
    fontName = HelveticaNeue-ThinItalic
    fontName = HelveticaNeue-LightItalic
    fontName = HelveticaNeue-UltraLightItalic
    fontName = HelveticaNeue-MediumItalic
    fontName = HelveticaNeue
familyNames = Gurmukhi MN
    fontName = GurmukhiMN-Bold
    fontName = GurmukhiMN
familyNames = Times New Roman
    fontName = TimesNewRomanPSMT
    fontName = TimesNewRomanPS-BoldItalicMT
    fontName = TimesNewRomanPS-ItalicMT
    fontName = TimesNewRomanPS-BoldMT
familyNames = Georgia
    fontName = Georgia-BoldItalic
    fontName = Georgia
    fontName = Georgia-Italic
    fontName = Georgia-Bold
familyNames = Apple Color Emoji
    fontName = AppleColorEmoji
familyNames = Arial Rounded MT Bold
    fontName = ArialRoundedMTBold
familyNames = Kailasa
    fontName = Kailasa-Bold
    fontName = Kailasa
familyNames = Kohinoor Devanagari
    fontName = KohinoorDevanagari-Light
    fontName = KohinoorDevanagari-Regular
    fontName = KohinoorDevanagari-Semibold
familyNames = Kohinoor Bangla
    fontName = KohinoorBangla-Semibold
    fontName = KohinoorBangla-Regular
    fontName = KohinoorBangla-Light
familyNames = Chalkboard SE
    fontName = ChalkboardSE-Bold
    fontName = ChalkboardSE-Light
    fontName = ChalkboardSE-Regular
familyNames = Sinhala Sangam MN
    fontName = SinhalaSangamMN-Bold
    fontName = SinhalaSangamMN
familyNames = PingFang TC
    fontName = PingFangTC-Medium
    fontName = PingFangTC-Regular
    fontName = PingFangTC-Light
    fontName = PingFangTC-Ultralight
    fontName = PingFangTC-Semibold
    fontName = PingFangTC-Thin
familyNames = Gujarati Sangam MN
    fontName = GujaratiSangamMN-Bold
    fontName = GujaratiSangamMN
familyNames = Damascus
    fontName = DamascusLight
    fontName = DamascusBold
    fontName = DamascusSemiBold
    fontName = DamascusMedium
    fontName = Damascus
familyNames = Noteworthy
    fontName = Noteworthy-Light
    fontName = Noteworthy-Bold
familyNames = Geeza Pro
    fontName = GeezaPro
    fontName = GeezaPro-Bold
familyNames = Avenir
    fontName = Avenir-Medium
    fontName = Avenir-HeavyOblique
    fontName = Avenir-Book
    fontName = Avenir-Light
    fontName = Avenir-Roman
    fontName = Avenir-BookOblique
    fontName = Avenir-MediumOblique
    fontName = Avenir-Black
    fontName = Avenir-BlackOblique
    fontName = Avenir-Heavy
    fontName = Avenir-LightOblique
    fontName = Avenir-Oblique
familyNames = Academy Engraved LET
    fontName = AcademyEngravedLetPlain
familyNames = Mishafi
    fontName = DiwanMishafi
familyNames = Futura
    fontName = Futura-CondensedMedium
    fontName = Futura-CondensedExtraBold
    fontName = Futura-Medium
    fontName = Futura-MediumItalic
    fontName = Futura-Bold
familyNames = Farah
    fontName = Farah
familyNames = Kannada Sangam MN
    fontName = KannadaSangamMN
    fontName = KannadaSangamMN-Bold
familyNames = Arial Hebrew
    fontName = ArialHebrew-Bold
    fontName = ArialHebrew-Light
    fontName = ArialHebrew
familyNames = Arial
    fontName = ArialMT
    fontName = Arial-BoldItalicMT
    fontName = Arial-BoldMT
    fontName = Arial-ItalicMT
familyNames = Party LET
    fontName = PartyLetPlain
familyNames = Chalkduster
    fontName = Chalkduster
familyNames = Hoefler Text
    fontName = HoeflerText-Italic
    fontName = HoeflerText-Regular
    fontName = HoeflerText-Black
    fontName = HoeflerText-BlackItalic
familyNames = Optima
    fontName = Optima-Regular
    fontName = Optima-ExtraBlack
    fontName = Optima-BoldItalic
    fontName = Optima-Italic
    fontName = Optima-Bold
familyNames = Palatino
    fontName = Palatino-Bold
    fontName = Palatino-Roman
    fontName = Palatino-BoldItalic
    fontName = Palatino-Italic
familyNames = Lao Sangam MN
    fontName = LaoSangamMN
familyNames = Malayalam Sangam MN
    fontName = MalayalamSangamMN-Bold
    fontName = MalayalamSangamMN
familyNames = Al Nile
    fontName = AlNile-Bold
    fontName = AlNile
familyNames = Bradley Hand
    fontName = BradleyHandITCTT-Bold
familyNames = PingFang HK
    fontName = PingFangHK-Ultralight
    fontName = PingFangHK-Semibold
    fontName = PingFangHK-Thin
    fontName = PingFangHK-Light
    fontName = PingFangHK-Regular
    fontName = PingFangHK-Medium
familyNames = Trebuchet MS
    fontName = Trebuchet-BoldItalic
    fontName = TrebuchetMS
    fontName = TrebuchetMS-Bold
    fontName = TrebuchetMS-Italic
familyNames = Helvetica
    fontName = Helvetica-Bold
    fontName = Helvetica
    fontName = Helvetica-LightOblique
    fontName = Helvetica-Oblique
    fontName = Helvetica-BoldOblique
    fontName = Helvetica-Light
familyNames = Courier
    fontName = Courier-BoldOblique
    fontName = Courier
    fontName = Courier-Bold
    fontName = Courier-Oblique
familyNames = Cochin
    fontName = Cochin-Bold
    fontName = Cochin
    fontName = Cochin-Italic
    fontName = Cochin-BoldItalic
familyNames = Hiragino Mincho ProN
    fontName = HiraMinProN-W6
    fontName = HiraMinProN-W3
familyNames = Devanagari Sangam MN
    fontName = DevanagariSangamMN
    fontName = DevanagariSangamMN-Bold
familyNames = Oriya Sangam MN
    fontName = OriyaSangamMN
    fontName = OriyaSangamMN-Bold
familyNames = Snell Roundhand
    fontName = SnellRoundhand-Bold
    fontName = SnellRoundhand
    fontName = SnellRoundhand-Black
familyNames = Zapf Dingbats
    fontName = ZapfDingbatsITC
familyNames = Bodoni 72
    fontName = BodoniSvtyTwoITCTT-Bold
    fontName = BodoniSvtyTwoITCTT-Book
    fontName = BodoniSvtyTwoITCTT-BookIta
familyNames = Verdana
    fontName = Verdana-Italic
    fontName = Verdana-BoldItalic
    fontName = Verdana
    fontName = Verdana-Bold
familyNames = American Typewriter
    fontName = AmericanTypewriter-CondensedLight
    fontName = AmericanTypewriter
    fontName = AmericanTypewriter-CondensedBold
    fontName = AmericanTypewriter-Light
    fontName = AmericanTypewriter-Semibold
    fontName = AmericanTypewriter-Bold
    fontName = AmericanTypewriter-Condensed
familyNames = Avenir Next
    fontName = AvenirNext-UltraLight
    fontName = AvenirNext-UltraLightItalic
    fontName = AvenirNext-Bold
    fontName = AvenirNext-BoldItalic
    fontName = AvenirNext-DemiBold
    fontName = AvenirNext-DemiBoldItalic
    fontName = AvenirNext-Medium
    fontName = AvenirNext-HeavyItalic
    fontName = AvenirNext-Heavy
    fontName = AvenirNext-Italic
    fontName = AvenirNext-Regular
    fontName = AvenirNext-MediumItalic
familyNames = Baskerville
    fontName = Baskerville-Italic
    fontName = Baskerville-SemiBold
    fontName = Baskerville-BoldItalic
    fontName = Baskerville-SemiBoldItalic
    fontName = Baskerville-Bold
    fontName = Baskerville
familyNames = Khmer Sangam MN
    fontName = KhmerSangamMN
familyNames = Didot
    fontName = Didot-Italic
    fontName = Didot-Bold
    fontName = Didot
familyNames = Savoye LET
    fontName = SavoyeLetPlain
familyNames = Bodoni Ornaments
    fontName = BodoniOrnamentsITCTT
familyNames = Symbol
    fontName = Symbol
familyNames = Menlo
    fontName = Menlo-Italic
    fontName = Menlo-Bold
    fontName = Menlo-Regular
    fontName = Menlo-BoldItalic
familyNames = Bodoni 72 Smallcaps
    fontName = BodoniSvtyTwoSCITCTT-Book
familyNames = Papyrus
    fontName = Papyrus
    fontName = Papyrus-Condensed
familyNames = Hiragino Sans
    fontName = HiraginoSans-W3
    fontName = HiraginoSans-W6
familyNames = PingFang SC
    fontName = PingFangSC-Ultralight
    fontName = PingFangSC-Regular
    fontName = PingFangSC-Semibold
    fontName = PingFangSC-Thin
    fontName = PingFangSC-Light
    fontName = PingFangSC-Medium
familyNames = Myanmar Sangam MN
    fontName = MyanmarSangamMN-Bold
    fontName = MyanmarSangamMN
familyNames = Euphemia UCAS
    fontName = EuphemiaUCAS-Italic
    fontName = EuphemiaUCAS
    fontName = EuphemiaUCAS-Bold
familyNames = Telugu Sangam MN
familyNames = Bangla Sangam MN
familyNames = Zapfino
    fontName = Zapfino
familyNames = Bodoni 72 Oldstyle
    fontName = BodoniSvtyTwoOSITCTT-Book
    fontName = BodoniSvtyTwoOSITCTT-Bold
    fontName = BodoniSvtyTwoOSITCTT-BookIt

这里就有我们经常用的字体。

familyNames = PingFang SC
    fontName = PingFangSC-Ultralight
    fontName = PingFangSC-Regular
    fontName = PingFangSC-Semibold
    fontName = PingFangSC-Thin
    fontName = PingFangSC-Light
    fontName = PingFangSC-Medium

大家看看就可以了。

后记

这里就是给大家看看的,看看就可以了。

风景壁纸
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,142评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,298评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,068评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,081评论 1 291
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,099评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,071评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,990评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,832评论 0 273
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,274评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,488评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,649评论 1 347
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,378评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,979评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,625评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,796评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,643评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,545评论 2 352

推荐阅读更多精彩内容