emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode combining characters


From: Anand Tamariya
Subject: Re: Unicode combining characters
Date: Wed, 26 May 2021 15:21:05 +0530

Thanks Eli - align-to 'space' display spec seems helpful.

Though it's a company specific issue related to unicode character composition, here's some more details on the issue for record should somebody else stumble upon the same.

Let's call the first character in the screenshot as shr (single glyph) and the second one as sh-r (two glyphs).
(setq shr  (string 2358 2381 2352))
(setq sh-r (string 2358 2352))

(string-width shr)  ;; 2
(string-width sh-r) ;; 2

To create the rectangular region, we need to pad the strings with appropriate number of spaces. align-to 'space' display spec seems helpful in this case as shown below. You will notice that character "a" is aligned in both cases. Now I need to figure out how to use the same within company.

(insert (concat shr
(let ((sp " "))
 (font-lock-append-text-property 0 1 'display `(space . (:align-to 10)) sp)
 sp)
"a"))

(insert (concat sh-r
(let ((sp " "))
 (font-lock-append-text-property 0 1 'display `(space . (:align-to 10)) sp)
 sp)
"a"))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]