aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2008-02-25 01:52:35 +0000
committerKenichi Handa2008-02-25 01:52:35 +0000
commitae185452070444d89db7f1069c58cfa27a5e15b0 (patch)
tree27bfe2dbcb22547206d8dcdf3c23f364f0b62679
parentde63f07f8151e740edf0db7bff142cd863820071 (diff)
downloademacs-ae185452070444d89db7f1069c58cfa27a5e15b0.tar.gz
emacs-ae185452070444d89db7f1069c58cfa27a5e15b0.zip
(struct glyph_string): New member padding_p.
-rw-r--r--src/ChangeLog19
-rw-r--r--src/dispextern.h22
-rw-r--r--src/xdisp.c19
3 files changed, 49 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 71026e1d77e..263168d128b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12008-02-25 Kenichi Handa <handa@ni.aist.go.jp>
2
3 * xdisp.c (fill_glyph_string): Pay attention to glyph->padding_p.
4 (append_glyph): Set glyph->pixel_width and glyph->padding_p to 1
5 if the glyph in the font is zero pixel with.
6
7 * dispextern.h (struct glyph_string): New member padding_p.
8
9 * w32font.c (w32font_draw): Pay attention to s->padding_p.
10
11 * ftxfont.c (ftxfont_draw): Pay attention to s->padding_p.
12
13 * xfont.c (xfont_draw): Pay attention to s->padding_p.
14
15 * xftfont.c (xftfont_draw): Pay attention to s->padding_p.
16
17 * font.c: If the font driver doesn't have `shape' function, return
18 Qnil.
19
12008-02-25 Jason Rumney <jasonr@gnu.org> 202008-02-25 Jason Rumney <jasonr@gnu.org>
2 21
3 * w32fns.c (enum_font_cb2): Don't use raster fonts for Unicode. 22 * w32fns.c (enum_font_cb2): Don't use raster fonts for Unicode.
diff --git a/src/dispextern.h b/src/dispextern.h
index ea5a077d7b2..652980be783 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -351,13 +351,16 @@ struct glyph
351 glyphs above or below it. */ 351 glyphs above or below it. */
352 unsigned overlaps_vertically_p : 1; 352 unsigned overlaps_vertically_p : 1;
353 353
354 /* 1 means glyph is a padding glyph. Padding glyphs are used for 354 /* For terminal frames, 1 means glyph is a padding glyph. Padding
355 characters whose visual shape consists of more than one glyph 355 glyphs are used for characters whose visual shape consists of
356 (e.g. Asian characters). All but the first glyph of such a glyph 356 more than one glyph (e.g. Asian characters). All but the first
357 sequence have the padding_p flag set. Only used for terminal 357 glyph of such a glyph sequence have the padding_p flag set. This
358 frames, and there only to minimize code changes. A better way 358 flag is used only to minimize code changes. A better way would
359 would probably be to use the width field of glyphs to express 359 probably be to use the width field of glyphs to express padding.
360 padding. */ 360
361 For graphic frames, 1 means the pixel width of the glyph in a
362 font is 0, but 1-pixel is padded on displaying for correct cursor
363 displaying. The member `pixel_width' above is set to 1. */
361 unsigned padding_p : 1; 364 unsigned padding_p : 1;
362 365
363 /* 1 means the actual glyph is not available, draw a box instead. 366 /* 1 means the actual glyph is not available, draw a box instead.
@@ -1197,6 +1200,11 @@ struct glyph_string
1197 respectively. */ 1200 respectively. */
1198 unsigned for_overlaps : 3; 1201 unsigned for_overlaps : 3;
1199 1202
1203 /* 1 means that all glyphs in this glyph string has the flag
1204 padding_p set, and thus must be drawn one by one to have 1-pixel
1205 width even though the logical width in the font is zero. */
1206 unsigned padding_p : 1;
1207
1200 /* The GC to use for drawing this glyph string. */ 1208 /* The GC to use for drawing this glyph string. */
1201#if defined(HAVE_X_WINDOWS) || defined(MAC_OS) 1209#if defined(HAVE_X_WINDOWS) || defined(MAC_OS)
1202 GC gc; 1210 GC gc;
diff --git a/src/xdisp.c b/src/xdisp.c
index 588d145e9e1..1e2a667330e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19409,7 +19409,7 @@ fill_glyph_string (s, face_id, start, end, overlaps)
19409 glyph = s->row->glyphs[s->area] + start; 19409 glyph = s->row->glyphs[s->area] + start;
19410 last = s->row->glyphs[s->area] + end; 19410 last = s->row->glyphs[s->area] + end;
19411 voffset = glyph->voffset; 19411 voffset = glyph->voffset;
19412 19412 s->padding_p = glyph->padding_p;
19413 glyph_not_available_p = glyph->glyph_not_available_p; 19413 glyph_not_available_p = glyph->glyph_not_available_p;
19414 19414
19415 while (glyph < last 19415 while (glyph < last
@@ -19428,7 +19428,8 @@ fill_glyph_string (s, face_id, start, end, overlaps)
19428 ++s->nchars; 19428 ++s->nchars;
19429 xassert (s->nchars <= end - start); 19429 xassert (s->nchars <= end - start);
19430 s->width += glyph->pixel_width; 19430 s->width += glyph->pixel_width;
19431 ++glyph; 19431 if (glyph++->padding_p != s->padding_p)
19432 break;
19432 } 19433 }
19433 19434
19434 s->font = s->face->font; 19435 s->font = s->face->font;
@@ -20181,7 +20182,18 @@ append_glyph (it)
20181 { 20182 {
20182 glyph->charpos = CHARPOS (it->position); 20183 glyph->charpos = CHARPOS (it->position);
20183 glyph->object = it->object; 20184 glyph->object = it->object;
20184 glyph->pixel_width = it->pixel_width; 20185 if (it->pixel_width > 0)
20186 {
20187 glyph->pixel_width = it->pixel_width;
20188 glyph->padding_p = 0;
20189 }
20190 else
20191 {
20192 /* Assure at least 1-pixel width. Otherwise, cursor can't
20193 be displayed correctly. */
20194 glyph->pixel_width = 1;
20195 glyph->padding_p = 1;
20196 }
20185 glyph->ascent = it->ascent; 20197 glyph->ascent = it->ascent;
20186 glyph->descent = it->descent; 20198 glyph->descent = it->descent;
20187 glyph->voffset = it->voffset; 20199 glyph->voffset = it->voffset;
@@ -20191,7 +20203,6 @@ append_glyph (it)
20191 glyph->right_box_line_p = it->end_of_box_run_p; 20203 glyph->right_box_line_p = it->end_of_box_run_p;
20192 glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent 20204 glyph->overlaps_vertically_p = (it->phys_ascent > it->ascent
20193 || it->phys_descent > it->descent); 20205 || it->phys_descent > it->descent);
20194 glyph->padding_p = 0;
20195 glyph->glyph_not_available_p = it->glyph_not_available_p; 20206 glyph->glyph_not_available_p = it->glyph_not_available_p;
20196 glyph->face_id = it->face_id; 20207 glyph->face_id = it->face_id;
20197 glyph->u.ch = it->char_to_display; 20208 glyph->u.ch = it->char_to_display;