NSTextAttachment bounds 含义官方文档翻译

582 阅读1分钟

image.png

bounds

该属性代表文字附件(text attachment)在文字坐标系中的布局边界(layout bounds)。

#声明 iOS、iPadOs、Mac Catalyst、tvOS中

@property(nonatomic) CGRect bounds;

macOS中

@property CGRect bounds;

讨论

边界正方形的原点位于文字基线[1]上的当前字形位置。本属性默认值为CGRectZero

作者注释:
[0]文字的一些概念:下图引自developer.apple.com/library/arc…

image.png [1]文字基线,text baseline。所有字体都有一个自然基线,由字体的 em-square 中每个字形的位置定义。英文的基线和中文(or 韩文 、日文)的文字基线标准也不同。developer.apple.com/fonts/TrueT…