summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixRFont.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-16 07:49:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-16 07:49:21 (GMT)
commit41d3c8f67e62fe307c46c91e5a42b71e39c59334 (patch)
tree0c7c6348e421d05be040ec77ef8a7200c85c391d /unix/tkUnixRFont.c
parent9759a4f9b6f61757dc505a923c07951e560e47a3 (diff)
downloadtk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.zip
tk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.tar.gz
tk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.tar.bz2
Patch from Christian Werner, for evaluation
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r--unix/tkUnixRFont.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 01bbb30..ee87657 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -54,6 +54,12 @@ typedef struct ThreadSpecificData {
Region clipRegion; /* The clipping region, or None. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+
+#if TCL_UTF_MAX == 4
+#define UtfToUniChar(src, chPtr) TkUtfToUniChar32(src, chPtr)
+#else
+#define UtfToUniChar(src, chPtr) Tcl_UtfToUniChar(src, chPtr)
+#endif
/*
* Package initialization:
@@ -668,9 +674,13 @@ Tk_MeasureChars(
curByte = 0;
sawNonSpace = 0;
while (numBytes > 0) {
+#if TCL_UTF_MAX == 4
+ int unichar;
+#else
Tcl_UniChar unichar;
+#endif
- clen = Tcl_UtfToUniChar(source, &unichar);
+ clen = UtfToUniChar(source, &unichar);
c = (FcChar32) unichar;
if (clen <= 0) {