mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-25 05:52:42 -08:00
; calc: Improve alignment for Unicode strings
With higher values of 'calc-string-maximum-character' the string length can differ from the displayed width. Calculate alignment offsets based on the the display width, rounded up to the nearest integer. Refines feature introduced in bug#78528. * lisp/calc/calccomp.el (math-comp-width): Replace 'length' with a ratio of 'string-pixel-width's.
This commit is contained in:
parent
bd96450a09
commit
b233ca80e9
1 changed files with 5 additions and 1 deletions
|
|
@ -1656,7 +1656,11 @@ Not all brackets have midpieces.")
|
|||
((memq (car c) '(set break)) t)))
|
||||
|
||||
(defun math-comp-width (c)
|
||||
(cond ((not (consp c)) (length c))
|
||||
(cond ((not (consp c))
|
||||
(or (and (stringp c)
|
||||
(ceiling (string-pixel-width c)
|
||||
(string-pixel-width "-")))
|
||||
(length c)))
|
||||
((memq (car c) '(horiz subscr supscr))
|
||||
(let ((accum 0))
|
||||
(while (setq c (cdr c))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue