| 1593 | #endif |
| 1594 | |
| 1595 | static void |
| 1596 | X11_draw_image_string( |
| 1597 | Display *display, |
| 1598 | Drawable d, |
| 1599 | GC ggc, |
| 1600 | int x, int y, |
| 1601 | const X11_map_symbol *string, int length) |
| 1602 | { |
| 1603 | #ifdef ENHANCED_SYMBOLS |
| 1604 | /* This doesn't support the supplementary planes. The basic Xlib seems |
| 1605 | to load only PCF fonts, and these cannot contain characters encoded |
| 1606 | above 0xFFFF. */ |
| 1607 | XChar2b wstr[COLNO+1]; |
| 1608 | int i; |
| 1609 | |
| 1610 | if (length > COLNO) { |
| 1611 | length = COLNO; |
| 1612 | } |
| 1613 | for (i = 0; i < length; ++i) { |
| 1614 | uint32 ch = string[i]; |
| 1615 | if (ch > 0xFFFF || (0xD800 <= ch && ch <= 0xDFFF)) { |
| 1616 | ch = 0xFFFD; |
| 1617 | } |
| 1618 | wstr[i].byte1 = ch >> 8; |
| 1619 | wstr[i].byte2 = ch & 0xFF; |
| 1620 | } |
| 1621 | XDrawImageString16(display, d, ggc, x, y, wstr, length); |
| 1622 | #else /* !ENHANCED_SYMBOLS */ |
| 1623 | XDrawImageString(display, d, ggc, x, y, (char *) string, length); |
| 1624 | #endif /* ?ENHANCED_SYMBOLS */ |
| 1625 | } |
| 1626 | |
| 1627 | /* Adjust the number of rows and columns on the given map window */ |
| 1628 | void |