comparison src/font.c @ 109544:197e874deb67

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 26 Jul 2010 13:29:08 +0900
parents f69d90096f33 c02e8765755d
children 05e7e7c46ff0
comparison
equal deleted inserted replaced
109493:f69d90096f33 109544:197e874deb67
976 if (INTEGERP (field[XLFD_ENCODING_INDEX])) 976 if (INTEGERP (field[XLFD_ENCODING_INDEX]))
977 field[XLFD_ENCODING_INDEX] 977 field[XLFD_ENCODING_INDEX]
978 = Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil); 978 = Fintern (Fnumber_to_string (field[XLFD_ENCODING_INDEX]), Qnil);
979 return 0; 979 return 0;
980 } 980 }
981
982
983 #ifdef ENABLE_CHECKING
984 /* Match a 14-field XLFD pattern against a full XLFD font name. */
985 static int
986 font_match_xlfd (char *pattern, char *name)
987 {
988 while (*pattern && *name)
989 {
990 if (*pattern == *name)
991 pattern++;
992 else if (*pattern == '*')
993 if (*name == pattern[1])
994 pattern += 2;
995 else
996 ;
997 else
998 return 0;
999 name++;
1000 }
1001 return 1;
1002 }
1003
1004 /* Make sure the font object matches the XLFD font name. */
1005 static int
1006 font_check_xlfd_parse (Lisp_Object font, char *name)
1007 {
1008 char name_check[256];
1009 font_unparse_xlfd (font, 0, name_check, 255);
1010 return font_match_xlfd (name_check, name);
1011 }
1012
1013 #endif
1014 981
1015 982
1016 /* Parse NAME (null terminated) as XLFD and store information in FONT 983 /* Parse NAME (null terminated) as XLFD and store information in FONT
1017 (font-spec or font-entity). Size property of FONT is set as 984 (font-spec or font-entity). Size property of FONT is set as
1018 follows: 985 follows: