Skip to content

Add text truncation with ellipsis on max height#41

Open
tillderoquefeuil wants to merge 1 commit into
jay3332:mainfrom
miroir-os:feat_ellipsis_v2
Open

Add text truncation with ellipsis on max height#41
tillderoquefeuil wants to merge 1 commit into
jay3332:mainfrom
miroir-os:feat_ellipsis_v2

Conversation

@tillderoquefeuil
Copy link
Copy Markdown
Contributor

Adds max_height field to TextSegment with a with_max_height builder method. When set, TextLayout truncates overflowing text with ... using a binary search over UTF-8 char boundaries to find the optimal cut point.

Rebased onto current main to align with the v0.11 API changes (TextSegment<'font, 'text, P>, consolidated with_wrap, etc.).

Supersedes #36.

Add `max_height` field to `TextSegment` with `with_max_height` builder.
When set, `TextLayout` truncates text with "..." using a UTF-8 safe
binary search over char boundaries to find the optimal cut point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant