zoukankan      html  css  js  c++  java
  • iphone 字体

     今天在网上找了下,iphone的UITextView字体类型的设置。现总结如下,如有误,欢迎指正。


       [textView setFont:[UIFont fontWithName:@"TrebuchetMS-Italic" size:18]];
     但是字体的类型名不好找,总结下有这么些类型:
     

    // 列出iPhone上所有的字体    // List all fonts on iPhone
      NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
      NSArray *fontNames;
      NSInteger indFamily, indFont;
      for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
      {
          NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
          fontNames = [[NSArray alloc] initWithArray:
              [UIFont fontNamesForFamilyName:
              [familyNames objectAtIndex:indFamily]]];
          for (indFont=0; indFont<[fontNames count]; ++indFont)
          {
              NSLog(@"    Font name: %@", [fontNames objectAtIndex:indFont]);
          }
          [fontNames release];
      }
      [familyNames release];

    如果使用iPhone SDK v2.1输出结果如下: 
    Family name: Hiragino Kaku Gothic ProN W3
        Font name: HiraKakuProN-W3
    Family name: Courier
        Font name: Courier
        Font name: Courier-BoldOblique
        Font name: Courier-Oblique
        Font name: Courier-Bold
    Family name: Arial
        Font name: ArialMT
        Font name: Arial-BoldMT
        Font name: Arial-BoldItalicMT
        Font name: Arial-ItalicMT
    Family name: STHeiti TC
        Font name: STHeitiTC-Light
        Font name: STHeitiTC-Medium
    Family name: AppleGothic
        Font name: AppleGothic
    Family name: Courier New
        Font name: CourierNewPS-BoldMT
        Font name: CourierNewPS-ItalicMT
        Font name: CourierNewPS-BoldItalicMT
        Font name: CourierNewPSMT
    Family name: Zapfino
        Font name: Zapfino
    Family name: Hiragino Kaku Gothic ProN W6
        Font name: HiraKakuProN-W6
    Family name: Arial Unicode MS
        Font name: ArialUnicodeMS
    Family name: STHeiti SC
        Font name: STHeitiSC-Medium
        Font name: STHeitiSC-Light
    Family name: American Typewriter
        Font name: AmericanTypewriter
        Font name: AmericanTypewriter-Bold
    Family name: Helvetica
        Font name: Helvetica-Oblique
        Font name: Helvetica-BoldOblique
        Font name: Helvetica
        Font name: Helvetica-Bold
    Family name: Marker Felt
        Font name: MarkerFelt-Thin
    Family name: Helvetica Neue
        Font name: HelveticaNeue
        Font name: HelveticaNeue-Bold
    Family name: DB LCD Temp
        Font name: DBLCDTempBlack
    Family name: Verdana
        Font name: Verdana-Bold
        Font name: Verdana-BoldItalic
        Font name: Verdana
        Font name: Verdana-Italic
    Family name: Times New Roman
        Font name: TimesNewRomanPSMT
        Font name: TimesNewRomanPS-BoldMT
        Font name: TimesNewRomanPS-BoldItalicMT
        Font name: TimesNewRomanPS-ItalicMT
    Family name: Georgia
        Font name: Georgia-Bold
        Font name: Georgia
        Font name: Georgia-BoldItalic
        Font name: Georgia-Italic
    Family name: STHeiti J
        Font name: STHeitiJ-Medium
        Font name: STHeitiJ-Light
    Family name: Arial Rounded MT Bold
        Font name: ArialRoundedMTBold
    Family name: Trebuchet MS
        Font name: TrebuchetMS-Italic
        Font name: TrebuchetMS
        Font name: Trebuchet-BoldItalic
        Font name: TrebuchetMS-Bold
    Family name: STHeiti K
        Font name: STHeitiK-Medium
        Font name: STHeitiK-Light

    come from http://blog.csdn.net/dyhbrewer/article/details/6739733

  • 相关阅读:
    资深项目经理推荐的几款免费/开源项目管理工具
    内网穿透工具frp简单使用教程
    10部全尺度欧美宫斗剧!献给不甘平淡的你
    Spring Boot后端+Vue前端+微信小程序,完整的开源解决方案!
    搭建Keepalived + Nginx + Tomcat的高可用负载均衡架构
    集成Activiti工作流的J2EE快速开发框架
    国内5大前端团队网站,你了解多少
    5 天 4000 star 的一个爆款开源项目
    「干货」常用的10个网络DOS命令,菜鸟学了变高手
    js自定义正则表达式
  • 原文地址:https://www.cnblogs.com/likwo/p/3067385.html
Copyright © 2011-2022 走看看