comparison src/ftxfont.c @ 90560:c443c8a56b84

(ftxfont_match): New function. (syms_of_ftxfont): Set ftxfont_driver.match to ftxfont_match.
author Kenichi Handa <handa@m17n.org>
date Tue, 01 Aug 2006 01:19:31 +0000
parents d0351223b22a
children 5ed0717083a1
comparison
equal deleted inserted replaced
90559:fb5d3ac2d786 90560:c443c8a56b84
194 return fid; 194 return fid;
195 } 195 }
196 196
197 /* Prototypes for font-driver methods. */ 197 /* Prototypes for font-driver methods. */
198 static Lisp_Object ftxfont_list P_ ((Lisp_Object, Lisp_Object)); 198 static Lisp_Object ftxfont_list P_ ((Lisp_Object, Lisp_Object));
199 static Lisp_Object ftxfont_match P_ ((Lisp_Object, Lisp_Object));
199 static struct font *ftxfont_open P_ ((FRAME_PTR, Lisp_Object, int)); 200 static struct font *ftxfont_open P_ ((FRAME_PTR, Lisp_Object, int));
200 static void ftxfont_close P_ ((FRAME_PTR, struct font *)); 201 static void ftxfont_close P_ ((FRAME_PTR, struct font *));
201 static int ftxfont_prepare_face (FRAME_PTR, struct face *); 202 static int ftxfont_prepare_face (FRAME_PTR, struct face *);
202 static void ftxfont_done_face (FRAME_PTR, struct face *); 203 static void ftxfont_done_face (FRAME_PTR, struct face *);
203 204
218 219
219 for (i = 0; i < ASIZE (val); i++) 220 for (i = 0; i < ASIZE (val); i++)
220 ASET (AREF (val, i), FONT_TYPE_INDEX, Qftx); 221 ASET (AREF (val, i), FONT_TYPE_INDEX, Qftx);
221 } 222 }
222 return val; 223 return val;
224 }
225
226 static Lisp_Object
227 ftxfont_match (frame, spec)
228 Lisp_Object frame;
229 Lisp_Object spec;
230 {
231 Lisp_Object entity = ftfont_driver.match (frame, spec);
232
233 if (VECTORP (entity))
234 ASET (entity, FONT_TYPE_INDEX, Qftx);
235 return entity;
223 } 236 }
224 237
225 static struct font * 238 static struct font *
226 ftxfont_open (f, entity, pixel_size) 239 ftxfont_open (f, entity, pixel_size)
227 FRAME_PTR f; 240 FRAME_PTR f;
287 FRAME_PTR f; 300 FRAME_PTR f;
288 struct face *face; 301 struct face *face;
289 { 302 {
290 struct font *font = (struct font *) face->font_info; 303 struct font *font = (struct font *) face->font_info;
291 GC gcs[6]; 304 GC gcs[6];
292 XColor colors[3];
293 XGCValues xgcv;
294 unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures;
295 int i; 305 int i;
296 306
297 face->extra = NULL; 307 face->extra = NULL;
298 308
299 if (! font->scalable) 309 if (! font->scalable)
411 DEFSYM (Qftx, "ftx"); 421 DEFSYM (Qftx, "ftx");
412 422
413 ftxfont_driver = ftfont_driver; 423 ftxfont_driver = ftfont_driver;
414 ftxfont_driver.type = Qftx; 424 ftxfont_driver.type = Qftx;
415 ftxfont_driver.list = ftxfont_list; 425 ftxfont_driver.list = ftxfont_list;
426 ftxfont_driver.match = ftxfont_match;
416 ftxfont_driver.open = ftxfont_open; 427 ftxfont_driver.open = ftxfont_open;
417 ftxfont_driver.close = ftxfont_close; 428 ftxfont_driver.close = ftxfont_close;
418 ftxfont_driver.prepare_face = ftxfont_prepare_face; 429 ftxfont_driver.prepare_face = ftxfont_prepare_face;
419 ftxfont_driver.done_face = ftxfont_done_face; 430 ftxfont_driver.done_face = ftxfont_done_face;
420 ftxfont_driver.draw = ftxfont_draw; 431 ftxfont_driver.draw = ftxfont_draw;