段落的最后两行之间的空格更大? [英] Space between the last 2 lines of a paragraph is larger?

查看:162
本文介绍了段落的最后两行之间的空格更大?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CTFramesetter绘制文本,我设置了 kCTParagraphStyleSpecifierParagraphSpacing kCTParagraphStyleSpecifierLineSpacing kCTParagraphStyleSpecifierParagraphSpacingBefore 全部为0.0。

I draw the text using CTFramesetter, I have set kCTParagraphStyleSpecifierParagraphSpacing, kCTParagraphStyleSpecifierLineSpacing, kCTParagraphStyleSpecifierParagraphSpacingBefore all to 0.0.

正如您在图片中看到的那样,段落的最后两行之间的空间比其他段落大得多。

As you can see in the image, the space between the last 2 lines of a paragraph is much larger than others'.

此图片总共有15行,我粘贴了上升下降前导来源.y 在下面,我们可以看到第5行和第10行的上升和下降比其他行更大,我找不到任何说明符来设置以避免这种奇怪的布局。

There're in total 15 lines in this image, I pasted their ascent, descent, leading, origin.y in the following, we can see that the ascent and descent on the 5th and 10th line are larger than others', I couldn't find any specifier to set to avoid this weird layout.

任何想法?

1  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 399.000000
2  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 374.000000
3  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 349.000000
4  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 324.000000
5  ascent=25.722656, desecent=13.699219, leading=0.720000, origin.y: 294.000000
6  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 258.000000
7  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 233.000000
8  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 208.000000
9  ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 183.000000
10 ascent=25.722656, descent=13.699219, leading=0.720000, origin.y: 153.000000
11 ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 117.000000
12 ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 92.000000
13 ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 67.000000
14 ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 42.000000
15 ascent=20.639999, descent=3.360000, leading=0.720000, origin.y: 17.000000 

推荐答案

Damit,这是一个错误。 DTCoreText通过重新定位受影响线的基线来源来解决这个问题。

Damit, it's a bug. DTCoreText works around this by repositioning the baseline origins of those affected lines.

参见 http://www.cocoanetics.com/2012/02/radar-coretext-line-spacing-bug/

这篇关于段落的最后两行之间的空格更大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆