From 28035cb45633ddd7b689e5600532451a601c4c73 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 22 Jun 2019 19:03:27 +0900 Subject: Make ftcr font backend driver more consistent with xft * src/ftcrfont.c: Include charset.h. (ftcrfont_has_char): Import font adstyle related code from ftfont_has_char. --- src/ftcrfont.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 0cc40b4c944..f15e79334ac 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -25,6 +25,7 @@ along with GNU Emacs. If not, see . */ #include "lisp.h" #include "xterm.h" #include "blockinput.h" +#include "charset.h" #include "composite.h" #include "font.h" #include "ftfont.h" @@ -308,6 +309,17 @@ ftcrfont_has_char (Lisp_Object font, int c) if (FONT_ENTITY_P (font)) return ftfont_has_char (font, c); + struct charset *cs = NULL; + + if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja) + && charset_jisx0208 >= 0) + cs = CHARSET_FROM_ID (charset_jisx0208); + else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko) + && charset_ksc5601 >= 0) + cs = CHARSET_FROM_ID (charset_ksc5601); + if (cs) + return (ENCODE_CHAR (cs, c) != CHARSET_INVALID_CODE (cs)); + return -1; } -- cgit v1.2.1