Search code examples
iphonecocoacocoa-touchipadcore-text

Line spacing and paragraph alignment in CoreText


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):

  1. 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.

  2. 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. enter image description here


Solution

  • 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.