diff options
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) |