From ad879b7f7e049160c45361fe8a12580801ba035b Mon Sep 17 00:00:00 2001 From: "K. Handa" Date: Thu, 14 Jan 2016 21:48:44 +0900 Subject: [PATCH] Backport:fix previous change of src/ftfont.c (ftfont_shape_by_flt) * src/ftfont.c (ftfont_shape_by_flt): Fix previous change. Access the second glyph only when there are enough glyphs. (cherry picked from commit 9835757013569673854b692ccbb58bfb3c3ed1f7) --- src/ftfont.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ftfont.c b/src/ftfont.c index bb8af96d7b1..505d508d2e0 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -2590,7 +2590,7 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, flt_font_ft.otf = otf; flt_font_ft.matrix = matrix->xx != 0 ? matrix : 0; - if (1 < len || ! otf) + if (1 < len) { /* A little bit ad hoc. Perhaps, shaper must get script and language information, and select a proper flt for them @@ -2598,9 +2598,11 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, int c1 = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 1)); if (CHAR_HAS_CATEGORY (c1, '^')) flt = mflt_get (msymbol ("combining")); - else if (! otf) - flt = mflt_find (LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 0)), - &flt_font_ft.flt_font); + } + if (! flt && ! otf) + { + flt = mflt_find (LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 0)), + &flt_font_ft.flt_font); if (! flt) return make_number (0); } -- 2.39.2