… | |
… | |
1442 | ep->glyph = glyph; |
1442 | ep->glyph = glyph; |
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 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 += cwidth - extents.xOff >> 1; |
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. |
1454 | // we handle the first two cases by keying off on xOff being 0 |
1454 | // we handle the first two cases by keying off on xOff being 0 |
1455 | // for zero-width chars. normally, we would add extents.xOff |
1455 | // for zero-width chars. normally, we would add extents.xOff |
1456 | // of the base chaarcter here, but we don't have that, so we use cwidth. |
1456 | // of the base character here, but we don't have that, so we use cwidth. |
1457 | ep->x += extents.xOff ? 0 : cwidth; |
1457 | ep->x += extents.xOff ? 0 : cwidth; |
1458 | |
1458 | |
1459 | ++ep; |
1459 | ++ep; |
1460 | } |
1460 | } |
1461 | |
1461 | |