CHAR_TO_PIXEL_COL (f, curs_x),
CHAR_TO_PIXEL_ROW (f, curs_y),
FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
- FONT_HEIGHT (f->display.x->font), False);
+ f->display.x->line_height, False);
#if 0
redraw_previous_char (f, curs_x, curs_y);
#endif
CHAR_TO_PIXEL_COL (f, curs_x),
CHAR_TO_PIXEL_ROW (f, curs_y),
FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
- FONT_HEIGHT (f->display.x->font),
+ f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
CHAR_TO_PIXEL_COL (f, x - 1),
CHAR_TO_PIXEL_ROW (f, y),
FONT_WIDTH (f->display.x->font),
- FONT_HEIGHT (f->display.x->font), False);
+ f->display.x->line_height, False);
dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x),
CHAR_TO_PIXEL_ROW (f, y),
FRAME_X_WINDOW (f), f->display.x->normal_gc,
intborder, CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
- length * FONT_HEIGHT (f->display.x->font), intborder,
+ length * f->display.x->line_height, intborder,
CHAR_TO_PIXEL_ROW (f, newtop));
#else /* ! defined (HAVE_X11) */
XMoveArea (FRAME_X_WINDOW (f),
intborder, CHAR_TO_PIXEL_ROW (f, topregion),
intborder, CHAR_TO_PIXEL_ROW (f, newtop),
f->width * FONT_WIDTH (f->display.x->font),
- length * FONT_HEIGHT (f->display.x->font));
+ length * f->display.x->line_height);
/* Now we must process any ExposeRegion events that occur
if the area being copied from is obscured.
We can't let it wait because further i/d operations
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
- n * FONT_HEIGHT (f->display.x->font), False);
+ n * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XPixSet (FRAME_X_WINDOW (f),
intborder,
CHAR_TO_PIXEL_ROW (f, topregion),
f->width * FONT_WIDTH (f->display.x->font),
- n * FONT_HEIGHT (f->display.x->font),
+ n * f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
- (flexlines - curs_y) * FONT_HEIGHT (f->display.x->font), False);
+ (flexlines - curs_y) * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XPixSet (FRAME_X_WINDOW (f),
intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
- (flexlines - curs_y) * FONT_HEIGHT (f->display.x->font),
+ (flexlines - curs_y) * f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
intborder,
CHAR_TO_PIXEL_ROW (f, curs_y + n),
f->width * FONT_WIDTH (f->display.x->font),
- (flexlines - (curs_y + n)) * FONT_HEIGHT (f->display.x->font),
+ (flexlines - (curs_y + n)) * f->display.x->line_height,
intborder, CHAR_TO_PIXEL_ROW (f, curs_y));
XClearArea (x_current_display, FRAME_X_WINDOW (f),
intborder,
CHAR_TO_PIXEL_ROW (f, flexlines - n),
f->width * FONT_WIDTH (f->display.x->font),
- n * FONT_HEIGHT (f->display.x->font), False);
+ n * f->display.x->line_height, False);
#else /* ! defined (HAVE_X11) */
XMoveArea (FRAME_X_WINDOW (f),
intborder,
CHAR_TO_PIXEL_ROW (f, curs_y + n),
intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
f->width * FONT_WIDTH (f->display.x->font),
- (flexlines - (curs_y + n)) * FONT_HEIGHT (f->display.x->font));
+ (flexlines - (curs_y + n)) * f->display.x->line_height);
/* Now we must process any ExposeRegion events that occur
if the area being copied from is obscured.
We can't let it wait because further i/d operations
XPixSet (FRAME_X_WINDOW (f), intborder,
CHAR_TO_PIXEL_ROW (f, flexlines - n),
f->width * FONT_WIDTH (f->display.x->font),
- n * FONT_HEIGHT (f->display.x->font), f->display.x->background_pixel);
+ n * f->display.x->line_height, f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
}
}
/* If the rectangle includes any of the internal border area,
redisplay the border emphasis. */
if (top < intborder || left < intborder
- || bottom > intborder + f->height * FONT_HEIGHT (f->display.x->font)
- || right > intborder + f->width * FONT_WIDTH (f->display.x->font))
+ || bottom > intborder + f->height * f->display.x->line_height
+ || right > intborder + f->width * f->display.x->line_height)
dumpborder (f, 0);
}
#endif /* not HAVE_X11 Window manger does this for X11. */
Round down for left and top, up for right and bottom. */
top = PIXEL_TO_CHAR_ROW (f, top);
left = PIXEL_TO_CHAR_COL (f, left);
- bottom += (FONT_HEIGHT (f->display.x->font) - 1);
+ bottom += (f->display.x->line_height - 1);
right += (FONT_WIDTH (f->display.x->font) - 1);
bottom = PIXEL_TO_CHAR_ROW (f, bottom);
right = PIXEL_TO_CHAR_COL (f, right);
/ FONT_WIDTH (f->display.x->font));
temp_height = ((windowinfo.height- 2 * intborder
- f->display.x->h_scroll_bar_height)
- / FONT_HEIGHT (f->display.x->font));
+ / f->display.x->line_height);
if (temp_width != f->width || temp_height != f->height)
{
change_frame_size (f, max (1, temp_height),
if (pix_x < 0)
pix_x -= FONT_WIDTH ((f)->display.x->font) - 1;
if (pix_y < 0)
- pix_y -= FONT_HEIGHT ((f)->display.x->font) - 1;
+ pix_y -= (f)->display.x->line_height - 1;
pix_x = PIXEL_TO_CHAR_COL (f, pix_x);
pix_y = PIXEL_TO_CHAR_ROW (f, pix_y);
if (bounds)
{
bounds->width = FONT_WIDTH (f->display.x->font);
- bounds->height = FONT_HEIGHT (f->display.x->font);
+ bounds->height = f->display.x->line_height;
bounds->x = CHAR_TO_PIXEL_COL (f, pix_x);
bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y);
}
int left = CHAR_TO_PIXEL_COL (f, f->cursor_x);
int top = CHAR_TO_PIXEL_ROW (f, f->cursor_y);
int width = FONT_WIDTH (f->display.x->font);
- int height = FONT_HEIGHT (f->display.x->font);
+ int height = f->display.x->line_height;
#ifdef HAVE_X11
XDrawRectangle (x_current_display, FRAME_X_WINDOW (f),
XPixSet (FRAME_X_WINDOW (f),
CHAR_TO_PIXEL_COL (f, f->phys_cursor_x),
CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y),
- FONT_WIDTH (f->display.x->font), FONT_HEIGHT (f->display.x->font),
+ FONT_WIDTH (f->display.x->font), f->display.x->line_height,
f->display.x->background_pixel);
#endif /* ! defined (HAVE_X11) */
f->phys_cursor_x = -1;
f->display.x->cursor_gc,
CHAR_TO_PIXEL_COL (f, curs_x),
CHAR_TO_PIXEL_ROW (f, curs_y),
- 1, FONT_HEIGHT (f->display.x->font));
+ 1, f->display.x->line_height);
f->phys_cursor_x = curs_x;
f->phys_cursor_y = curs_y;
XSetFont (x_current_display, f->display.x->cursor_gc,
f->display.x->font->fid);
- x_set_window_size (f, 0, f->width, f->height);
+ frame_update_line_height (f);
}
+ else
+ /* If we are setting a new frame's font for the first time,
+ there are no faces yet, so this font's height is the line height. */
+ f->display.x->line_height = FONT_HEIGHT (f);
{
Lisp_Object lispy_name;
2 * f->display.x->internal_border_width,
2 * f->display.x->internal_border_width,
FONT_WIDTH (f->display.x->font),
- FONT_HEIGHT (f->display.x->font));
+ f->display.x->line_height);
}
#endif /* HAVE_X11 */
\f
#endif
pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2;
- pix_y = CHAR_TO_PIXEL_ROW (f, y) + FONT_HEIGHT (f->display.x->font) / 2;
+ pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2;
if (pix_x < 0) pix_x = 0;
if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);
size_hints.width = PIXEL_WIDTH (f);
#endif /* not USE_X_TOOLKIT */
size_hints.width_inc = FONT_WIDTH (f->display.x->font);
- size_hints.height_inc = FONT_HEIGHT (f->display.x->font);
+ size_hints.height_inc = f->display.x->line_height;
#if 0
size_hints.max_width = x_screen_width - CHAR_TO_PIXEL_WIDTH (f, 0);
size_hints.max_height = x_screen_height - CHAR_TO_PIXEL_HEIGHT (f, 0);