diff options
author | pspjuth <peter.spjuth@gmail.com> | 2017-01-25 22:10:55 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2017-01-25 22:10:55 (GMT) |
commit | cc1dd14693b02bd80d03b172e53f6ea747af914b (patch) | |
tree | 805a038a8d0ae7adb284384f875e4bd9950760e7 | |
parent | b7abdd1712d5b034f6d4e54a5c2d9cf342bec51d (diff) | |
parent | bc6a00f386a42a918f7ea3907a7899419680c3d4 (diff) | |
download | tk-cc1dd14693b02bd80d03b172e53f6ea747af914b.zip tk-cc1dd14693b02bd80d03b172e53f6ea747af914b.tar.gz tk-cc1dd14693b02bd80d03b172e53f6ea747af914b.tar.bz2 |
Fix [140ea8ab38]: Long text lines are not drawn on Windows.
-rw-r--r-- | win/tkWinFont.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 4121cc3..9a32227 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -1455,7 +1455,15 @@ MultiFontTextOut( for (p = source; p < end; ) { next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); - if (thisSubFontPtr != lastSubFontPtr) { + + /* + * The drawing API has a limit of 32767 pixels in one go. + * To avoid spending time on a rare case we do not measure each char, + * instead we limit to drawing chunks of 200 bytes since that works + * well in practice. + */ + + if ((thisSubFontPtr != lastSubFontPtr) || (p-source > 200)) { if (p > source) { familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, |