aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-06-22 15:07:56 +0000
committerKenichi Handa2008-06-22 15:07:56 +0000
commit22459668339a63fd5066eff9bf9b25046aa5bc47 (patch)
treeef7133ec7c532f75c4ba345e9735bf1d6ad97d02 /src
parent22dbf879a3d54dab1213f4e3fd342029b2d665f8 (diff)
downloademacs-22459668339a63fd5066eff9bf9b25046aa5bc47.tar.gz
emacs-22459668339a63fd5066eff9bf9b25046aa5bc47.zip
(font_find_for_lface): Try the adstyle specified in the property of
LFACE_FONT of LFACE (if any).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/font.c34
2 files changed, 34 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3b5d8ff1fd6..a61e3e4b44a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-06-22 Kenichi Handa <handa@m17n.org>
2
3 * font.c (font_find_for_lface): Try the adstyle specified in
4 the property of LFACE_FONT of LFACE (if any).
5
12008-06-21 Seiji Zenitani <zenitani@mac.com> 62008-06-21 Seiji Zenitani <zenitani@mac.com>
2 Ryo Yoshitake <ryo@shiftmode.net> 7 Ryo Yoshitake <ryo@shiftmode.net>
3 8
diff --git a/src/font.c b/src/font.c
index f10235249f6..b49fde8cb7e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2959,9 +2959,9 @@ font_find_for_lface (f, attrs, spec, c)
2959{ 2959{
2960 Lisp_Object work; 2960 Lisp_Object work;
2961 Lisp_Object frame, entities, val, props[FONT_REGISTRY_INDEX + 1] ; 2961 Lisp_Object frame, entities, val, props[FONT_REGISTRY_INDEX + 1] ;
2962 Lisp_Object size, foundry[3], *family, registry[3]; 2962 Lisp_Object size, foundry[3], *family, registry[3], adstyle[3];
2963 int pixel_size; 2963 int pixel_size;
2964 int i, j, k, result; 2964 int i, j, k, l, result;
2965 2965
2966 registry[0] = AREF (spec, FONT_REGISTRY_INDEX); 2966 registry[0] = AREF (spec, FONT_REGISTRY_INDEX);
2967 if (NILP (registry[0])) 2967 if (NILP (registry[0]))
@@ -3016,6 +3016,26 @@ font_find_for_lface (f, attrs, spec, c)
3016 else 3016 else
3017 foundry[0] = Qnil, foundry[1] = null_vector; 3017 foundry[0] = Qnil, foundry[1] = null_vector;
3018 3018
3019 adstyle[0] = AREF (work, FONT_ADSTYLE_INDEX);
3020 if (! NILP (adstyle[0]))
3021 adstyle[1] = null_vector;
3022 else if (FONTP (attrs[LFACE_FONT_INDEX]))
3023 {
3024 Lisp_Object face_font = attrs[LFACE_FONT_INDEX];
3025
3026 if (! NILP (AREF (face_font, FONT_ADSTYLE_INDEX)))
3027 {
3028 adstyle[0] = AREF (face_font, FONT_ADSTYLE_INDEX);
3029 adstyle[1] = Qnil;
3030 adstyle[2] = null_vector;
3031 }
3032 else
3033 adstyle[0] = Qnil, adstyle[1] = null_vector;
3034 }
3035 else
3036 adstyle[0] = Qnil, adstyle[1] = null_vector;
3037
3038
3019 val = AREF (work, FONT_FAMILY_INDEX); 3039 val = AREF (work, FONT_FAMILY_INDEX);
3020 if (NILP (val) && STRINGP (attrs[LFACE_FAMILY_INDEX])) 3040 if (NILP (val) && STRINGP (attrs[LFACE_FAMILY_INDEX]))
3021 val = font_intern_prop (SDATA (attrs[LFACE_FAMILY_INDEX]), 3041 val = font_intern_prop (SDATA (attrs[LFACE_FAMILY_INDEX]),
@@ -3060,9 +3080,13 @@ font_find_for_lface (f, attrs, spec, c)
3060 for (k = 0; SYMBOLP (registry[k]); k++) 3080 for (k = 0; SYMBOLP (registry[k]); k++)
3061 { 3081 {
3062 ASET (work, FONT_REGISTRY_INDEX, registry[k]); 3082 ASET (work, FONT_REGISTRY_INDEX, registry[k]);
3063 entities = font_list_entities (frame, work); 3083 for (l = 0; SYMBOLP (adstyle[l]); l++)
3064 if (ASIZE (entities) > 0) 3084 {
3065 goto found; 3085 ASET (work, FONT_ADSTYLE_INDEX, adstyle[l]);
3086 entities = font_list_entities (frame, work);
3087 if (ASIZE (entities) > 0)
3088 goto found;
3089 }
3066 } 3090 }
3067 } 3091 }
3068 } 3092 }