- for (i = 0; i < len; i++)
- wbuf[i] = text[i];
-
- /* print Glyphs as they are, without Windows' Shaping*/
- general_textout(hdc, x, y - font_height * (lattr == LATTR_BOT) + text_adjust,
- &line_box, wbuf, len, IpDx, !(attr & TATTR_COMBINING));
-
- /* And the shadow bold hack. */
- if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
- SetBkMode(hdc, TRANSPARENT);
- ExtTextOutW(hdc, x - 1,
- y - font_height * (lattr ==
- LATTR_BOT) + text_adjust,
- ETO_CLIPPED, &line_box, wbuf, len, IpDx);
- }
+ for (i = 0; i < len; i++)
+ directbuf[i] = text[i] & 0xFF;
+
+ ExtTextOut(hdc, x + xoffset,
+ y - font_height * (lattr == LATTR_BOT) + text_adjust,
+ ETO_CLIPPED | (opaque ? ETO_OPAQUE : 0),
+ &line_box, directbuf, len, lpDx_maybe);
+ if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
+ SetBkMode(hdc, TRANSPARENT);
+
+ /* GRR: This draws the character outside its box and
+ * can leave 'droppings' even with the clip box! I
+ * suppose I could loop it one character at a time ...
+ * yuk.
+ *
+ * Or ... I could do a test print with "W", and use +1
+ * or -1 for this shift depending on if the leftmost
+ * column is blank...
+ */
+ ExtTextOut(hdc, x + xoffset - 1,
+ y - font_height * (lattr ==
+ LATTR_BOT) + text_adjust,
+ ETO_CLIPPED, &line_box, directbuf, len, lpDx_maybe);
+ }
+ } else {
+ /* And 'normal' unicode characters */
+ static WCHAR *wbuf = NULL;
+ static int wlen = 0;
+ int i;
+
+ if (wlen < len) {
+ sfree(wbuf);
+ wlen = len;
+ wbuf = snewn(wlen, WCHAR);
+ }
+
+ for (i = 0; i < len; i++)
+ wbuf[i] = text[i];
+
+ /* print Glyphs as they are, without Windows' Shaping*/
+ general_textout(hdc, x + xoffset,
+ y - font_height * (lattr==LATTR_BOT) + text_adjust,
+ &line_box, wbuf, len, lpDx,
+ opaque && !(attr & TATTR_COMBINING));
+
+ /* And the shadow bold hack. */
+ if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
+ SetBkMode(hdc, TRANSPARENT);
+ ExtTextOutW(hdc, x + xoffset - 1,
+ y - font_height * (lattr ==
+ LATTR_BOT) + text_adjust,
+ ETO_CLIPPED, &line_box, wbuf, len, lpDx_maybe);
+ }
+ }
+
+ /*
+ * If we're looping round again, stop erasing the background
+ * rectangle.
+ */
+ SetBkMode(hdc, TRANSPARENT);
+ opaque = FALSE;