summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixFont.c6
-rw-r--r--unix/tkUnixRFont.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index a6826b5..b10fddd 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -35,9 +35,13 @@ static const char *const encodingList[] = {
* family": the foundry, face name, and charset.
*/
+#if TCL_UTF_MAX > 3
+#define FONTMAP_SHIFT 12
+#define FONTMAP_PAGES (1 << (21 - FONTMAP_SHIFT))
+#else
#define FONTMAP_SHIFT 10
-
#define FONTMAP_PAGES (1 << (sizeof(Tcl_UniChar)*8 - FONTMAP_SHIFT))
+#endif
#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
typedef struct FontFamily {
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) {