From 30934d334e8a67c8992d910428758d5b93e0f04f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 4 Sep 2012 20:15:45 +0300 Subject: [PATCH] Fix display of Arabic diacriticals on Windows, per bug #11860. src/w32uniscribe.c (uniscribe_shape): Reverse the sign of offsets[j].dv, since the y axis of the screen coordinates points down, while the y axis of the font definition coordinates points up. This fixes display of Arabic diacritics such as KASRA and KASRATAN. --- src/ChangeLog | 8 ++++++++ src/w32uniscribe.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a8d6a4026a..f905cc3b5a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-09-04 Eli Zaretskii + + * w32uniscribe.c (uniscribe_shape): Reverse the sign of + offsets[j].dv, since the y axis of the screen coordinates points + down, while the y axis of the font definition coordinates points + up. This fixes display of Arabic diacritics such as KASRA and + KASRATAN. (Bug#11860) + 2012-09-04 Paul Eggert Be more systematic about _setjmp vs setjmp. diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index bc45e2c648..cf99d14dc7 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -454,7 +454,11 @@ uniscribe_shape (Lisp_Object lgstring) } else ASET (vec, 0, make_number (offsets[j].du + adj_offset)); - ASET (vec, 1, make_number (offsets[j].dv)); + /* In the font definition coordinate system, the + Y coordinate points up, while in our screen + coordinates Y grows downwards. So we need to + reverse the sign of Y-OFFSET here. */ + ASET (vec, 1, make_number (-offsets[j].dv)); /* Based on what ftfont.c does... */ ASET (vec, 2, make_number (advances[j])); LGLYPH_SET_ADJUSTMENT (lglyph, vec); -- 2.20.1