CoreText中的行间距和段落对齐 [英] Line spacing and paragraph alignment in CoreText
问题描述
我使用CoreText来渲染多列文本。但是,当我将第一个段落的第一个字母设置为比其余部分更粗的大字体时,会出现2个问题(均在附图中显示):
I am using CoreText to render multiple columns of text. However, when I set the first letter of the 1st paragraph to a bold, larger font than the rest of the text, I incur 2 issues (both visible in the attached image):
-
第一行下面的间距太大(我知道这是因为第一个字符可以是ag,y,p,q等。
The spacing underneath the first line is too big (I understand that this is because the 1st character could be a g,y,p,q etc.
第一行下面的行现在不与下一列中的相应行对齐。
Lines below the first line now do not line up with corresponding lines in the next column.
任何关于如何克服这两个问题的建议都非常感谢,谢谢。
Any advice on how to overcome these 2 issues would be greatly appreciated, thank you.
推荐答案
似乎唯一的解决方法是使用解决方法,第一列的帧,1表示W,1表示第一句的其余部分,1表示第一列的其余部分。
It seems the only way to fix this is with a workaround, which is to create 3 frames for the first column,1 for the W, 1 for the rest of the first sentence and 1 for the rest of the first column.
这篇关于CoreText中的行间距和段落对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!