From 48776b70115edf3775df19d80f734048dadff198 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Dec 2018 16:35:09 +0200 Subject: Provide text directionality and language to HarfBuzz shaper * lisp/language/tv-util.el (tai-viet-composition-function): * lisp/language/ethio-util.el (ethio-composition-function): * lisp/language/japanese.el (compose-gstring-for-variation-glyph): * lisp/language/thai-util.el (thai-composition-function): * lisp/language/misc-lang.el (arabic-shape-gstring): * lisp/language/lao-util.el (lao-composition-function): * lisp/language/hebrew.el (hebrew-shape-gstring): * lisp/composite.el (compose-gstring-for-graphic) (compose-gstring-for-dotted-circle, auto-compose-chars) (compose-gstring-for-terminal): Accept 2nd argument DIRECTION; all callers changed. * src/composite.c (composition_reseat_it): Call auto-composition-function with one more argument DIRECTION. (syms_of_composite) : Update the doc string. * src/ftfont.c (ftfont_shape_by_hb): Compute language and direction, and set buffer properties accordingly. * src/composite.c (autocmp_chars): * src/w32uniscribe.c (uniscribe_shape): * src/xftfont.c (xftfont_shape): * src/ftfont.c (ftfont_shape, ftfont_shape_by_hb): * src/font.c (Ffont_shape_gstring): Accept an additional argument DIRECTION. * src/macfont.m (lgstring_direction): New enum. (mac_font_shape_1, mac_screen_font_shape, mac_font_shape): Accept an additional argument specifying text direction. All callers changed. * src/font.c (syms_of_font): New symbols QL2R and QR2L. * src/font.h (shape): Accept new argument DIRECTION. All implementations changed. (Bug#33729) (ftfont_shape): Update prototype. --- lisp/language/hebrew.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/language/hebrew.el') diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index c004337c2f8..52188f44725 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -152,7 +152,7 @@ Bidirectional editing is supported."))) ;; (3) If the font has precomposed glyphs, use them as far as ;; possible. Adjust the remaining glyphs artificially. -(defun hebrew-shape-gstring (gstring) +(defun hebrew-shape-gstring (gstring direction) (let* ((font (lgstring-font gstring)) (otf (font-get font :otf)) (nchars (lgstring-char-len gstring)) @@ -172,7 +172,7 @@ Bidirectional editing is supported."))) ((or (assq 'hebr (car otf)) (assq 'hebr (cdr otf))) ;; FONT has OpenType features for Hebrew. - (font-shape-gstring gstring)) + (font-shape-gstring gstring direction)) (t ;; FONT doesn't have OpenType features for Hebrew. @@ -217,7 +217,7 @@ Bidirectional editing is supported."))) ;; Now IDX is an index to the first non-precomposed glyph. ;; Adjust positions of the remaining glyphs artificially. (if (font-get font :combining-capability) - (font-shape-gstring gstring) + (font-shape-gstring gstring direction) (setq base-width (lglyph-width (lgstring-glyph gstring 0))) (while (< idx nglyphs) (setq glyph (lgstring-glyph gstring idx)) -- cgit v1.2.1