unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68374: min-width is not correctly treated by buffer-text-pixel-size
@ 2024-01-10 22:22 JD Smith
  2024-01-11 10:24 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: JD Smith @ 2024-01-10 22:22 UTC (permalink / raw)
  To: 68374


When the ‘display min-width property is used on characters in a buffer, window/buffer-text-pixel-size does not include this min-width padding in its calculation of the text's pixel width.  

This can be seen by using a range of minimum character widths and noticing that the width is identical; see below.  Other ‘display properties like space :width and space :align-to do seem to be correctly handled by pixel size calculations. 

This is relevant because various elements on the mode-line use ‘display min-width, so performing pixel alignment on the mode-line text is impacted.

+++

(eval-when-compile 'cl-lib)
(cl-loop
 for w from 0. to 100. by 20. 
 collect
 (with-current-buffer (get-buffer-create "*pixel-sizes*")
   (erase-buffer)
   (insert ">>>" (propertize " " 'display `(min-width (,w))) "<<<")
   (cons w (buffer-text-pixel-size))))
  
;; ((0 49 . 14) (20 49 . 14) (40 49 . 14) (60 49 . 14) (80 49 . 14) (100 49 . 14))




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-11 13:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 22:22 bug#68374: min-width is not correctly treated by buffer-text-pixel-size JD Smith
2024-01-11 10:24 ` Eli Zaretskii
2024-01-11 19:53   ` JD Smith
2024-01-12  7:05     ` Eli Zaretskii
2024-01-12 16:45       ` JD Smith
2024-01-12 18:09         ` Eli Zaretskii
2024-02-11  8:47     ` Eli Zaretskii
2024-02-11 12:20       ` JD Smith
2024-02-11 13:22         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).