[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fdaae2e 2/6: Move compose-gstring-for-variation-glyph
From: |
Robert Pluim |
Subject: |
master fdaae2e 2/6: Move compose-gstring-for-variation-glyph |
Date: |
Fri, 24 Sep 2021 07:40:34 -0400 (EDT) |
branch: master
commit fdaae2e7bee5512047dc2ae67979d40cf60a5104
Author: Robert Pluim <rpluim@gmail.com>
Commit: Robert Pluim <rpluim@gmail.com>
Move compose-gstring-for-variation-glyph
It logically belongs in composite.el, not japanese.el
* lisp/language/japanese.el (compose-gstring-for-variation-glyph):
Remove from here.
* lisp/composite.el (compose-gstring-for-variation-glyph): And add here.
---
lisp/composite.el | 22 ++++++++++++++++++++++
lisp/language/japanese.el | 23 -----------------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/lisp/composite.el b/lisp/composite.el
index a16c0cc..859253e 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -815,6 +815,28 @@ prepending a space before it."
(setq i (1+ i)))))))
gstring))
+(defun compose-gstring-for-variation-glyph (gstring _direction)
+ "Compose glyph-string GSTRING for graphic display.
+GSTRING must have two glyphs; the first is a glyph for a han character,
+and the second is a glyph for a variation selector."
+ (let* ((font (lgstring-font gstring))
+ (han (lgstring-char gstring 0))
+ (vs (lgstring-char gstring 1))
+ (glyphs (font-variation-glyphs font han))
+ (g0 (lgstring-glyph gstring 0))
+ (g1 (lgstring-glyph gstring 1)))
+ (catch 'tag
+ (dolist (elt glyphs)
+ (if (= (car elt) vs)
+ (progn
+ (lglyph-set-code g0 (cdr elt))
+ (lglyph-set-from-to g0 (lglyph-from g0) (lglyph-to g1))
+ (lgstring-set-glyph gstring 1 nil)
+ (throw 'tag gstring)))))))
+
+(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 '(#xE0100 . #xE01EF) elt))
(defun auto-compose-chars (func from to font-object string direction)
"Compose the characters at FROM by FUNC.
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el
index bd8ef6e..d9bd420 100644
--- a/lisp/language/japanese.el
+++ b/lisp/language/japanese.el
@@ -264,29 +264,6 @@ eucJP-ms is defined in
<http://www.opengroup.or.jp/jvc/cde/appendix.html>."
(define-translation-table 'unicode-to-jisx0213
(char-table-extra-slot table 0)))
-(defun compose-gstring-for-variation-glyph (gstring _direction)
- "Compose glyph-string GSTRING for graphic display.
-GSTRING must have two glyphs; the first is a glyph for a han character,
-and the second is a glyph for a variation selector."
- (let* ((font (lgstring-font gstring))
- (han (lgstring-char gstring 0))
- (vs (lgstring-char gstring 1))
- (glyphs (font-variation-glyphs font han))
- (g0 (lgstring-glyph gstring 0))
- (g1 (lgstring-glyph gstring 1)))
- (catch 'tag
- (dolist (elt glyphs)
- (if (= (car elt) vs)
- (progn
- (lglyph-set-code g0 (cdr elt))
- (lglyph-set-from-to g0 (lglyph-from g0) (lglyph-to g1))
- (lgstring-set-glyph gstring 1 nil)
- (throw 'tag gstring)))))))
-
-(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 '(#xE0100 . #xE01EF) elt))
-
(provide 'japanese)
;;; japanese.el ends here
- master updated (c6fc066 -> 68b8f31), Robert Pluim, 2021/09/24
- master fdaae2e 2/6: Move compose-gstring-for-variation-glyph,
Robert Pluim <=
- master 04e2360 1/6: Update provenance comment in charscript.el, Robert Pluim, 2021/09/24
- master 184469d 3/6: Add a few more missing emoji overrides, Robert Pluim, 2021/09/24
- master 6738111 4/6: Generate skin tone compositions from emoji-sequences.txt, Robert Pluim, 2021/09/24
- master 68b8f31 6/6: ; * doc/misc/tramp.texi: Grammar fixes for process-connection-type, Robert Pluim, 2021/09/24
- master 3ced9e3 5/6: ; * etc/NEWS: improve some recently added entries, Robert Pluim, 2021/09/24