aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorK. Handa2016-01-02 16:36:21 +0900
committerK. Handa2016-01-02 16:36:21 +0900
commit536f48e9a2251b9e654ea974bd90ff2f40218753 (patch)
treefa48333ec65910b24ffab90f2dda3d200fb56215 /lisp
parentd259328fb87db8cc67d52771efcfa653e52c5b71 (diff)
downloademacs-536f48e9a2251b9e654ea974bd90ff2f40218753.tar.gz
emacs-536f48e9a2251b9e654ea974bd90ff2f40218753.zip
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')
-rw-r--r--lisp/language/hebrew.el38
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.")))
216 (setq idx 1 nglyphs nchars)) 216 (setq idx 1 nglyphs nchars))
217 ;; Now IDX is an index to the first non-precomposed glyph. 217 ;; Now IDX is an index to the first non-precomposed glyph.
218 ;; Adjust positions of the remaining glyphs artificially. 218 ;; Adjust positions of the remaining glyphs artificially.
219 (setq base-width (lglyph-width (lgstring-glyph gstring 0))) 219 (if (font-get font :combining-capability)
220 (while (< idx nglyphs) 220 (font-shape-gstring gstring)
221 (setq glyph (lgstring-glyph gstring idx)) 221 (setq base-width (lglyph-width (lgstring-glyph gstring 0)))
222 (lglyph-set-from-to glyph 0 (1- nchars)) 222 (while (< idx nglyphs)
223 (if (>= (lglyph-lbearing glyph) (lglyph-width glyph)) 223 (setq glyph (lgstring-glyph gstring idx))
224 ;; It seems that this glyph is designed to be rendered 224 (lglyph-set-from-to glyph 0 (1- nchars))
225 ;; before the base glyph. 225 (if (>= (lglyph-lbearing glyph) (lglyph-width glyph))
226 (lglyph-set-adjustment glyph (- base-width) 0 0) 226 ;; It seems that this glyph is designed to be rendered
227 (if (>= (lglyph-lbearing glyph) 0) 227 ;; before the base glyph.
228 ;; Align the horizontal center of this glyph to the 228 (lglyph-set-adjustment glyph (- base-width) 0 0)
229 ;; horizontal center of the base glyph. 229 (if (>= (lglyph-lbearing glyph) 0)
230 (let ((width (- (lglyph-rbearing glyph) 230 ;; Align the horizontal center of this glyph to the
231 (lglyph-lbearing glyph)))) 231 ;; horizontal center of the base glyph.
232 (lglyph-set-adjustment glyph 232 (let ((width (- (lglyph-rbearing glyph)
233 (- (/ (- base-width width) 2) 233 (lglyph-lbearing glyph))))
234 (lglyph-lbearing glyph) 234 (lglyph-set-adjustment glyph
235 base-width) 0 0)))) 235 (- (/ (- base-width width) 2)
236 (setq idx (1+ idx)))))) 236 (lglyph-lbearing glyph)
237 base-width) 0 0))))
238 (setq idx (1+ idx)))))))
237 gstring)) 239 gstring))
238 240
239(let* ((base "[\u05D0-\u05F2]") 241(let* ((base "[\u05D0-\u05F2]")