From a4ec9eae3de84bf9501c0d3f97ccade600716634 Mon Sep 17 00:00:00 2001 From: Axel Svensson Date: Tue, 9 Aug 2022 01:11:02 +0200 Subject: [PATCH] Fixes for variation selectors --- doc/lispref/display.texi | 6 +++--- lisp/international/characters.el | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index ace67fbedb..96079dc106 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -8596,9 +8596,9 @@ Glyphless Chars images, such as U+00AD @sc{soft hyphen}. @item variation-selectors -Unicode VS-1 through VS-16 (U+FE00 through U+FE0F), which are used to -select between different glyphs for the same codepoints (typically -emojis). +Unicode VS-1 through VS-256 (U+FE00 through U+FE0F and U+E0100 through +U+E01EF), which are used to select between different glyphs for the same +codepoints (typically emojis). @item no-font Characters for which there is no suitable font, or which cannot be diff --git a/lisp/international/characters.el b/lisp/international/characters.el index ca28222c81..78f8447208 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1243,7 +1243,8 @@ ?L (#x1E026 . #x1E02A) (#x1E8D0 . #x1E8D6) (#x1E944 . #x1E94A) - (#xE0001 . #xE01EF)))) + (#xE0001 . #xE01EF) + (#xE0100 . #xE01EF)))) (dolist (elt l) (set-char-table-range char-width-table elt 0))) @@ -1525,6 +1526,15 @@ char-acronym-table (aset char-acronym-table (+ #xE0021 i) (format " %c TAG" (+ 33 i)))) (aset char-acronym-table #xE007F "->|TAG") ; CANCEL TAG +(dotimes (i 256) + (let* ((vs-number (1+ i)) + (codepoint (if (< i 16) + (+ #xfe00 i) + (+ #xe0100 i -16))) + (dash (if (<= 10 vs-number 99) "" "-"))) + (aset char-acronym-table codepoint + (format "VS%s%s" dash vs-number)))) + ;; We can't use the \N{name} things here, because this file is used ;; too early in the build process. (defvar bidi-control-characters @@ -1574,7 +1584,9 @@ update-glyphless-char-display #x80 #x9F method)) ((eq target 'variation-selectors) (glyphless-set-char-table-range glyphless-char-display - #xFE00 #xFE0F method)) + #xFE00 #xFE0F method) + (glyphless-set-char-table-range glyphless-char-display + #xE0100 #xE01EF method)) ((or (eq target 'format-control) (eq target 'bidi-control)) (when unicode-category-table @@ -1647,10 +1659,10 @@ glyphless-char-display-control that are relevant for bidirectional formatting control, like U+2069 (PDI) and U+202B (RLE). `variation-selectors': - Characters in the range U+FE00..U+FE0F, used for - selecting alternate glyph presentations, such as - Emoji vs Text presentation, of the preceding - character(s). + Characters in the range U+FE00..U+FE0F and + U+E0100..U+E01EF, used for selecting alternate glyph + presentations, such as Emoji vs Text presentation, of + the preceding character(s). `no-font': For GUI frames, characters for which no suitable font is found; for text-mode frames, characters that cannot be encoded by `terminal-coding-system'. -- 2.30.2