aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2006-06-21 01:23:08 +0000
committerKenichi Handa2006-06-21 01:23:08 +0000
commite2d0c925ec6b73f064ef1bb0aac7a1cb78591bd2 (patch)
tree1508bcd44fee4b47b38cf710ce8f1b3bffa27e6a
parent7ffefb0856637762050ca248013d2b2f1cf7554e (diff)
downloademacs-e2d0c925ec6b73f064ef1bb0aac7a1cb78591bd2.tar.gz
emacs-e2d0c925ec6b73f064ef1bb0aac7a1cb78591bd2.zip
(xftfont_prepare_face): Make non-ascii face share
face->extra with ascii face. (xftfont_done_face): Don't free face->extra of non-ascii face.
-rw-r--r--src/xftfont.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index 7f301c69236..842f3873c49 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -362,8 +362,15 @@ xftfont_prepare_face (f, face)
362 FRAME_PTR f; 362 FRAME_PTR f;
363 struct face *face; 363 struct face *face;
364{ 364{
365 struct xftface_info *xftface_info = malloc (sizeof (struct xftface_info)); 365 struct xftface_info *xftface_info;
366 366
367 if (face != face->ascii_face)
368 {
369 face->extra = face->ascii_face->extra;
370 return 0;
371 }
372
373 xftface_info = malloc (sizeof (struct xftface_info));
367 if (! xftface_info) 374 if (! xftface_info)
368 return -1; 375 return -1;
369 376
@@ -385,16 +392,18 @@ xftfont_done_face (f, face)
385 FRAME_PTR f; 392 FRAME_PTR f;
386 struct face *face; 393 struct face *face;
387{ 394{
388 struct xftface_info *xftface_info = (struct xftface_info *) face->extra; 395 struct xftface_info *xftface_info;
396
397 if (face != face->ascii_face
398 || ! face->extra)
399 return;
389 400
390 if (xftface_info) 401 xftface_info = (struct xftface_info *) face->extra;
391 { 402 BLOCK_INPUT;
392 BLOCK_INPUT; 403 XftDrawDestroy (xftface_info->xft_draw);
393 XftDrawDestroy (xftface_info->xft_draw); 404 UNBLOCK_INPUT;
394 UNBLOCK_INPUT; 405 free (xftface_info);
395 free (xftface_info); 406 face->extra = NULL;
396 face->extra = NULL;
397 }
398} 407}
399 408
400static unsigned 409static unsigned