[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117429: Fix Bug#17739.
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] trunk r117429: Fix Bug#17739. |
Date: |
Sat, 28 Jun 2014 01:37:49 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117429 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: K. Handa <address@hidden>
branch nick: trunk
timestamp: Sat 2014-06-28 10:37:35 +0900
message:
Fix Bug#17739.
* composite.el: Setup composition-function-table for dotted circle.
(compose-gstring-for-dotted-circle): New function.
* international/characters.el: Add category "^" to all
non-spacing characters.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/composite.el
composite.el-20091113204419-o5vbwnq5f7feedwu-1730
lisp/international/characters.el
characters.el-20091113204419-o5vbwnq5f7feedwu-1037
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-06-28 01:26:09 +0000
+++ b/lisp/ChangeLog 2014-06-28 01:35:48 +0000
@@ -1,3 +1,13 @@
+2014-06-28 K. Handa <address@hidden>
+
+ Fix Bug#17739.
+
+ * composite.el: Setup composition-function-table for dotted circle.
+ (compose-gstring-for-dotted-circle): New function.
+
+ * international/characters.el: Add category "^" to all
+ non-spacing characters.
+
2014-06-28 Glenn Morris <address@hidden>
* Makefile.in (doit): Remove force rule.
@@ -543,6 +553,7 @@
FILENAME.
* net/trampver.el: Update release number.
+>>>>>>> MERGE-SOURCE
2014-06-15 Stefan Monnier <address@hidden>
=== modified file 'lisp/composite.el'
--- a/lisp/composite.el 2014-01-01 07:43:34 +0000
+++ b/lisp/composite.el 2014-06-28 01:34:17 +0000
@@ -671,6 +671,49 @@
(setq i (1+ i))))
gstring))))))
+(defun compose-gstring-for-dotted-circle (gstring)
+ (let* ((dc (lgstring-glyph gstring 0)) ; glyph of dotted-circle
+ (dc-id (lglyph-code dc))
+ (fc (lgstring-glyph gstring 1)) ; glyph of the following char
+ (fc-id (lglyph-code fc))
+ (gstr (and nil (font-shape-gstring gstring))))
+ (if (and gstr
+ (or (= (lgstring-glyph-len gstr) 1)
+ (and (= (lgstring-glyph-len gstr) 2)
+ (= (lglyph-to (lgstring-glyph gstr 0))
+ (lglyph-to (lgstring-glyph gstr 1))))))
+ ;; It seems that font-shape-gstring has composed glyphs.
+ gstr
+ ;; Artificially compose the following glyph with the preceding
+ ;; dotted-circle.
+ (setq dc (lgstring-glyph gstring 0)
+ fc (lgstring-glyph gstring 1))
+ (let ((dc-width (lglyph-width dc))
+ (fc-width (- (lglyph-rbearing fc) (lglyph-lbearing fc)))
+ (from (lglyph-from dc))
+ (to (lglyph-to fc))
+ (xoff 0) (yoff 0) (width 0))
+ (if (and (< (lglyph-descent fc) 0)
+ (> (lglyph-ascent dc) (- (lglyph-descent fc))))
+ ;; Set YOFF so that the following glyph is put on top of
+ ;; the dotted-circle.
+ (setq yoff (- (- (lglyph-descent fc)) (lglyph-ascent dc))))
+ (if (> (lglyph-width fc) 0)
+ (setq xoff (- (lglyph-rbearing fc))))
+ (if (< dc-width fc-width)
+ ;; The following glyph is wider, but we don't know how to
+ ;; align both glyphs. So, try the easiet method;
+ ;; i.e. align left edges of the glyphs.
+ (setq xoff (- xoff (- dc-width) (- (lglyph-lbearing fc )))
+ width (- fc-width dc-width)))
+ (if (or (/= xoff 0) (/= yoff 0) (/= width 0) (/= (lglyph-width fc) 0))
+ (lglyph-set-adjustment fc xoff yoff width))
+ (lglyph-set-from-to dc from to)
+ (lglyph-set-from-to fc from to))
+ (if (> (lgstring-glyph-len gstring) 2)
+ (lgstring-set-glyph gstring 2 nil))
+ gstring)))
+
;; Allow for bootstrapping without uni-*.el.
(when unicode-category-table
(let ((elt `([,(purecopy "\\c.\\c^+") 1 compose-gstring-for-graphic]
@@ -679,7 +722,10 @@
#'(lambda (key val)
(if (memq val '(Mn Mc Me))
(set-char-table-range composition-function-table key elt)))
- unicode-category-table)))
+ unicode-category-table))
+ ;; for dotted-circle
+ (aset composition-function-table #x25CC
+ `([,(purecopy ".\\c^") 0 compose-gstring-for-dotted-circle])))
(defun compose-gstring-for-terminal (gstring)
"Compose glyph-string GSTRING for terminal display.
=== modified file 'lisp/international/characters.el'
--- a/lisp/international/characters.el 2014-06-24 07:15:26 +0000
+++ b/lisp/international/characters.el 2014-06-28 01:35:48 +0000
@@ -1389,11 +1389,13 @@
(when (setq unicode-category-table
(unicode-property-table-internal 'general-category))
(map-char-table #'(lambda (key val)
- (if (and val
- (or (and (/= (aref (symbol-name val) 0) ?M)
- (/= (aref (symbol-name val) 0) ?C))
- (eq val 'Zs)))
- (modify-category-entry key ?.)))
+ (if val
+ (cond ((or (and (/= (aref (symbol-name val) 0) ?M)
+ (/= (aref (symbol-name val) 0) ?C))
+ (eq val 'Zs))
+ (modify-category-entry key ?.))
+ ((eq val 'Mn)
+ (modify-category-entry key ?^)))))
unicode-category-table))
(optimize-char-table (standard-category-table))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117429: Fix Bug#17739.,
Kenichi Handa <=