summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixRFont.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-09-30 14:45:49 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-09-30 14:45:49 (GMT)
commit075e60b53e49033f2d3caac1d5a78cde953bc200 (patch)
tree9b0dfd67ed3f8c3c3fadde83835e0f4e28015cca /unix/tkUnixRFont.c
parent4a512ba7ce51ac113fe88713a0cab5e1fdae2279 (diff)
downloadtk-075e60b53e49033f2d3caac1d5a78cde953bc200.zip
tk-075e60b53e49033f2d3caac1d5a78cde953bc200.tar.gz
tk-075e60b53e49033f2d3caac1d5a78cde953bc200.tar.bz2
Fix [6437e8d00d]: font-24.5 test fails on macOS and Linux. This is the fix for Linux, with Xft enabled (the default).
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r--unix/tkUnixRFont.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 8e0ce55..70aebfa 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -711,9 +711,19 @@ Tk_MeasureChars(
(flags & TK_AT_LEAST_ONE && curByte == 0)) {
curX = newX;
curByte = newByte;
- } else if (flags & TK_WHOLE_WORDS && termX != 0) {
- curX = termX;
- curByte = termByte;
+ } else if (flags & TK_WHOLE_WORDS) {
+ if ((flags & TK_AT_LEAST_ONE) && (termX == 0)) {
+ /*
+ * No space was seen before reaching the right
+ * of the allotted maxLength space, i.e. no word
+ * boundary. Return the string that fills the
+ * allotted space, without overfill.
+ * curX and curByte are already the right ones:
+ */
+ } else {
+ curX = termX;
+ curByte = termByte;
+ }
}
break;
}