GNU bug report logs -
#78621
Pixelwise display specified spaces less precise than min-width
Previous Next
Reported by: Ship Mints <shipmints <at> gmail.com>
Date: Wed, 28 May 2025 19:46:01 UTC
Severity: normal
Tags: notabug
Done: Ship Mints <shipmints <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 78621 <at> debbugs.gnu.org (full text, mbox):
> Cc: 78621 <at> debbugs.gnu.org
> Date: Wed, 28 May 2025 16:07:48 -0700
> From: Jim Porter <jporterbugs <at> gmail.com>
>
> From my read of this bug, the issue was originally that these snippets
> should have the same display width:
>
> (concat "some text"
> (propertize " " 'display
> `(space :width (,(- width width-of-some-text)))))
>
> (propertize "some text" 'display `(min-width ((,width))))
>
> I agree with that, but only if 'width-of-some-text' is computed correctly.
>
> For variable-pitch text, each character cell (I hope I'm using the right
> term here) in the display is a different width, rounded to the nearest
> integer, which means that computing the pixel-width as in your original
> reproducer accumulates small rounding errors for every character.
I don't follow this argument. string-pixel-width uses the display
code, so it should return the exact same value in pixels as what the
actual display produces when the same characters are shown on the
screen. So whatever rounding happens (which I don't think it does,
since font glyphs have integer advance width), it happens the same in
both cases and should yield the same values. Or what am I missing?
This bug report was last modified 50 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.