diff options
author | K. Handa <handa@gnu.org> | 2016-01-02 16:36:21 +0900 |
---|---|---|
committer | K. Handa <handa@gnu.org> | 2016-01-02 16:36:21 +0900 |
commit | 536f48e9a2251b9e654ea974bd90ff2f40218753 (patch) | |
tree | fa48333ec65910b24ffab90f2dda3d200fb56215 /lisp/language | |
parent | d259328fb87db8cc67d52771efcfa653e52c5b71 (diff) | |
download | emacs-536f48e9a2251b9e654ea974bd90ff2f40218753.tar.gz |
support rendering of wider range of combinging characters by ftfont backend
* lisp/language/hebrew.el (hebrew-shape-gstring): If the font backend
supports rendering of combining characters, call
font-shape-gstring.
* src/font.c (Ffont_get): Handle `combining-capability' property.
(syms_of_font): New symbol ":combining-capability'.
* src/font.h (struct font_driver): New member combining_capability.
* src/ftfont.c: Include "category.h".
(ftfont_driver): Initialize combining_capability to
ftfont_combining_capability.
(ftfont_shape_by_flt): If OTF is null, try to find a suitable
FLT in advance.
(ftfont_combining_capability): New function.
Diffstat (limited to 'lisp/language')
-rw-r--r-- | lisp/language/hebrew.el | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index a3f4b3dd997..05f2f2521f7 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -216,24 +216,26 @@ Bidirectional editing is supported."))) (setq idx 1 nglyphs nchars)) ;; Now IDX is an index to the first non-precomposed glyph. ;; Adjust positions of the remaining glyphs artificially. - (setq base-width (lglyph-width (lgstring-glyph gstring 0))) - (while (< idx nglyphs) - (setq glyph (lgstring-glyph gstring idx)) - (lglyph-set-from-to glyph 0 (1- nchars)) - (if (>= (lglyph-lbearing glyph) (lglyph-width glyph)) - ;; It seems that this glyph is designed to be rendered - ;; before the base glyph. - (lglyph-set-adjustment glyph (- base-width) 0 0) - (if (>= (lglyph-lbearing glyph) 0) - ;; Align the horizontal center of this glyph to the - ;; horizontal center of the base glyph. - (let ((width (- (lglyph-rbearing glyph) - (lglyph-lbearing glyph)))) - (lglyph-set-adjustment glyph - (- (/ (- base-width width) 2) - (lglyph-lbearing glyph) - base-width) 0 0)))) - (setq idx (1+ idx)))))) + (if (font-get font :combining-capability) + (font-shape-gstring gstring) + (setq base-width (lglyph-width (lgstring-glyph gstring 0))) + (while (< idx nglyphs) + (setq glyph (lgstring-glyph gstring idx)) + (lglyph-set-from-to glyph 0 (1- nchars)) + (if (>= (lglyph-lbearing glyph) (lglyph-width glyph)) + ;; It seems that this glyph is designed to be rendered + ;; before the base glyph. + (lglyph-set-adjustment glyph (- base-width) 0 0) + (if (>= (lglyph-lbearing glyph) 0) + ;; Align the horizontal center of this glyph to the + ;; horizontal center of the base glyph. + (let ((width (- (lglyph-rbearing glyph) + (lglyph-lbearing glyph)))) + (lglyph-set-adjustment glyph + (- (/ (- base-width width) 2) + (lglyph-lbearing glyph) + base-width) 0 0)))) + (setq idx (1+ idx))))))) gstring)) (let* ((base "[\u05D0-\u05F2]") |