comparison src/gui_w32.c @ 179:7fd70926e2e1 v7.0055

updated for version 7.0055
author vimboss
date Fri, 04 Mar 2005 23:39:37 +0000
parents 8c60f65311fa
children 504c627f7474
comparison
equal deleted inserted replaced
178:4d53c2a2af94 179:7fd70926e2e1
1956 cells += cw; 1956 cells += cw;
1957 i += utfc_ptr2len_check_len(text + i, len - i); 1957 i += utfc_ptr2len_check_len(text + i, len - i);
1958 ++clen; 1958 ++clen;
1959 } 1959 }
1960 ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), 1960 ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
1961 foptions, pcliprect, unicodebuf, clen, unicodepdy); 1961 foptions, pcliprect, unicodebuf, clen, unicodepdy);
1962 len = cells; /* used for underlining */ 1962 len = cells; /* used for underlining */
1963 } 1963 }
1964 else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9) 1964 else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9)
1965 { 1965 {
1966 /* If we want to display codepage data, and the current CP is not the 1966 /* If we want to display codepage data, and the current CP is not the
1973 len = MultiByteToWideChar(enc_codepage, 1973 len = MultiByteToWideChar(enc_codepage,
1974 MB_PRECOMPOSED, 1974 MB_PRECOMPOSED,
1975 (char *)text, len, 1975 (char *)text, len,
1976 (LPWSTR)unicodebuf, unibuflen); 1976 (LPWSTR)unicodebuf, unibuflen);
1977 if (len != 0) 1977 if (len != 0)
1978 {
1979 /* Use unicodepdy to make characters fit as we expect, even
1980 * when the font uses different widths (e.g., bold character
1981 * is wider). */
1982 if (unicodepdy != NULL)
1983 {
1984 int i;
1985 int cw;
1986
1987 for (i = 0; i < len; ++i)
1988 {
1989 cw = utf_char2cells(unicodebuf[i]);
1990 if (cw > 2)
1991 cw = 1;
1992 unicodepdy[i] = cw * gui.char_width;
1993 }
1994 }
1978 ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), 1995 ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
1979 foptions, pcliprect, unicodebuf, len, NULL); 1996 foptions, pcliprect, unicodebuf, len, unicodepdy);
1997 }
1980 } 1998 }
1981 } 1999 }
1982 else 2000 else
1983 #endif 2001 #endif
1984 { 2002 {