Commit ae185452 authored by Kenichi Handa's avatar Kenichi Handa

(struct glyph_string): New member padding_p.

parent de63f07f
2008-02-25 Kenichi Handa <handa@ni.aist.go.jp>
* xdisp.c (fill_glyph_string): Pay attention to glyph->padding_p.
(append_glyph): Set glyph->pixel_width and glyph->padding_p to 1
if the glyph in the font is zero pixel with.
* dispextern.h (struct glyph_string): New member padding_p.
* w32font.c (w32font_draw): Pay attention to s->padding_p.
* ftxfont.c (ftxfont_draw): Pay attention to s->padding_p.
* xfont.c (xfont_draw): Pay attention to s->padding_p.
* xftfont.c (xftfont_draw): Pay attention to s->padding_p.
* font.c: If the font driver doesn't have `shape' function, return
Qnil.
2008-02-25 Jason Rumney <jasonr@gnu.org>
* w32fns.c (enum_font_cb2): Don't use raster fonts for Unicode.
......
......@@ -351,13 +351,16 @@ struct glyph
glyphs above or below it. */
unsigned overlaps_vertically_p : 1;
/* 1 means glyph is a padding glyph. Padding glyphs are used for
characters whose visual shape consists of more than one glyph
(e.g. Asian characters). All but the first glyph of such a glyph
sequence have the padding_p flag set. Only used for terminal
frames, and there only to minimize code changes. A better way
would probably be to use the width field of glyphs to express
padding. */
/* For terminal frames, 1 means glyph is a padding glyph. Padding
glyphs are used for characters whose visual shape consists of
more than one glyph (e.g. Asian characters). All but the first
glyph of such a glyph sequence have the padding_p flag set. This
flag is used only to minimize code changes. A better way would
probably be to use the width field of glyphs to express padding.
For graphic frames, 1 means the pixel width of the glyph in a
font is 0, but 1-pixel is padded on displaying for correct cursor
displaying. The member `pixel_width' above is set to 1. */
unsigned padding_p : 1;
/* 1 means the actual glyph is not available, draw a box instead.
......@@ -1197,6 +1200,11 @@ struct glyph_string
respectively. */
unsigned for_overlaps : 3;
/* 1 means that all glyphs in this glyph string has the flag
padding_p set, and thus must be drawn one by one to have 1-pixel
width even though the logical width in the font is zero. */
unsigned padding_p : 1;
/* The GC to use for drawing this glyph string. */
#if defined(HAVE_X_WINDOWS) || defined(MAC_OS)
GC gc;
......
......@@ -19409,7 +19409,7 @@ fill_glyph_string (s, face_id, start, end, overlaps)
glyph = s->row->glyphs[s->area] + start;
last = s->row->glyphs[s->area] + end;
voffset = glyph->voffset;
s->padding_p = glyph->padding_p;
glyph_not_available_p = glyph->glyph_not_available_p;
while (glyph < last
......@@ -19428,7 +19428,8 @@ fill_glyph_string (s, face_id, start, end, overlaps)
++s->nchars;
xassert (s->nchars <= end - start);
s->width += glyph->pixel_width;
++glyph;
if (glyph++->padding_p != s->padding_p)
break;
}
s->font = s->face->font;
......@@ -20181,7 +20182,18 @@ append_glyph (it)
{
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
glyph->pixel_width = it->pixel_width;
if (it->pixel_width > 0)
{
glyph->pixel_width = it->pixel_width;
glyph->padding_p = 0;
}
else
{
/* Assure at least 1-pixel width. Otherwise, cursor can't
be displayed correctly. */
glyph->pixel_width = 1;
glyph->padding_p = 1;
}
glyph->ascent = it->ascent;
glyph->descent = it->descent;
glyph->voffset = it->voffset;
......@@ -20191,7 +20203,6 @@ append_glyph (it)
glyph->right_box_line_p = it->end_of_box_run_p;
glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
|| it->phys_descent > it->descent);
glyph->padding_p = 0;
glyph->glyph_not_available_p = it->glyph_not_available_p;
glyph->face_id = it->face_id;
glyph->u.ch = it->char_to_display;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment