From: YAMAMOTO Mitsuharu Date: Sat, 22 Jun 2019 10:03:27 +0000 (+0900) Subject: Make ftcr font backend driver more consistent with xft X-Git-Tag: emacs-27.0.90~2320 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=28035cb45633ddd7b689e5600532451a601c4c73;p=emacs.git 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. --- 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; }