Lisp_Object Qslice;
Lisp_Object Qcenter;
Lisp_Object Qmargin, Qpointer;
+Lisp_Object Qline_height;
extern Lisp_Object Qheight;
extern Lisp_Object QCwidth, QCheight, QCascent;
extern Lisp_Object Qscroll_bar;
static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *,
Lisp_Object));
static void extend_face_to_end_of_line P_ ((struct it *));
-static int append_space_for_newline P_ ((struct it *));
+static int append_space_for_newline P_ ((struct it *, int));
static int make_cursor_line_fully_visible P_ ((struct window *, int));
static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
end of the line if the row ends in italic text. */
static int
-append_space_for_newline (it)
+append_space_for_newline (it, default_face_p)
struct it *it;
+ int default_face_p;
{
if (FRAME_WINDOW_P (it->f))
{
it->c = ' ';
it->len = 1;
- if (it->face_before_selective_p)
+ if (default_face_p)
+ it->face_id = DEFAULT_FACE_ID;
+ else if (it->face_before_selective_p)
it->face_id = it->saved_face_id;
face = FACE_FROM_ID (it->f, it->face_id);
it->face_id = FACE_FOR_CHAR (it->f, face, 0);
- if (it->max_ascent > 0 || it->max_descent > 0)
- it->constrain_row_ascent_descent_p = 1;
-
PRODUCE_GLYPHS (it);
+ it->use_default_face = 0;
it->constrain_row_ascent_descent_p = 0;
it->current_x = saved_x;
it->object = saved_object;
row->exact_window_width_line_p = 1;
else
#endif /* HAVE_WINDOW_SYSTEM */
- if ((append_space_for_newline (it) && row->used[TEXT_AREA] == 1)
+ if ((append_space_for_newline (it, 1) && row->used[TEXT_AREA] == 1)
|| row->used[TEXT_AREA] == 0)
{
row->glyphs[TEXT_AREA]->charpos = -1;
/* Add a space at the end of the line that is used to
display the cursor there. */
if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
- append_space_for_newline (it);
+ append_space_for_newline (it, 0);
#endif /* HAVE_WINDOW_SYSTEM */
/* Extend the face to the end of the line. */
it->nglyphs = 1;
+ if (it->use_default_face)
+ {
+ font = FRAME_FONT (it->f);
+ boff = FRAME_BASELINE_OFFSET (it->f);
+ }
+
pcm = rif->per_char_metric (font, &char2b,
FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
if (it->constrain_row_ascent_descent_p)
{
if (it->descent > it->max_descent)
- {
- it->ascent += it->descent - it->max_descent;
- it->descent = it->max_descent;
- }
- if (it->ascent> it->max_ascent)
- {
- it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent);
- it->ascent = it->max_ascent;
- }
- it->phys_ascent = min (it->phys_ascent, it->ascent);
- it->phys_descent = min (it->phys_descent, it->descent);
- extra_line_spacing = 0;
- }
+ {
+ it->ascent += it->descent - it->max_descent;
+ it->descent = it->max_descent;
+ }
+ if (it->ascent > it->max_ascent)
+ {
+ it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent);
+ it->ascent = it->max_ascent;
+ }
+ it->phys_ascent = min (it->phys_ascent, it->ascent);
+ it->phys_descent = min (it->phys_descent, it->descent);
+ extra_line_spacing = 0;
+ }
/* If this is a space inside a region of text with
`space-width' property, change its width. */
But if previous part of the line set a height, don't
increase that height */
- Lisp_Object lsp;
+ Lisp_Object lsp, lh;
it->pixel_width = 0;
it->nglyphs = 0;
- lsp = Fget_text_property (IT_CHARPOS (*it), Qline_spacing, it->w->buffer);
+ lh = Fget_text_property (IT_CHARPOS (*it), Qline_height, it->w->buffer);
+
+ if (EQ (lh, Qt))
+ {
+ it->use_default_face = 1;
+ font = FRAME_FONT (it->f);
+ boff = FRAME_BASELINE_OFFSET (it->f);
+ font_info = NULL;
+ }
it->ascent = FONT_BASE (font) + boff;
it->descent = FONT_DESCENT (font) - boff;
- if (EQ (lsp, Qt))
+ if (EQ (lh, make_number (0)))
{
if (it->descent > it->max_descent)
{
it->ascent += it->descent - it->max_descent;
it->descent = it->max_descent;
}
- if (it->ascent> it->max_ascent)
+ if (it->ascent > it->max_ascent)
{
it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent);
it->ascent = it->max_ascent;
}
it->phys_ascent = min (it->phys_ascent, it->ascent);
it->phys_descent = min (it->phys_descent, it->descent);
+ it->constrain_row_ascent_descent_p = 1;
extra_line_spacing = 0;
}
else
{
+ int explicit_height = -1;
it->phys_ascent = it->ascent;
it->phys_descent = it->descent;
it->ascent += face->box_line_width;
it->descent += face->box_line_width;
}
- if (INTEGERP (lsp))
- extra_line_spacing = XINT (lsp);
- else if (FLOATP (lsp))
- extra_line_spacing = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lsp);
+ if (INTEGERP (lh))
+ explicit_height = XINT (lh);
+ else if (FLOATP (lh))
+ explicit_height = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lh);
+
+ if (explicit_height > it->ascent + it->descent)
+ it->ascent = explicit_height - it->descent;
}
+
+ lsp = Fget_text_property (IT_CHARPOS (*it), Qline_spacing, it->w->buffer);
+ if (INTEGERP (lsp))
+ extra_line_spacing = XINT (lsp);
+ else if (FLOATP (lsp))
+ extra_line_spacing = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lsp);
}
else if (it->char_to_display == '\t')
{
staticpro (&Qright_margin);
Qcenter = intern ("center");
staticpro (&Qcenter);
+ Qline_height = intern ("line-height");
+ staticpro (&Qline_height);
QCalign_to = intern (":align-to");
staticpro (&QCalign_to);
QCrelative_width = intern (":relative-width");