comparison src/xterm.c @ 91904:c9a3274c0d40

(x_set_cursor_gc): Use display_info->font->fid for GCs. (x_set_mouse_face_gc, x_new_font): Likewise. (x_term_init): Setup display_info->font. (x_delete_terminal): Free display_info->font.
author Kenichi Handa <handa@m17n.org>
date Sun, 17 Feb 2008 02:02:54 +0000
parents c33ec1f680a9
children 3a7d2adfb2af
comparison
equal deleted inserted replaced
91903:8dadab0712f6 91904:c9a3274c0d40
1096 xgcv.background = s->face->foreground; 1096 xgcv.background = s->face->foreground;
1097 xgcv.foreground = s->face->background; 1097 xgcv.foreground = s->face->background;
1098 } 1098 }
1099 1099
1100 IF_DEBUG (x_check_font (s->f, s->font)); 1100 IF_DEBUG (x_check_font (s->f, s->font));
1101 #ifdef USE_FONT_BACKEND
1102 if (enable_font_backend)
1103 xgcv.font = FRAME_X_DISPLAY_INFO (s->f)->font->fid;
1104 else
1105 #endif
1101 xgcv.font = s->font->fid; 1106 xgcv.font = s->font->fid;
1102 xgcv.graphics_exposures = False; 1107 xgcv.graphics_exposures = False;
1103 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; 1108 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
1104 1109
1105 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 1110 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc)
1152 unsigned long mask; 1157 unsigned long mask;
1153 1158
1154 xgcv.background = s->face->background; 1159 xgcv.background = s->face->background;
1155 xgcv.foreground = s->face->foreground; 1160 xgcv.foreground = s->face->foreground;
1156 IF_DEBUG (x_check_font (s->f, s->font)); 1161 IF_DEBUG (x_check_font (s->f, s->font));
1162 #ifdef USE_FONT_BACKEND
1163 if (enable_font_backend)
1164 xgcv.font = FRAME_X_DISPLAY_INFO (s->f)->font->fid;
1165 else
1166 #endif
1157 xgcv.font = s->font->fid; 1167 xgcv.font = s->font->fid;
1158 xgcv.graphics_exposures = False; 1168 xgcv.graphics_exposures = False;
1159 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; 1169 mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures;
1160 1170
1161 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 1171 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc)
8274 } 8284 }
8275 8285
8276 /* Now make the frame display the given font. */ 8286 /* Now make the frame display the given font. */
8277 if (FRAME_X_WINDOW (f) != 0) 8287 if (FRAME_X_WINDOW (f) != 0)
8278 { 8288 {
8279 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, 8289 Font fid;
8280 FRAME_FONT (f)->fid); 8290
8281 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc, 8291 #ifdef USE_FONT_BACKEND
8282 FRAME_FONT (f)->fid); 8292 if (enable_font_backend)
8283 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, 8293 fid = FRAME_X_DISPLAY_INFO (f)->font->fid;
8284 FRAME_FONT (f)->fid); 8294 else
8295 #endif
8296 fid = FRAME_FONT (f)->fid;
8297 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->normal_gc, fid);
8298 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->reverse_gc, fid);
8299 XSetFont (FRAME_X_DISPLAY (f), f->output_data.x->cursor_gc, fid);
8285 8300
8286 /* Don't change the size of a tip frame; there's no point in 8301 /* Don't change the size of a tip frame; there's no point in
8287 doing it because it's done in Fx_show_tip, and it leads to 8302 doing it because it's done in Fx_show_tip, and it leads to
8288 problems because the tip frame has no widget. */ 8303 problems because the tip frame has no widget. */
8289 if (NILP (tip_frame) || XFRAME (tip_frame) != f) 8304 if (NILP (tip_frame) || XFRAME (tip_frame) != f)
11356 dpyinfo->reference_count = 0; 11371 dpyinfo->reference_count = 0;
11357 dpyinfo->icon_bitmap_id = -1; 11372 dpyinfo->icon_bitmap_id = -1;
11358 dpyinfo->font_table = NULL; 11373 dpyinfo->font_table = NULL;
11359 dpyinfo->n_fonts = 0; 11374 dpyinfo->n_fonts = 0;
11360 dpyinfo->font_table_size = 0; 11375 dpyinfo->font_table_size = 0;
11376 #ifdef USE_FONT_BACKEND
11377 dpyinfo->font = XLoadQueryFont (dpyinfo->display, "fixed");
11378 if (! dpyinfo->font)
11379 dpyinfo->font = XLoadQueryFont (dpyinfo->display, "*");
11380 if (! dpyinfo->font)
11381 abort ();
11382 #endif /* USE_FONT_BACKEND */
11361 dpyinfo->bitmaps = 0; 11383 dpyinfo->bitmaps = 0;
11362 dpyinfo->bitmaps_size = 0; 11384 dpyinfo->bitmaps_size = 0;
11363 dpyinfo->bitmaps_last = 0; 11385 dpyinfo->bitmaps_last = 0;
11364 dpyinfo->scratch_cursor_gc = 0; 11386 dpyinfo->scratch_cursor_gc = 0;
11365 dpyinfo->mouse_face_mouse_frame = 0; 11387 dpyinfo->mouse_face_mouse_frame = 0;
11811 if (!terminal->name) 11833 if (!terminal->name)
11812 return; 11834 return;
11813 11835
11814 BLOCK_INPUT; 11836 BLOCK_INPUT;
11815 #ifdef USE_FONT_BACKEND 11837 #ifdef USE_FONT_BACKEND
11816 if (! enable_font_backend) 11838 if (enable_font_backend)
11839 XFreeFont (dpyinfo->display, dpyinfo->font);
11840 else
11817 #endif 11841 #endif
11818 /* Free the fonts in the font table. */ 11842 /* Free the fonts in the font table. */
11819 for (i = 0; i < dpyinfo->n_fonts; i++) 11843 for (i = 0; i < dpyinfo->n_fonts; i++)
11820 if (dpyinfo->font_table[i].name) 11844 if (dpyinfo->font_table[i].name)
11821 { 11845 {