unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: 68374@debbugs.gnu.org
Subject: bug#68374: min-width is not correctly treated by buffer-text-pixel-size
Date: Wed, 10 Jan 2024 17:22:53 -0500	[thread overview]
Message-ID: <EC5ECEDB-646A-4DAE-BD97-FB7F086C746D@gmail.com> (raw)


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))




             reply	other threads:[~2024-01-10 22:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 22:22 JD Smith [this message]
2024-01-11 10:24 ` bug#68374: min-width is not correctly treated by buffer-text-pixel-size 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EC5ECEDB-646A-4DAE-BD97-FB7F086C746D@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=68374@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).