diff options
| author | Kenichi Handa | 2009-04-16 01:39:36 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-04-16 01:39:36 +0000 |
| commit | bd0af90dca595476bf4ce1ae88939ac75bd34aca (patch) | |
| tree | eedb6dd31d7de0c6ab5493c5ab11a2993a799ec6 /src/xfont.c | |
| parent | b840b299b96b0b96c72b800173e23894c631a426 (diff) | |
| download | emacs-bd0af90dca595476bf4ce1ae88939ac75bd34aca.tar.gz emacs-bd0af90dca595476bf4ce1ae88939ac75bd34aca.zip | |
(xfont_has_char): Special handling of `ja' and `ko' adstyle.
Diffstat (limited to 'src/xfont.c')
| -rw-r--r-- | src/xfont.c | 30 |
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) | |||
| 792 | return 0; | 792 | return 0; |
| 793 | } | 793 | } |
| 794 | 794 | ||
| 795 | extern Lisp_Object Qja, Qko; | ||
| 796 | |||
| 795 | static int | 797 | static int |
| 796 | xfont_has_char (entity, c) | 798 | xfont_has_char (font, c) |
| 797 | Lisp_Object entity; | 799 | Lisp_Object font; |
| 798 | int c; | 800 | int c; |
| 799 | { | 801 | { |
| 800 | Lisp_Object registry = AREF (entity, FONT_REGISTRY_INDEX); | 802 | Lisp_Object registry = AREF (font, FONT_REGISTRY_INDEX); |
| 801 | struct charset *encoding; | 803 | struct charset *encoding; |
| 802 | struct charset *repertory; | 804 | struct charset *repertory = NULL; |
| 803 | 805 | ||
| 804 | if (font_registry_charsets (registry, &encoding, &repertory) < 0) | 806 | if (EQ (registry, Qiso10646_1)) |
| 805 | return -1; | 807 | { |
| 808 | /* We use a font of `ja' and `ko' adstyle only for a character | ||
| 809 | in JISX0208 and KSC5601 charsets respectively. */ | ||
| 810 | if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja) | ||
| 811 | && charset_jisx0208 >= 0) | ||
| 812 | encoding = repertory = CHARSET_FROM_ID (charset_jisx0208); | ||
| 813 | else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko) | ||
| 814 | && charset_ksc5601 >= 0) | ||
| 815 | encoding = repertory = CHARSET_FROM_ID (charset_ksc5601); | ||
| 816 | else | ||
| 817 | encoding = CHARSET_FROM_ID (charset_unicode); | ||
| 818 | } | ||
| 819 | else if (font_registry_charsets (registry, &encoding, &repertory) < 0) | ||
| 820 | /* Unknown REGISTRY, not usable. */ | ||
| 821 | return 0; | ||
| 806 | if (ASCII_CHAR_P (c) && encoding->ascii_compatible_p) | 822 | if (ASCII_CHAR_P (c) && encoding->ascii_compatible_p) |
| 807 | return 1; | 823 | return 1; |
| 808 | if (! repertory) | 824 | if (! repertory) |