Skip to content

Text overflow with ellipsis is weird and ugly by design #18761

@marcglasberg

Description

@marcglasberg

Latest update: #18761 (comment)


Internal: b/137284394

Here (#4478) Hixie commented:

"Ok the plan is that rather than truncating individual characters until it fit, we will truncate entire atomic positioned glyph sequences (e.g. whole ligatures or shaped words) until the ellipsis fits. That would have the advantage of being much more performant. It would have the disadvantage of truncating the entire word if the whole line was one ligature (e.g. if your line was the word "Zapfino" in the Zapfino font, and it overflowed at the "o", we would replace the whole thing with a "...", rather than just the "no".)"

Although the above comment talks about ligatures, it seems to me this is being ignored, and whole words are simply being removed.

Now suppose the text "Laboris nisi ut aliquip ex ea commodo" gets cut right before word "ex". Since the previous word fits, it may cut some letters of that last word to fit the ellipsis, resulting in:

"Laboris nisi ut aliqu..."

However, if the horizontal space is a litter smaller, than the letter "p" from "aliquip" won't fit, and it will cut the whole word, resulting in:

"Laboris nisi ut ... "

But that's not how overflow works for other platforms, and it makes no sense to remove whole words. The obvious result, if "p" doesn't fit should be, just as before:

"Laboris nisi ut aliqu..."

As things are now, we tend to see a lot of words cut in their last 1 or 2 chars, and a lot of words completely removed, leaving a lot of weird white space. That gets particularly nasty in one line texts like titles.

Please, don't create weird behaviors for things with time-honored traditions like ellipsizing. Stick to what everybody else does. If you want, let the devs choose between both behaviors: enum TestOverflow {clip, fade, ellipsisWords, ellipsisLetters}.

If Arabic and other eastern languages have problems with that (as per issue 4478), you can even do some autodetection for characters of those languages, by adding the enum TestOverflow.ellipsisAutodetect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: annoyanceRepeatedly frustrating issues with non-experimental functionalitya: typographyText rendering, possibly libtxtcustomer: alibabacustomer: bytedancecustomer: chalk (g3)customer: crowdAffects or could affect many people, though not necessarily a specific customer.customer: dream (g3)customer: money (g3)dependency: skiaSkia team may need to help usengineflutter/engine repository. See also e: labels.found in release: 1.22Found to occur in 1.22frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions