Subject: Re: bug#52118: 29.0.50; string-pixel-width reports incorrect width

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 26 Nov 2021 14:41:45 +0100

Arthur Miller <[email-masked]> writes:

> Attached is small lisp program and a screenshot of the output. From the
> screenshot itself it is visible that for string with large non-default font-size
> the reported width is erroneous. It should be close to frame/window size
> in this particular example, but reported size is missing ~500 pixels.

Seems to be working OK for me:

(string-pixel-width
 (propertize "foo" 'face '(:height 500 :background "red")))
=> 300

(string-pixel-width
 (propertize "foo" 'face '(:height 5000 :background "red")))
=> 2997

But you seem to be using an old version, and not from the Emacs repo?

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)
 of 2021-11-17 built on pascal
Repository revision: 1ddebefc9fe178e9e8b4275a45e0eda1bcf7848e
Repository branch: alpha-patch

`string-pixel-width' was rewritten recently.  Could you try a fresh
checkout and see whether the problem is still present?

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