mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Add new function buffer-text-pixel-size
* doc/lispref/display.texi (Size of Displayed Text): Document it. * lisp/emacs-lisp/subr-x.el (string-pixel-width): Use buffer-text-pixel-size (bug#51995). * src/xdisp.c (window_text_pixel_size): Factor out from Fwindow_text_pixel_size. (Fbuffer_text_pixel_size): New function.
This commit is contained in:
parent
c7699b9702
commit
61c254cafc
4 changed files with 152 additions and 70 deletions
|
|
@ -446,8 +446,7 @@ is inserted before adjusting the number of empty lines."
|
|||
"Return the width of STRING in pixels."
|
||||
(with-temp-buffer
|
||||
(insert string)
|
||||
(car (window-text-pixel-size
|
||||
(current-buffer) (point-min) (point)))))
|
||||
(car (buffer-text-pixel-size nil nil t))))
|
||||
|
||||
;;;###autoload
|
||||
(defun string-glyph-split (string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue