diff options
author | K. Handa <handa@gnu.org> | 2017-10-08 11:48:01 +0900 |
---|---|---|
committer | K. Handa <handa@gnu.org> | 2017-10-08 11:48:01 +0900 |
commit | 64baaff8c5f70b7d637ac37304c4377e955b3f09 (patch) | |
tree | 54922ceb5d3b828685fb487656e495acac3b9518 /lisp/composite.el | |
parent | 7a1133f1ff002943ce32b5a05a7261bba520288c (diff) | |
download | emacs-64baaff8c5f70b7d637ac37304c4377e955b3f09.tar.gz emacs-64baaff8c5f70b7d637ac37304c4377e955b3f09.tar.bz2 emacs-64baaff8c5f70b7d637ac37304c4377e955b3f09.zip |
New option for handling ZWNJ in Arabic text rendering
Provide a new option 'arabic-shaper-ZWNJ-handling' that controls how
to display ZWNJ in Arabic text rendering (Bug#28339).
* lisp/language/misc-lang.el: Register arabic-shape-gstring in
composition-function-table.
(arabic-shaper-ZWNJ-handling): New variable.
(arabic-shape-log): New variable.
(arabic-shape-gstring): New function.
* lisp/composite.el (lgstring-remove-glyph): New function.
Diffstat (limited to 'lisp/composite.el')
-rw-r--r-- | lisp/composite.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/composite.el b/lisp/composite.el index ab39e087e1f..72b0ffc8f48 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -442,8 +442,10 @@ after a sequence of character events." (defsubst lglyph-set-adjustment (glyph &optional xoff yoff wadjust) (aset glyph 9 (vector (or xoff 0) (or yoff 0) (or wadjust 0)))) +;; Return the shallow Copy of GLYPH. (defsubst lglyph-copy (glyph) (copy-sequence glyph)) +;; Insert GLYPH at the index IDX of GSTRING. (defun lgstring-insert-glyph (gstring idx glyph) (let ((nglyphs (lgstring-glyph-len gstring)) (i idx)) @@ -459,6 +461,18 @@ after a sequence of character events." (lgstring-set-glyph gstring i glyph) gstring)) +;; Remove glyph at IDX from GSTRING. +(defun lgstring-remove-glyph (gstring idx) + (setq gstring (copy-sequence gstring)) + (lgstring-set-id gstring nil) + (let ((len (length gstring))) + (setq idx (+ idx 3)) + (while (< idx len) + (aset gstring (1- idx) (aref gstring idx)) + (setq idx (1+ idx))) + (aset gstring (1- len) nil)) + gstring) + (defun compose-glyph-string (gstring from to) (let ((glyph (lgstring-glyph gstring from)) from-pos to-pos) |