diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-29 12:03:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-29 12:03:43 (GMT) |
commit | 4c158f250ca869188d30dcf7628676f0b0de236f (patch) | |
tree | a7130678e7d225c7e0c128f344c6f24f961b670d /win/tkWinFont.c | |
parent | 9fd7a0895dc0c93d3796ad72eccdc631d21f54ac (diff) | |
parent | af17312e4d83e5ea367efbed4baf6fa32a067aa4 (diff) | |
download | tk-4c158f250ca869188d30dcf7628676f0b0de236f.zip tk-4c158f250ca869188d30dcf7628676f0b0de236f.tar.gz tk-4c158f250ca869188d30dcf7628676f0b0de236f.tar.bz2 |
Fix [6c0d7aec6713ab6a7c3e12dff7f26bff4679bc9d|6c0d7aec67]: unicode text input Windows 8. Added some test-cases using the "font actual" command.
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r-- | win/tkWinFont.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 10ea1b9..47c4c3c 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -828,7 +828,7 @@ Tk_MeasureChars( HFONT oldFont; WinFont *fontPtr; int curX, moretomeasure; - Tcl_UniChar ch; + int ch; SIZE size; FontFamily *familyPtr; Tcl_DString runString; @@ -859,7 +859,7 @@ Tk_MeasureChars( start = source; end = start + numBytes; for (p = start; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; @@ -921,7 +921,7 @@ Tk_MeasureChars( familyPtr = lastSubFontPtr->familyPtr; Tcl_DStringInit(&runString); for (p = start; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); Tcl_UtfToExternal(NULL, familyPtr->encoding, p, (int) (next - p), 0, NULL, buf, sizeof(buf), NULL, &dstWrote, NULL); @@ -970,13 +970,13 @@ Tk_MeasureChars( */ const char *lastWordBreak = NULL; - Tcl_UniChar ch2; + int ch2; end = p; p = source; ch = ' '; while (p < end) { - next = p + Tcl_UtfToUniChar(p, &ch2); + next = p + TkUtfToUniChar(p, &ch2); if ((ch != ' ') && (ch2 == ' ')) { lastWordBreak = p; } @@ -1443,7 +1443,7 @@ MultiFontTextOut( * string when drawing. */ double angle) { - Tcl_UniChar ch; + int ch; SIZE size; HFONT oldFont; FontFamily *familyPtr; @@ -1458,7 +1458,7 @@ MultiFontTextOut( end = source + numBytes; for (p = source; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { if (p > source) { @@ -1940,7 +1940,8 @@ FindSubFontForChar( SubFont *subFontPtr; Tcl_DString ds; - if (ch < BASE_CHARS) { + + if ((ch < BASE_CHARS) || (ch >= 0x10000)) { return &fontPtr->subFontArray[0]; } |