星空网 > 软件开发 > 操作系统

CoreText 关键性常用函数说明

CoreText类真的太强大了,不服不行。

 

1.这个函数用来处理行宽不一致的问题,有些行的由于内部有一些标点符号,无法占满整行,导致行宽参差不齐,这个函数专门处理这个问题。

CTLineRef __nullable CTLineCreateJustifiedLine(

    CTLineRef line,

    CGFloat justificationFactor,

    double justificationWidth ) CT_AVAILABLE(10_5, 3_2);

 

2. 获取行中间某一个索引位置的字符的x坐标

CGFloat CTLineGetOffsetForStringIndex(

    CTLineRef line,

    CFIndex charIndex,

    CGFloat * __nullable secondaryOffset ) CT_AVAILABLE(10_5, 3_2);

 

3.根据一个点的坐标位置获取在这个行中字符位置的索引

CFIndex CTLineGetStringIndexForPosition(

    CTLineRef line,

    CGPoint position ) CT_AVAILABLE(10_5, 3_2);

 

 

4.获取行的一些信息,其中返回值为行的整体宽度,行的高度为ascent+descent

double CTLineGetTypographicBounds(

    CTLineRef line,

    CGFloat * __nullable ascent,

    CGFloat * __nullable descent,

    CGFloat * __nullable leading ) CT_AVAILABLE(10_5, 3_2);




原标题:CoreText 关键性常用函数说明

关键词:函数

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

阳明海运股份有限公司:https://www.goluckyvip.com/news/8104.html
易诚仓储:https://www.goluckyvip.com/news/8105.html
义达物流:https://www.goluckyvip.com/news/8106.html
越航物流:https://www.goluckyvip.com/news/8107.html
盈和国际物流:https://www.goluckyvip.com/news/8108.html
异地报关:https://www.goluckyvip.com/news/8109.html
三亚有哪些酒店值得入住?:https://www.vstour.cn/a/366173.html
零售晚报:丽人丽妆2023年扭亏为盈 玉容初、美壹堂等自有品牌增速超40% :https://www.kjdsnews.com/a/1836649.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流