diff options
author | Robert Pluim <rpluim@gmail.com> | 2021-10-18 11:51:10 +0200 |
---|---|---|
committer | Robert Pluim <rpluim@gmail.com> | 2021-10-19 14:40:26 +0200 |
commit | 9bd2f59db608def1b588b03eff846d3fe8a7fa00 (patch) | |
tree | 39a768d3990701aef8461a40f7c595c424382766 /lisp/composite.el | |
parent | e55e2d4a110447540db6bbdb9cb1c12313b4b8ad (diff) | |
download | emacs-9bd2f59db608def1b588b03eff846d3fe8a7fa00.tar.gz |
Handle VS-16 correctly for non-emoji codepoints
* admin/unidata/blocks.awk: Remove emoji overrides for codepoints with
Emoji_Presentation = No, they're no longer necessary.
* lisp/composite.el: Remove #xFE0F (VS-16) from the range handled by
`compose-gstring-for-variation-glyph' so it can be handled by
`font_range'.
* src/composite.c (syms_of_composite): New variable
`auto-composition-emoji-eligible-codepoints'.
* admin/unidata/emoji-zwj.awk: Generate value for
`auto-composition-emoji-eligible-codepoints'. Add
`composition-function-table' entries for 'codepoint + U+FE0F' for
them.
* src/font.c (codepoint_is_emoji_eligible): New function to check if
we should try to use the emoji font for a codepoint.
(font_range): Use it.
Diffstat (limited to 'lisp/composite.el')
-rw-r--r-- | lisp/composite.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/composite.el b/lisp/composite.el index 859253ec7e2..99f528a0779 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -834,8 +834,15 @@ and the second is a glyph for a variation selector." (lgstring-set-glyph gstring 1 nil) (throw 'tag gstring))))))) +;; We explicitly don't handle #xFE0F (VS-16) here, because that's +;; taken care of by font_range in font.c, which will check for an +;; emoji font for codepoints used in compositions even if they're not +;; emoji themselves, and thus choose the Emoji presentation for them +;; when followed by VS-16. VS-15 *is* handled here, because if it's +;; handled in font_range, we end up choosing the Emoji presentation +;; rather than the Text presentation. (let ((elt '([".." 1 compose-gstring-for-variation-glyph]))) - (set-char-table-range composition-function-table '(#xFE00 . #xFE0F) elt) + (set-char-table-range composition-function-table '(#xFE00 . #xFE0E) elt) (set-char-table-range composition-function-table '(#xE0100 . #xE01EF) elt)) (defun auto-compose-chars (func from to font-object string direction) |