comparison src/font.c @ 95699:0afdc320716c

(Qascii_0): New variable. (syms_of_font): DEFSYM it. (font_open_by_name): If the registry "iso8859-1" fails, try also "ascii-0".
author Kenichi Handa <handa@m17n.org>
date Mon, 09 Jun 2008 07:17:32 +0000
parents 0da1a8e03099
children b490fda95b13
comparison
equal deleted inserted replaced
95698:d87a51f8851f 95699:0afdc320716c
53 Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; 53 Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
54 54
55 Lisp_Object Qopentype; 55 Lisp_Object Qopentype;
56 56
57 /* Important character set strings. */ 57 /* Important character set strings. */
58 Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip; 58 Lisp_Object Qascii_0, Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip;
59 59
60 /* Special vector of zero length. This is repeatedly used by (struct 60 /* Special vector of zero length. This is repeatedly used by (struct
61 font_driver *)->list when a specified font is not found. */ 61 font_driver *)->list when a specified font is not found. */
62 static Lisp_Object null_vector; 62 static Lisp_Object null_vector;
63 63
3007 font_open_by_name (f, name) 3007 font_open_by_name (f, name)
3008 FRAME_PTR f; 3008 FRAME_PTR f;
3009 char *name; 3009 char *name;
3010 { 3010 {
3011 Lisp_Object args[2]; 3011 Lisp_Object args[2];
3012 Lisp_Object spec, prefer, size, entity, entity_list; 3012 Lisp_Object spec, prefer, size, registry, entity, entity_list;
3013 Lisp_Object frame; 3013 Lisp_Object frame;
3014 int i; 3014 int i;
3015 int pixel_size; 3015 int pixel_size;
3016 3016
3017 XSETFRAME (frame, f); 3017 XSETFRAME (frame, f);
3047 { 3047 {
3048 pixel_size = POINT_TO_PIXEL (12.0, f->resy); 3048 pixel_size = POINT_TO_PIXEL (12.0, f->resy);
3049 size = make_number (pixel_size); 3049 size = make_number (pixel_size);
3050 ASET (prefer, FONT_SIZE_INDEX, size); 3050 ASET (prefer, FONT_SIZE_INDEX, size);
3051 } 3051 }
3052 if (NILP (AREF (spec, FONT_REGISTRY_INDEX))) 3052 registry = AREF (spec, FONT_REGISTRY_INDEX);
3053 if (NILP (registry))
3053 ASET (spec, FONT_REGISTRY_INDEX, Qiso8859_1); 3054 ASET (spec, FONT_REGISTRY_INDEX, Qiso8859_1);
3054
3055 entity_list = Flist_fonts (spec, frame, make_number (1), prefer); 3055 entity_list = Flist_fonts (spec, frame, make_number (1), prefer);
3056 if (NILP (entity_list) && NILP (registry))
3057 {
3058 ASET (spec, FONT_REGISTRY_INDEX, Qascii_0);
3059 entity_list = Flist_fonts (spec, frame, make_number (1), prefer);
3060 }
3061 ASET (spec, FONT_REGISTRY_INDEX, registry);
3056 if (NILP (entity_list)) 3062 if (NILP (entity_list))
3057 entity = font_matching_entity (f, NULL, spec); 3063 entity = font_matching_entity (f, NULL, spec);
3058 else 3064 else
3059 entity = XCAR (entity_list); 3065 entity = XCAR (entity_list);
3060 return (NILP (entity) 3066 return (NILP (entity)
4522 DEFSYM (Qfont_entity, "font-entity"); 4528 DEFSYM (Qfont_entity, "font-entity");
4523 DEFSYM (Qfont_object, "font-object"); 4529 DEFSYM (Qfont_object, "font-object");
4524 4530
4525 DEFSYM (Qopentype, "opentype"); 4531 DEFSYM (Qopentype, "opentype");
4526 4532
4533 DEFSYM (Qascii_0, "ascii-0");
4527 DEFSYM (Qiso8859_1, "iso8859-1"); 4534 DEFSYM (Qiso8859_1, "iso8859-1");
4528 DEFSYM (Qiso10646_1, "iso10646-1"); 4535 DEFSYM (Qiso10646_1, "iso10646-1");
4529 DEFSYM (Qunicode_bmp, "unicode-bmp"); 4536 DEFSYM (Qunicode_bmp, "unicode-bmp");
4530 DEFSYM (Qunicode_sip, "unicode-sip"); 4537 DEFSYM (Qunicode_sip, "unicode-sip");
4531 4538