summaryrefslogtreecommitdiff
path: root/src/w32uniscribe.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-12-29 16:35:09 +0200
committerEli Zaretskii <eliz@gnu.org>2018-12-29 16:35:09 +0200
commit48776b70115edf3775df19d80f734048dadff198 (patch)
tree10a7e72a45bbbdf8dbfed4afce59fc9a5b975110 /src/w32uniscribe.c
parent1a80b5d9b8cfa0e523b596db5d1e7e6074dbee46 (diff)
downloademacs-48776b70115edf3775df19d80f734048dadff198.tar.gz
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) <auto-composition-function>: 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.
Diffstat (limited to 'src/w32uniscribe.c')
-rw-r--r--src/w32uniscribe.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 29c9c7a0bd1..3c400f38b13 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -198,6 +198,9 @@ uniscribe_otf_capability (struct font *font)
(N+1)th element of LGSTRING is nil, input of shaping is from the
1st to (N)th elements. In each input glyph, FROM, TO, CHAR, and
CODE are already set.
+ DIRECTION is either L2R or R2L, or nil if unknown. During
+ redisplay, this comes from applying the UBA, is passed from
+ composition_reseat_it, and is used by the HarfBuzz shaper.
This function updates all fields of the input glyphs. If the
output glyphs (M) are more than the input glyphs (N), (N+1)th
@@ -206,7 +209,7 @@ uniscribe_otf_capability (struct font *font)
than the length of LGSTRING, nil should be returned. In that case,
this function is called again with a larger LGSTRING. */
static Lisp_Object
-uniscribe_shape (Lisp_Object lgstring)
+uniscribe_shape (Lisp_Object lgstring, Lisp_Object direction)
{
struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
struct uniscribe_font_info *uniscribe_font
@@ -394,6 +397,8 @@ uniscribe_shape (Lisp_Object lgstring)
adjustment for the base character, which is
then updated for each successive glyph in the
grapheme cluster. */
+ /* FIXME: Should we use DIRECTION here instead
+ of what ScriptItemize guessed? */
if (items[i].a.fRTL)
{
int j1 = j;