CoreText: text rendering differently after iOS 9

I am updating the application for iOS 11, which was written in 2011. The application is an interactive book and uses CoreText. When the application is built against iOS 9, the text is displayed as expected, but when it is created against iOS 10 or later, the text is not displayed correctly (see Image). It seems that the problems are related to changing the processing of spaces and / or line spacing. I tried to change the values ​​for different CTParagraphStyleSpecifier, but none of them have the desired result. Editing text is not a viable option, so the fix should be related to fixing CoreText. My questions:

  • Can I configure CoreText after iOS 9 to render as versions prior to iOS 9?
  • If it is impossible to fix CoreText, will there be problems with sending the application if it is created against iOS 9?

CoreText rendering screenshot on iOS9 and iOS10

+4
source share
1 answer

I am not making a page layout, it seems to give a very spatial CGPathRef for the CTFramesetter and layout of the whole page in one CTFrameRef.

So, if the distance between the lines (or the height of the line) increases, the lines end from the projected areas.

Adjust the following CTParagraphStyleSpecifier, perhaps useful, depending on what you used:

kCTParagraphStyleSpecifierLineHeightMultiple
kCTParagraphStyleSpecifierMaximumLineHeight
kCTParagraphStyleSpecifierMinimumLineHeight
kCTParagraphStyleSpecifierLineSpacing
kCTParagraphStyleSpecifierMaximumLineSpacing
kCTParagraphStyleSpecifierMinimumLineSpacing
kCTParagraphStyleSpecifierLineSpacingAdjustment
0
source

Source: https://habr.com/ru/post/1685431/


All Articles