美文网首页
【转】UIFont的lineHeight与pointSize

【转】UIFont的lineHeight与pointSize

作者: 棒棒德 | 来源:发表于2019-12-09 18:00 被阅读0次

转载自:https://blog.csdn.net/chenyong05314/article/details/70846538

1.UIFont的API里面有哪些属性

// Font attributes

@property(nonatomic,readonly,strong) NSString *familyName;

@property(nonatomic,readonly,strong) NSString *fontName;

@property(nonatomic,readonly)        CGFloat  pointSize;

@property(nonatomic,readonly)        CGFloat  ascender;

@property(nonatomic,readonly)        CGFloat  descender;

@property(nonatomic,readonly)        CGFloat  capHeight;

@property(nonatomic,readonly)        CGFloat  xHeight;

@property(nonatomic,readonly)        CGFloat  lineHeight NS_AVAILABLE_IOS(4_0);

@property(nonatomic,readonly)        CGFloat  leading;

2.看图解释:

2.1 familyName:会把字体名字分成几部分,用空格隔开。

2.2 fontName:表示的字体的名字
2.3 pointSize:就是字体的大小,要获取字体大小就用这个属性。

2.4 ascender和descender意义很明确,就不说了。

2.5 capHeight :表示最高的字符的高度。

2.6 xHeight :表示最低的字符的高度。

2.7 lineHeight : 是行高,当你要计算这些字所占用的高度的时候,要用这个属性。

相关文章

网友评论

      本文标题:【转】UIFont的lineHeight与pointSize

      本文链接:https://www.haomeiwen.com/subject/tuligctx.html