Mercurial > emacs
comparison src/ftfont.c @ 101556:7f8b5730cfa5
(ftfont_has_char): If the arg FONT is a font-object,
directly use GT_Get_Char_index.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 27 Jan 2009 05:09:42 +0000 |
parents | 4c2b48d0a379 |
children | 97c9e9322753 |
comparison
equal
deleted
inserted
replaced
101555:a8e049b0d2c2 | 101556:7f8b5730cfa5 |
---|---|
60 | 60 |
61 struct ftfont_info | 61 struct ftfont_info |
62 { | 62 { |
63 struct font font; | 63 struct font font; |
64 #ifdef HAVE_LIBOTF | 64 #ifdef HAVE_LIBOTF |
65 /* The following three members must be here in this order to be | 65 /* The following four members must be here in this order to be |
66 compatible with struct xftfont_info (in xftfont.c). */ | 66 compatible with struct xftfont_info (in xftfont.c). */ |
67 int maybe_otf; /* Flag to tell if this may be OTF or not. */ | 67 int maybe_otf; /* Flag to tell if this may be OTF or not. */ |
68 OTF *otf; | 68 OTF *otf; |
69 #endif /* HAVE_LIBOTF */ | 69 #endif /* HAVE_LIBOTF */ |
70 FT_Size ft_size; | 70 FT_Size ft_size; |
1187 else | 1187 else |
1188 FT_Done_Size (ftfont_info->ft_size); | 1188 FT_Done_Size (ftfont_info->ft_size); |
1189 } | 1189 } |
1190 | 1190 |
1191 static int | 1191 static int |
1192 ftfont_has_char (entity, c) | 1192 ftfont_has_char (font, c) |
1193 Lisp_Object entity; | 1193 Lisp_Object font; |
1194 int c; | 1194 int c; |
1195 { | 1195 { |
1196 FcCharSet *charset = ftfont_get_fc_charset (entity); | 1196 if (FONT_ENTITY_P (font)) |
1197 | 1197 { |
1198 return (FcCharSetHasChar (charset, c) == FcTrue); | 1198 FcCharSet *charset = ftfont_get_fc_charset (font); |
1199 | |
1200 return (FcCharSetHasChar (charset, c) == FcTrue); | |
1201 } | |
1202 else | |
1203 { | |
1204 struct ftfont_info *ftfont_info; | |
1205 | |
1206 ftfont_info = (struct ftfont_info *) XFONT_OBJECT (font); | |
1207 return (FT_Get_Char_Index (ftfont_info->ft_size->face, (FT_ULong) c) | |
1208 != 0); | |
1209 } | |
1199 } | 1210 } |
1200 | 1211 |
1201 static unsigned | 1212 static unsigned |
1202 ftfont_encode_char (font, c) | 1213 ftfont_encode_char (font, c) |
1203 struct font *font; | 1214 struct font *font; |