summaryrefslogtreecommitdiff
path: root/src/xfont.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2009-04-16 01:39:08 +0000
committerKenichi Handa <handa@m17n.org>2009-04-16 01:39:08 +0000
commiteddca531639ebbced1e30d19a77be2eaad0634d7 (patch)
tree74aacf50cb05cd01391ae8b8c3045efa8a71b158 /src/xfont.c
parentbc722cb50668a8650e85024b3dfdf0e0f184ad70 (diff)
downloademacs-eddca531639ebbced1e30d19a77be2eaad0634d7.tar.gz
(xfont_has_char): Special handling of `ja' and `ko' adstyle.
Diffstat (limited to 'src/xfont.c')
-rw-r--r--src/xfont.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/xfont.c b/src/xfont.c
index bae63ac8555..6d0e8d91127 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -792,17 +792,33 @@ xfont_prepare_face (f, face)
return 0;
}
+extern Lisp_Object Qja, Qko;
+
static int
-xfont_has_char (entity, c)
- Lisp_Object entity;
+xfont_has_char (font, c)
+ Lisp_Object font;
int c;
{
- Lisp_Object registry = AREF (entity, FONT_REGISTRY_INDEX);
+ Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX);
struct charset *encoding;
- struct charset *repertory;
-
- if (font_registry_charsets (registry, &encoding, &repertory) < 0)
- return -1;
+ struct charset *repertory = NULL;
+
+ if (EQ (registry, Qiso10646_1))
+ {
+ /* We use a font of `ja' and `ko' adstyle only for a character
+ in JISX0208 and KSC5601 charsets respectively. */
+ if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja)
+ && charset_jisx0208 >= 0)
+ encoding = repertory = CHARSET_FROM_ID (charset_jisx0208);
+ else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko)
+ && charset_ksc5601 >= 0)
+ encoding = repertory = CHARSET_FROM_ID (charset_ksc5601);
+ else
+ encoding = CHARSET_FROM_ID (charset_unicode);
+ }
+ else if (font_registry_charsets (registry, &encoding, &repertory) < 0)
+ /* Unknown REGISTRY, not usable. */
+ return 0;
if (ASCII_CHAR_P (c) && encoding->ascii_compatible_p)
return 1;
if (! repertory)