emacs-devel
[Top][All Lists]
Advanced

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

Re: ucs-normalize and diacritics


From: Eli Zaretskii
Subject: Re: ucs-normalize and diacritics
Date: Tue, 24 Jul 2018 22:07:00 +0300

> From: Robert Pluim <address@hidden>
> Date: Tue, 24 Jul 2018 20:17:00 +0200
> 
> in
> <https://emacs.stackexchange.com/questions/43757/combining-diacritics-not-combining-visually>
> someone noted that â (that is LATIN SMALL LETTER A followed by
> COMBINING CIRCUMFLEX ACCENT) was not visually shown as â (LATIN SMALL
> LETTER A WITH CIRCUMFLEX). I can play around with the various
> ucs-normalize-* functions and get that to happen, but Iʼm just curious
> why it doesnʼt happen automatically (assuming it should, of course.

It does display as â, but only if you use a font that supports both
'a' and '̂'.  Emacs can only compose characters that are displayed by
the same font.

> I couldn't find any documentation on this kind of stuff).

Not sure what documentation you were looking for, but the data
structure to make this happen is set up in composite.el:

  (when unicode-category-table
    (let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic]
                 [nil 0 compose-gstring-for-graphic])))
      (map-char-table
       #'(lambda (key val)
           (if (memq val '(Mn Mc Me))
               (set-char-table-range composition-function-table key elt)))
       unicode-category-table))
    ;; for dotted-circle
    (aset composition-function-table #x25CC
          `([,(purecopy ".\\c^") 0 compose-gstring-for-dotted-circle])))

That "\\c.\\c^+" regexp causes any base character (\c.) followed by
one or more combining characters (\c^) to be composable using the
function compose-gstring-for-graphic (which see).



reply via email to

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