xhan
xhan

Reputation: 6287

Core Text's Paragraph's space is too huge on iOS

I used CoreText to render text as below:

Another very common typesetting operation is drawing a single line of text to use as a label for a user-interface element.
In Core Text this requires only two lines of code, one to create the line object with an attributed string and another to draw the line into a graphic context.
but it shows how to create an attributes dictionary and use it to create.

obvious there're 3 paragraphs. and I use default CTParagraphStyleSetting so that the ParagraphSpacing and ParagraphSpacingBefore is set to 0 by default.

But the rendered result shows the space is too HUGE
rendered text with 3 paragraphs

Any idea to reduce the paragraph space?

Upvotes: 3

Views: 1150

Answers (2)

Volodymyr B.
Volodymyr B.

Reputation: 3441

u can try

kCTParagraphStyleSpecifierMinimumLineHeight
kCTParagraphStyleSpecifierMaximumLineHeight
kCTParagraphStyleSpecifierLineSpacing

Upvotes: 1

Related Questions