UIFont

1、

//
//  ViewController.m


#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    CGFloat width = [[UIScreen mainScreen] bounds].size.width;
    CGFloat height = [[UIScreen mainScreen] bounds].size.height;
    
    
    UILabel * label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, width - 40, 30)];
    label1.text = @"系统默认字体尺寸";
    //系统默认字体尺寸
    label1.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
    [self.view addSubview:label1];
    
    UILabel * label11 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 40, width - 40, 30)];
    label11.text = @"无修饰---系统默认字体尺寸";
    //系统默认字体尺寸
    label11.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
    [self.view addSubview:label11];
    
    UILabel * label12 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 80, width - 40, 30)];
    label12.text = @"粗体---系统默认字体尺寸";
    //系统默认字体尺寸
    label12.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]];
    [self.view addSubview:label12];
    
    UILabel * label13 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 120, width - 40, 30)];
//    label13.text = @"斜体---系统默认字体尺寸";
    label13.text = @"this is Italic";
    //系统默认字体尺寸
    label13.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]];
    [self.view addSubview:label13];
    
    
    
    UILabel * label2 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 160, width - 40, 30)];
    label2.text = @"小字体尺寸";
    //小字体尺寸
    label2.font = [UIFont systemFontOfSize:[UIFont smallSystemFontSize]];
    [self.view addSubview:label2];
    
    UILabel * label3 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 200, width - 40, 30)];
    label3.text = @"标签字体尺寸";
    //标签字体尺寸
    label3.font = [UIFont systemFontOfSize:[UIFont labelFontSize]];
    [self.view addSubview:label3];
    
    UILabel * label4 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100 + 240, width - 40, 30)];
    label4.text = @"按钮字体尺寸";
    //按钮字体尺寸
    label4.font = [UIFont systemFontOfSize:[UIFont buttonFontSize]];
    [self.view addSubview:label4];
    
    
    NSArray * arrayOfFont = [UIFont familyNames];
    NSLog(@"%@", arrayOfFont);
    
    //根据字体名创建字体
//    UIFont * font = [UIFont fontWithName:<#(nonnull NSString *)#> size:<#(CGFloat)#>]
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


所有系统字体:

2015-12-02 09:30:10.468 07-uifont[852:14091] (
    Copperplate,
    "Heiti SC",
    "Iowan Old Style",
    "Kohinoor Telugu",
    Thonburi,
    "Heiti TC",
    "Courier New",
    "Gill Sans",
    "Apple SD Gothic Neo",
    "Marker Felt",
    "Avenir Next Condensed",
    "Tamil Sangam MN",
    "Helvetica Neue",
    "Gurmukhi MN",
    "Times New Roman",
    Georgia,
    "Apple Color Emoji",
    "Arial Rounded MT Bold",
    Kailasa,
    "Kohinoor Devanagari",
    "Kohinoor Bangla",
    "Chalkboard SE",
    "Sinhala Sangam MN",
    "PingFang TC",
    "Gujarati Sangam MN",
    Damascus,
    Noteworthy,
    "Geeza Pro",
    Avenir,
    "Academy Engraved LET",
    Mishafi,
    Futura,
    Farah,
    "Kannada Sangam MN",
    "Arial Hebrew",
    Arial,
    "Party LET",
    Chalkduster,
    "Hoefler Text",
    Optima,
    Palatino,
    "Lao Sangam MN",
    "Malayalam Sangam MN",
    "Al Nile",
    "Bradley Hand",
    "PingFang HK",
    "Trebuchet MS",
    Helvetica,
    Courier,
    Cochin,
    "Hiragino Mincho ProN",
    "Devanagari Sangam MN",
    "Oriya Sangam MN",
    "Snell Roundhand",
    "Zapf Dingbats",
    "Bodoni 72",
    Verdana,
    "American Typewriter",
    "Avenir Next",
    Baskerville,
    "Khmer Sangam MN",
    Didot,
    "Savoye LET",
    "Bodoni Ornaments",
    Symbol,
    Menlo,
    "Bodoni 72 Smallcaps",
    Papyrus,
    "Hiragino Sans",
    "PingFang SC",
    "Euphemia UCAS",
    "Telugu Sangam MN",
    "Bangla Sangam MN",
    Zapfino,
    "Bodoni 72 Oldstyle"
)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值