aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2009-04-16 01:39:36 +0000
committerKenichi Handa2009-04-16 01:39:36 +0000
commitbd0af90dca595476bf4ce1ae88939ac75bd34aca (patch)
treeeedb6dd31d7de0c6ab5493c5ab11a2993a799ec6 /src
parentb840b299b96b0b96c72b800173e23894c631a426 (diff)
downloademacs-bd0af90dca595476bf4ce1ae88939ac75bd34aca.tar.gz
emacs-bd0af90dca595476bf4ce1ae88939ac75bd34aca.zip
(xfont_has_char): Special handling of `ja' and `ko' adstyle.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog32
-rw-r--r--src/xfont.c30
2 files changed, 55 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dd663a488a3..8758ae7d10f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,37 @@
12009-04-16 Kenichi Handa <handa@m17n.org> 12009-04-16 Kenichi Handa <handa@m17n.org>
2 2
3 * xfont.c (xfont_has_char): Special handling of `ja' and `ko'
4 adstyle.
5
6 * xftfont.c (xftfont_has_char): Special handling of `ja' and `ko'
7 adstyle.
8
9 * ftfont.c (Qja, Qko): Don't make them static.
10 (enum ftfont_cache_for): New enum.
11 (fc_charset_table): Undo the previous change.
12 (ftfont_get_latin1_charset): Delete it.
13 (ftfont_pattern_entity): Check cache by ftfont_lookup_cache. Set
14 FONT_SIZE_INDEX of the entity to 0 for a scalable font. For a
15 non-scarable font, try to get AVERAGE_WIDTH.
16 (ftfont_lookup_cache): Argument FOR-FACE is changed to CACHE_FOR.
17 Change ft_face_cache from a list of a hash-table. Don't check
18 `ja' and `ko' adstyle here.
19 (ftfont_get_fc_charset): Call ftfont_lookup_cache with
20 FTFONT_CACHE_FOR_CHARET.
21 (ftfont_get_charset): Undo the previous change.
22 (ftfont_open): Call ftfont_lookup_cache with
23 FTFONT_CACHE_FOR_FACE.
24 (ftfont_close): Likewise.
25 (ftfont_has_char): Special handling of `ja' and `ko' adstyle.
26
27 * font.c (font_sort_entites): Change the meaning of the arg
28 BEST-ONLY. Don't optimize for VEC of lenght 1.
29 (font_select_entity): Just return the value of font_sort_entites.
30
31 * xfaces.c (merge_face_vectors): Reflect font properties in
32 to[LFACE_FONT_INDEX] to the other face attributes. Don't call
33 font_clear_prop if a face attribute doesn't change.
34
3 * charset.h (charset_ksc5601): Extern it. 35 * charset.h (charset_ksc5601): Extern it.
4 36
5 * charset.c (charset_ksc5601): New variable. 37 * charset.c (charset_ksc5601): New variable.
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
795extern Lisp_Object Qja, Qko;
796
795static int 797static int
796xfont_has_char (entity, c) 798xfont_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)