summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2017-01-25 22:05:51 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2017-01-25 22:05:51 (GMT)
commit66e41a71e3b7254f83641c7a1d512bfa94c45d40 (patch)
treefcfa51170246e6afb873a5dff192fa9fc7b126f0 /win
parentebb2c5a3dbf48abcc99a56379e0924f43c594285 (diff)
downloadtk-66e41a71e3b7254f83641c7a1d512bfa94c45d40.zip
tk-66e41a71e3b7254f83641c7a1d512bfa94c45d40.tar.gz
tk-66e41a71e3b7254f83641c7a1d512bfa94c45d40.tar.bz2
Fix [140ea8ab38]: Long text lines are not drawn on Windows.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinFont.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index f209716..1292772 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1307,7 +1307,15 @@ MultiFontTextOut(
for (p = source; p < end; ) {
next = p + Tcl_UtfToUniChar(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,