Re: [csswg-drafts] [css-overflow-4] Ellipsizing of text in middle of string (#3937)

Let's use actual words instead of lined-up letters. If we go from this example, and need to delete 5 characters:
> he greeted them: ?UOY ERA WOH ,HI

Visual middle gives:
> he greeted the…OY ERA WOH ,HI

Logical middle gives:
> he greeted the…?UOY ERA WOH ,

Logical middle looks unexpected and confusing to me.

Also, with visual middle, there's no complication if the font isn't monospaced, or if there are multiple fonts or font sizes on the line, whether there's kerning, whether there is some white space collapsing, some ruby… It's a paint based operation, and so the middle can just be geometrically halfway between the start and end edges. Or we could shift it around a bit if we wanted to without any particular complication. In the case of logical middle, it gets a lot messier. Counting code points is easy, but isn't a particularly good proxy for what feels like the middle to a reader, and doing other things seems an unpleasant mix of complicated and arbitrary.

Thinking in terms of use cases, this particular feature request seems to be driven by ellipsis in the middle of file names, URLs, serial numbers, and the like.

> C:\Photos\صورة.jpg

Here, the bits that are most important to preserve as `C:\` and `.jpg`. For the rest, I'd argue it doesn't really matter all that much what gets chopped off, and to the extend that it does matter, that we're unlikely to find consistent rules that are ideal in all scenarios. For example, here, whether you're better off chopping some of the file name, or some of the directory name, or a bit of both, most likely doesn't depend on how short or long the file name and directory names are, and more likely depends on what the user is trying to do learn from that path.

All in all, unlike [`block-ellipsis`](https://drafts.csswg.org/css-overflow-4/#block-ellipsis), where processing things in logical order does seem important to me, for `text-overflow: middle ellipsis`, I'd argue for visual middle.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3937#issuecomment-1769818217 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 19 October 2023 03:05:09 UTC