[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r100425: Add Hebrew shaper.
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r100425: Add Hebrew shaper. |
Date: |
Tue, 25 May 2010 10:26:03 +0900 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 100425 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Tue 2010-05-25 10:26:03 +0900
message:
Add Hebrew shaper.
modified:
lisp/ChangeLog
lisp/language/hebrew.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-05-25 00:54:13 +0000
+++ b/lisp/ChangeLog 2010-05-25 01:25:08 +0000
@@ -1,3 +1,9 @@
+2010-05-25 Kenichi Handa <address@hidden>
+
+ * language/hebrew.el (hebrew-shape-gstring): New function.
+ Register it in composition-function-table for all Hebrew combining
+ characters.
+
2010-05-24 Uday S Reddy <address@hidden> (tiny change)
* textmodes/fill.el (fill-region): Don't fill past the end (bug#6201).
=== modified file 'lisp/language/hebrew.el'
--- a/lisp/language/hebrew.el 2010-05-15 13:50:16 +0000
+++ b/lisp/language/hebrew.el 2010-05-25 01:25:08 +0000
@@ -85,6 +85,35 @@
:mime-charset 'cp862)
(define-coding-system-alias 'ibm862 'cp862)
+;; Composition function for hebrew.
+(defun hebrew-shape-gstring (gstring)
+ (setq gstring (font-shape-gstring gstring))
+ (let ((header (lgstring-header gstring))
+ (nchars (lgstring-char-len gstring))
+ (nglyphs (lgstring-glyph-len gstring))
+ (base-width (lglyph-width (lgstring-glyph gstring 0))))
+ (while (> nglyphs 1)
+ (setq nglyphs (1- nglyphs))
+ (let* ((glyph (lgstring-glyph gstring nglyphs))
+ (adjust (and glyph (lglyph-adjustment glyph))))
+ (if adjust
+ (setq nglyphs 0)
+ (if (>= (lglyph-lbearing glyph) 0)
+ (lglyph-set-adjustment glyph (- base-width) 0 0))))))
+ gstring)
+
+(let ((pattern1 "[\u05D0-\u05F2][\u0591-\u05BF\u05C1-\u05C5\u05C7]+")
+ (pattern2 "[\u05D0-\u05F2]\u200D[\u0591-\u05BF\u05C1-\u05C5\u05C7]+"))
+ (set-char-table-range
+ composition-function-table '(#x591 . #x5C7)
+ (list (vector pattern2 2 'hebrew-shape-gstring)
+ (vector pattern1 1 'hebrew-shape-gstring)
+ ["[\u0591-\u05C7]" 0 font-shape-gstring]))
+ (set-char-table-range
+ composition-function-table #x5C0 nil)
+ (set-char-table-range
+ composition-function-table #x5C6 nil))
+
(provide 'hebrew)
;; arch-tag: 3ca04f32-3f1e-498e-af46-8267498ba5d9
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r100425: Add Hebrew shaper.,
Kenichi Handa <=