You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ASTextKitFontSizeAdjuster class tries to find te longest word to prevent character wrapping. This is done by finding the longest word in terms of character count. For a monospaced font this is correct but not for proportional font. For instance the word 'Thanksgiving' counts 12 characters but is in terms of size longer than 'Tellerfleisch' which counts 13 characters.
So you may end up in the following situation:
Thanksgivin
g
Tellerfleisch
Also a NSAttributedString can contain multiple styles. The current implementation assumes that the style of first occurrence of the longest word is the style of the complete text. So the current implementation isn't accurate.
I implemented a version which checks the actual width of the different words. This comes with a performance penalty, but is accurate.
The text was updated successfully, but these errors were encountered:
The ASTextKitFontSizeAdjuster class tries to find te longest word to prevent character wrapping. This is done by finding the longest word in terms of character count. For a monospaced font this is correct but not for proportional font. For instance the word 'Thanksgiving' counts 12 characters but is in terms of size longer than 'Tellerfleisch' which counts 13 characters.
So you may end up in the following situation:
Thanksgivin
g
Tellerfleisch
Also a NSAttributedString can contain multiple styles. The current implementation assumes that the style of first occurrence of the longest word is the style of the complete text. So the current implementation isn't accurate.
I implemented a version which checks the actual width of the different words. This comes with a performance penalty, but is accurate.
The text was updated successfully, but these errors were encountered: