diff options
-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 ea8a7a2..f342f7c 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, |