summaryrefslogtreecommitdiffstats
path: root/win/tkWinFont.c
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2017-01-25 22:08:59 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2017-01-25 22:08:59 (GMT)
commitbc6a00f386a42a918f7ea3907a7899419680c3d4 (patch)
treea406cd822ff589ac563a528c8dcb1da18bf60dde /win/tkWinFont.c
parent04dad740091d27ad1d2aa62d7256ba321d875cf4 (diff)
parent66e41a71e3b7254f83641c7a1d512bfa94c45d40 (diff)
downloadtk-bc6a00f386a42a918f7ea3907a7899419680c3d4.zip
tk-bc6a00f386a42a918f7ea3907a7899419680c3d4.tar.gz
tk-bc6a00f386a42a918f7ea3907a7899419680c3d4.tar.bz2
Fix [140ea8ab38]: Long text lines are not drawn on Windows.
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r--win/tkWinFont.c10
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,