Subject: Re: bug#30746: window-text-pixel-width includes width of following propertized space

From: Clément Pit-Claudel <[email-masked]>
Date: Fri, 16 Mar 2018 10:09:40 -0400

On 2018-03-08 08:33, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <[email-masked]>
>> Date: Wed, 7 Mar 2018 17:13:32 -0500
>>
>> (progn
>>   (save-excursion
>>     (insert #("s " 1 2 (display (space :width (50))))))
>>   (window-text-pixel-size nil (point) (1+ (point))))
>>
>> On my machine a single 's' is 8 pixels wide, but this snippet returns 58.  
>>
>> The following snippet, however, returns 8 as expected:
>>
>> (progn
>>   (save-excursion
>>     (insert "s "))
>>   (window-text-pixel-size nil (point) (1+ (point))))
>>
>> It seems that adding a display property on the space changes the return value of window-text-pixel-size; is that expected?
> 
> It's expected given the relatively naïve implementation, which didn't
> expect such calamities.  Hopefully now fixed on the master branch.

Thanks a lot; the width is indeed fixed.  However, the fix seems to have broken the height calculation: the first snippet above now returns (8 . 0), whereas the second one returns (8 . 16).

Cheers,
Clément.