Subject: bug#47712: 27.1; Provide `string-display-width` function, which takes properties into account, `substring-width`

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 12 Apr 2021 10:53:50 +0200

Daniel Mendler <[email-masked]> writes:

> `window-text-pixel-size` computes the size of a portion of the window,
> it does not take a string argument. The function `string-width`
> instead takes a string argument returning the number of columns needed
> to display this string. This function is needed to compute widths of
> strings which are not yet displayed.

If I understand correctly (and I may not), the proposed function just
takes properties into account (like `invisible' and `display'), but does
not compute pixel sizes at all?

I can see how that may be useful in some cases (and is very different
from `window-text-pixel-size'), so I think adding something like that
would be nice.  But the name is confusing -- it sounds like it's
computing the displayed width, and it's not -- if there's images or text
with a different font in there, it's not taken into account?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no