aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-08-29 07:57:31 +0000
committerKenichi Handa2008-08-29 07:57:31 +0000
commit2b107652bf8f3e2b94824dc4fbfd6e8d0f3a0733 (patch)
treeea75aebd7260bc984e37e6f28d3411b3f9d38d7f /src
parent75a1078622818d6eaa5c98d50cabc8685eb8d3c7 (diff)
downloademacs-2b107652bf8f3e2b94824dc4fbfd6e8d0f3a0733.tar.gz
emacs-2b107652bf8f3e2b94824dc4fbfd6e8d0f3a0733.zip
(x_draw_composite_glyph_string_foreground): Adjusted
for the change of struct glyph_string. (x_draw_glyph_string): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c83
1 files changed, 42 insertions, 41 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 85ac8d948cd..c07d5b63524 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1341,6 +1341,7 @@ x_draw_composite_glyph_string_foreground (s)
1341 struct glyph_string *s; 1341 struct glyph_string *s;
1342{ 1342{
1343 int i, j, x; 1343 int i, j, x;
1344 struct font *font = s->font;
1344 1345
1345 /* If first glyph of S has a left box line, start drawing the text 1346 /* If first glyph of S has a left box line, start drawing the text
1346 of S to the right of that box line. */ 1347 of S to the right of that box line. */
@@ -1350,9 +1351,9 @@ x_draw_composite_glyph_string_foreground (s)
1350 else 1351 else
1351 x = s->x; 1352 x = s->x;
1352 1353
1353 /* S is a glyph string for a composition. S->gidx is the index of 1354 /* S is a glyph string for a composition. S->cmp_from is the index
1354 the first character drawn for glyphs of this composition. 1355 of the first character drawn for glyphs of this composition.
1355 S->gidx == 0 means we are drawing the very first character of 1356 S->cmp_from == 0 means we are drawing the very first character of
1356 this composition. */ 1357 this composition. */
1357 1358
1358 SetTextColor (s->hdc, s->gc->foreground); 1359 SetTextColor (s->hdc, s->gc->foreground);
@@ -1363,67 +1364,66 @@ x_draw_composite_glyph_string_foreground (s)
1363 first character of the composition could not be loaded. */ 1364 first character of the composition could not be loaded. */
1364 if (s->font_not_found_p) 1365 if (s->font_not_found_p)
1365 { 1366 {
1366 if (s->gidx == 0) 1367 if (s->cmp_from == 0)
1367 w32_draw_rectangle (s->hdc, s->gc, x, s->y, s->width - 1, 1368 w32_draw_rectangle (s->hdc, s->gc, x, s->y, s->width - 1,
1368 s->height - 1); 1369 s->height - 1);
1369 } 1370 }
1371 else if (! s->first_glyph->u.cmp.automatic)
1372 {
1373 int y = s->ybase;
1374 int width = 0;
1375 HFONT old_font;
1376
1377 old_font = SelectObject (s->hdc, FONT_HANDLE (font));
1378
1379 for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++)
1380 if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
1381 {
1382 int xx = x + s->cmp->offsets[j * 2];
1383 int yy = y - s->cmp->offsets[j * 2 + 1];
1384
1385 font->driver->draw (s, j, j + 1, xx, yy, 0);
1386 if (s->face->overstrike)
1387 font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
1388 }
1389 SelectObject (s->hdc, old_font);
1390 }
1370 else 1391 else
1371 { 1392 {
1372 struct font *font = s->font; 1393 Lisp_Object gstring = composition_gstring_from_id (s->cmp_id);
1394 Lisp_Object glyph;
1373 int y = s->ybase; 1395 int y = s->ybase;
1374 int width = 0; 1396 int width = 0;
1375 HFONT old_font; 1397 HFONT old_font;
1376 1398
1377 old_font = SelectObject (s->hdc, FONT_HANDLE (font)); 1399 old_font = SelectObject (s->hdc, FONT_HANDLE (font));
1378 1400
1379 if (s->cmp->method == COMPOSITION_WITH_GLYPH_STRING) 1401 for (i = j = s->cmp_from; i < s->cmp_to; i++)
1380 { 1402 {
1381 Lisp_Object gstring = AREF (XHASH_TABLE (composition_hash_table) 1403 glyph = LGSTRING_GLYPH (gstring, i);
1382 ->key_and_value, 1404 if (NILP (LGLYPH_ADJUSTMENT (glyph)))
1383 s->cmp->hash_index * 2); 1405 width += LGLYPH_WIDTH (glyph);
1384 int from; 1406 else
1385
1386 for (i = from = 0; i < s->nchars; i++)
1387 { 1407 {
1388 Lisp_Object g = LGSTRING_GLYPH (gstring, i);
1389 Lisp_Object adjustment = LGLYPH_ADJUSTMENT (g);
1390 int xoff, yoff, wadjust; 1408 int xoff, yoff, wadjust;
1391 1409
1392 if (! VECTORP (adjustment)) 1410 if (j < i)
1393 { 1411 {
1394 width += LGLYPH_WIDTH (g); 1412 font->driver->draw (s, j, i, x, y, 0);
1395 continue;
1396 }
1397 if (from < i)
1398 {
1399 font->driver->draw (s, from, i, x, y, 0);
1400 x += width; 1413 x += width;
1401 } 1414 }
1402 xoff = XINT (AREF (adjustment, 0)); 1415 xoff = LGLYPH_XOFF (glyph);
1403 yoff = XINT (AREF (adjustment, 1)); 1416 yoff = LGLYPH_YOFF (glyph);
1404 wadjust = XINT (AREF (adjustment, 2)); 1417 wadjust = LGLYPH_WADJUST (glyph);
1405
1406 font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0); 1418 font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
1407 x += wadjust; 1419 x += wadjust;
1408 from = i + 1; 1420 j = i + 1;
1409 width = 0; 1421 width = 0;
1410 } 1422 }
1411 if (from < i)
1412 font->driver->draw (s, from, i, x, y, 0);
1413 } 1423 }
1414 else 1424 if (j < i)
1415 { 1425 font->driver->draw (s, j, i, x, y, 0);
1416 for (i = 0, j = s->gidx; i < s->nchars; i++, j++)
1417 if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
1418 {
1419 int xx = x + s->cmp->offsets[j * 2];
1420 int yy = y - s->cmp->offsets[j * 2 + 1];
1421 1426
1422 font->driver->draw (s, j, j + 1, xx, yy, 0);
1423 if (s->face->overstrike)
1424 font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
1425 }
1426 }
1427 SelectObject (s->hdc, old_font); 1427 SelectObject (s->hdc, old_font);
1428 } 1428 }
1429} 1429}
@@ -2283,7 +2283,8 @@ x_draw_glyph_string (s)
2283 break; 2283 break;
2284 2284
2285 case COMPOSITE_GLYPH: 2285 case COMPOSITE_GLYPH:
2286 if (s->for_overlaps || s->gidx > 0) 2286 if (s->for_overlaps || (s->cmp_from > 0
2287 && ! s->first_glyph->u.cmp.automatic))
2287 s->background_filled_p = 1; 2288 s->background_filled_p = 1;
2288 else 2289 else
2289 x_draw_glyph_string_background (s, 1); 2290 x_draw_glyph_string_background (s, 1);