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

From: Daniel Mendler <[email-masked]>
Date: Mon, 12 Apr 2021 19:18:11 +0200

On 4/12/21 7:01 PM, Eli Zaretskii wrote:
> You can still use your code in org-table, if it does the job, I just
> don't think we should have a semi-working API in core.

This is a reasonable. Extending `string-width` with two optional 
begin/end arguments would still be a welcome addition.

> (There's indeed something strange with the results, I think the
> with-current-buffer thing is not enough (because if I manually switch
> to buffer "foo" and run the function, it returns correct results).  I
> will take a closer look when I have time, unless martin beats me to
> it.)

Thank you, it would be great if you figure it out. Then the 
`window-text-pixel-size` becomes a good alternative to computing the 
string width manually from the display and invisible properties as I am 
doing as of now.