… | |
… | |
1406 | while (len) |
1406 | while (len) |
1407 | { |
1407 | { |
1408 | int cwidth = term->fwidth; |
1408 | int cwidth = term->fwidth; |
1409 | FcChar32 chr = *text++; len--; |
1409 | FcChar32 chr = *text++; len--; |
1410 | |
1410 | |
1411 | // handle non-bmp chars when text_t is 16 bit |
|
|
1412 | #if ENABLE_COMBINING && !UNICODE_3 |
|
|
1413 | if (ecb_expect_false (IS_COMPOSE (chr))) |
|
|
1414 | if (compose_char *cc = rxvt_composite [chr]) |
|
|
1415 | if (cc->c2 == NOCHAR) |
|
|
1416 | chr = cc->c1; |
|
|
1417 | #endif |
|
|
1418 | |
|
|
1419 | while (len && *text == NOCHAR) |
1411 | while (len && *text == NOCHAR) |
1420 | text++, len--, cwidth += term->fwidth; |
1412 | text++, len--, cwidth += term->fwidth; |
1421 | |
1413 | |
1422 | if (chr != ' ') // skip spaces |
1414 | if (chr != ' ') // skip spaces |
1423 | { |
1415 | { |
|
|
1416 | // handle non-bmp chars when text_t is 16 bit |
|
|
1417 | #if ENABLE_COMBINING && !UNICODE_3 |
|
|
1418 | if (ecb_expect_false (IS_COMPOSE (chr))) |
|
|
1419 | if (compose_char *cc = rxvt_composite [chr]) |
|
|
1420 | if (cc->c2 == NOCHAR) |
|
|
1421 | chr = cc->c1; |
|
|
1422 | #endif |
|
|
1423 | |
1424 | #if 0 |
1424 | #if 0 |
1425 | FT_UInt glyphs [decltype (exp)::max_size]; |
1425 | FT_UInt glyphs [decltype (exp)::max_size]; |
1426 | |
1426 | |
1427 | for (int i = 0; i < nchrs; ++i) |
1427 | for (int i = 0; i < nchrs; ++i) |
1428 | glyphs [i] = XftCharIndex (disp, f, chrs [i]); |
1428 | glyphs [i] = XftCharIndex (disp, f, chrs [i]); |
… | |
… | |
1443 | ep->x = x_; |
1443 | ep->x = x_; |
1444 | ep->y = y_ + ascent; |
1444 | ep->y = y_ + ascent; |
1445 | |
1445 | |
1446 | // the xft font cell might differ from the terminal font cell, |
1446 | // the xft font cell might differ from the terminal font cell, |
1447 | // in which case we use the average between the two. |
1447 | // in which case we use the average between the two. |
1448 | ep->x += cwidth - extents.xOff >> 1; |
1448 | ep->x += extents.xOff ? cwidth - extents.xOff >> 1 : 0; |
1449 | |
1449 | |
1450 | // xft/freetype represent combining characters as characters with zero |
1450 | // xft/freetype represent combining characters as characters with zero |
1451 | // width rendered over the previous character with some fonts, while |
1451 | // width rendered over the previous character with some fonts, while |
1452 | // in other fonts, they are considered normal characters, while yet |
1452 | // in other fonts, they are considered normal characters, while yet |
1453 | // in other fonts, they are shifted all over the place. |
1453 | // in other fonts, they are shifted all over the place. |