diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-03-04 23:39:37 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-03-04 23:39:37 +0000 |
commit | 19a09a189379659b917cf5ccff78f3e5ec061015 (patch) | |
tree | 806d594bf7af04ef956c0c96ad64adfcd96325dc /src/gui_w32.c | |
parent | 7383034c0ab657158c4c69146254beffdea4859e (diff) | |
download | vim-git-19a09a189379659b917cf5ccff78f3e5ec061015.tar.gz |
updated for version 7.0055v7.0055
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r-- | src/gui_w32.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index d6d37c4d1..230836247 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1958,7 +1958,7 @@ gui_mch_draw_string( ++clen; } ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), - foptions, pcliprect, unicodebuf, clen, unicodepdy); + foptions, pcliprect, unicodebuf, clen, unicodepdy); len = cells; /* used for underlining */ } else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9) @@ -1975,8 +1975,26 @@ gui_mch_draw_string( (char *)text, len, (LPWSTR)unicodebuf, unibuflen); if (len != 0) + { + /* Use unicodepdy to make characters fit as we expect, even + * when the font uses different widths (e.g., bold character + * is wider). */ + if (unicodepdy != NULL) + { + int i; + int cw; + + for (i = 0; i < len; ++i) + { + cw = utf_char2cells(unicodebuf[i]); + if (cw > 2) + cw = 1; + unicodepdy[i] = cw * gui.char_width; + } + } ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), - foptions, pcliprect, unicodebuf, len, NULL); + foptions, pcliprect, unicodebuf, len, unicodepdy); + } } } else |