Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

TUITextRenderer Break modes with multiple lines #70

Closed
erndev opened this issue Sep 24, 2011 · 2 comments
Closed

TUITextRenderer Break modes with multiple lines #70

erndev opened this issue Sep 24, 2011 · 2 comments

Comments

@erndev
Copy link

erndev commented Sep 24, 2011

When lineBreakMode is set for the renderer, it seems to behave differently when the frame allows drawing multiple lines of the text.
For a frame that can contain multiple lines, if the text renderer properties are set like this:

[textRedender setAlignment:TUITextAlignmentLeft lineBreakMode:TUILineBreakModeWordWrap];

Multiple lines are drawn, the last line is wrapped to the last word, and the ellipsis is not drawn as expected.

But it i change the properties to this:

[textRedender setAlignment:TUITextAlignmentLeft lineBreakMode:TUILineBreakModeWordWrap | TUILineBreakModeTailTruncation];

then the ellipsis is shown at the end, but only the first line is drawn. The rest of the lines are not drawn by the renderer.

EDIT: Added screenshot

screenshot

The upper part has been drawn without TUILineBreakModeTailTruncation. It shows both lines. The lower part was drawn with that option added, and in this case, the second line is not drawn. The frame size is the same in both cases.

@lorenbrichter
Copy link
Contributor

Is this a TUITextRenderer issue or a Core Text issue? (I've never tried doing ellipsis with multiple lines of text). Does Core Text support that?

@erndev
Copy link
Author

erndev commented Sep 26, 2011

Well, searching a bit about it, it seems that's the expected behavior of CoreText. I was expecting it to behave in a similar way as "Truncate last visible line" in NSTextfield, or the parameter NSStringDrawingTruncatesLastVisibleLine of NSAttributtedString. It seems that the text must be drawn line by line to achieve that.

After further reading, it's definitely how CoreText works, so i am closing the issue.

@erndev erndev closed this as completed Oct 17, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants