… | |
… | |
313 | if (unicode >= 0x2500 && unicode <= 0x259f && |
313 | if (unicode >= 0x2500 && unicode <= 0x259f && |
314 | !term->option (Opt_skipBuiltinGlyphs)) |
314 | !term->option (Opt_skipBuiltinGlyphs)) |
315 | return true; |
315 | return true; |
316 | #endif |
316 | #endif |
317 | |
317 | |
318 | if (IS_COMPOSE (unicode)) |
318 | // we do not check for IS_COMPOSE here, as this would |
319 | return true; |
319 | // rob other fonts from taking over. |
320 | |
320 | |
321 | switch (unicode) |
321 | switch (unicode) |
322 | { |
322 | { |
323 | case ZERO_WIDTH_CHAR: |
323 | case ZERO_WIDTH_CHAR: |
324 | case NOCHAR: |
324 | case NOCHAR: |
… | |
… | |
442 | #else |
442 | #else |
443 | if (0) |
443 | if (0) |
444 | ; |
444 | ; |
445 | #endif |
445 | #endif |
446 | #if ENABLE_COMBINING |
446 | #if ENABLE_COMBINING |
447 | else if (IS_COMPOSE (t) && rxvt_composite[t]) |
447 | else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) |
448 | { |
448 | { |
449 | min_it (width, 2); // we only support wcwidth up to 2 |
449 | min_it (width, 2); // we only support wcwidth up to 2 |
450 | |
450 | |
451 | #if NOT_YET |
451 | #if NOT_YET |
452 | vector<text_t> chrs; |
452 | vector<text_t> chrs; |
… | |
… | |
1367 | bool |
1367 | bool |
1368 | rxvt_font_xft::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const |
1368 | rxvt_font_xft::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const |
1369 | { |
1369 | { |
1370 | careful = false; |
1370 | careful = false; |
1371 | |
1371 | |
|
|
1372 | #if ENABLE_COMBINING && !UNICODE_3 |
|
|
1373 | if (ecb_expect_false (IS_COMPOSE (unicode))) |
|
|
1374 | if (compose_char *cc = rxvt_composite[unicode]) |
|
|
1375 | if (cc->c2 == NOCHAR) |
|
|
1376 | unicode = cc->c1; |
|
|
1377 | #endif |
|
|
1378 | |
1372 | if (!XftCharExists (term->dpy, f, unicode)) |
1379 | if (!XftCharExists (term->dpy, f, unicode)) |
1373 | return false; |
1380 | return false; |
1374 | |
1381 | |
1375 | if (!prop || prop->width == rxvt_fontprop::unset) |
1382 | if (!prop || prop->width == rxvt_fontprop::unset) |
1376 | return true; |
1383 | return true; |
… | |
… | |
1422 | |
1429 | |
1423 | while (len) |
1430 | while (len) |
1424 | { |
1431 | { |
1425 | int cwidth = term->fwidth; |
1432 | int cwidth = term->fwidth; |
1426 | FcChar32 fc = *text++; len--; |
1433 | FcChar32 fc = *text++; len--; |
|
|
1434 | |
|
|
1435 | #if ENABLE_COMBINING && !UNICODE_3 |
|
|
1436 | if (ecb_expect_false (IS_COMPOSE (fc))) |
|
|
1437 | if (compose_char *cc = rxvt_composite[fc]) // should always be true, but better be safe than sorry |
|
|
1438 | fc = cc->c1; // c2 must be NOCHAR, as has_char handles it that way |
|
|
1439 | #endif |
1427 | |
1440 | |
1428 | while (len && *text == NOCHAR) |
1441 | while (len && *text == NOCHAR) |
1429 | text++, len--, cwidth += term->fwidth; |
1442 | text++, len--, cwidth += term->fwidth; |
1430 | |
1443 | |
1431 | if (fc != ' ') // skip spaces |
1444 | if (fc != ' ') // skip spaces |
… | |
… | |
1717 | } |
1730 | } |
1718 | |
1731 | |
1719 | int |
1732 | int |
1720 | rxvt_fontset::find_font_idx (unicode_t unicode) |
1733 | rxvt_fontset::find_font_idx (unicode_t unicode) |
1721 | { |
1734 | { |
1722 | if (unicode >= 1<<20) |
1735 | // this limits fmap size. it has to accomodate COMPOSE_HI when UNICODE_3 |
|
|
1736 | if (unicode > 0x1fffff) |
1723 | return 0; |
1737 | return 0; |
1724 | |
1738 | |
1725 | unicode_t hi = unicode >> 8; |
1739 | unicode_t hi = unicode >> 8; |
1726 | |
1740 | |
1727 | if (hi < fmap.size () |
1741 | if (hi < fmap.size () |
… | |
… | |
1759 | } |
1773 | } |
1760 | |
1774 | |
1761 | next_font: |
1775 | next_font: |
1762 | if (i == fonts.size () - 1) |
1776 | if (i == fonts.size () - 1) |
1763 | { |
1777 | { |
|
|
1778 | // compose characters are handled by the default font, unless another font takes over |
|
|
1779 | // we do not go via the fallback list for speed reasons. |
|
|
1780 | if (IS_COMPOSE (unicode)) |
|
|
1781 | return 0; |
|
|
1782 | |
1764 | if (fallback->name) |
1783 | if (fallback->name) |
1765 | { |
1784 | { |
1766 | // search through the fallback list |
1785 | // search through the fallback list |
1767 | push_font (new_font (fallback->name, fallback->cs)); |
1786 | push_font (new_font (fallback->name, fallback->cs)); |
1768 | fallback++; |
1787 | fallback++; |