summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorculler <culler>2019-07-01 20:04:13 (GMT)
committerculler <culler>2019-07-01 20:04:13 (GMT)
commit0b5d89c392a4d6e49fabdf2f4be45ee6ae561545 (patch)
tree872ae23a58fda232931ced16a79def4f9862dae1 /unix
parentfb38383a729f6ef159fb0f6a89f6b269d9331e5e (diff)
parent4d37dc35b57252cbd904008b843dce0354c01669 (diff)
downloadtk-0b5d89c392a4d6e49fabdf2f4be45ee6ae561545.zip
tk-0b5d89c392a4d6e49fabdf2f4be45ee6ae561545.tar.gz
tk-0b5d89c392a4d6e49fabdf2f4be45ee6ae561545.tar.bz2
merge 8.6
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixFont.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 96635b4..dc80807 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -186,14 +186,7 @@ static EncodingAlias encodingAliases[] = {
{"tis620", "tis620*"},
{"ksc5601", "ksc5601*"},
{"dingbats", "*dingbats"},
-#ifdef WORDS_BIGENDIAN
- {"unicode", "iso10646-1"},
-#else
- /*
- * ucs-2be is needed if native order isn't BE.
- */
{"ucs-2be", "iso10646-1"},
-#endif
{NULL, NULL}
};
@@ -246,7 +239,6 @@ static unsigned RankAttributes(FontAttributes *wantPtr,
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
-#ifndef WORDS_BIGENDIAN
static int Ucs2beToUtfProc(ClientData clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
@@ -255,7 +247,6 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
-#endif
/*
*-------------------------------------------------------------------------
@@ -320,11 +311,12 @@ TkpFontPkgInit(
{
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- Tcl_EncodingType type;
SubFont dummy;
int i;
+ Tcl_Encoding ucs2;
if (tsdPtr->controlFamily.encoding == NULL) {
+ Tcl_EncodingType type;
type.encodingName = "X11ControlChars";
type.toUtfProc = ControlUtfProc;
type.fromUtfProc = ControlUtfProc;
@@ -343,20 +335,18 @@ TkpFontPkgInit(
FontMapInsert(&dummy, i + 0x80);
}
-#ifndef WORDS_BIGENDIAN
/*
* UCS-2BE is unicode (UCS-2) in big-endian format. Define this if
- * native order isn't BE. It is used in iso10646 fonts.
+ * if it doesn't exist yet. It is used in iso10646 fonts.
*/
- type.encodingName = "ucs-2be";
- type.toUtfProc = Ucs2beToUtfProc;
- type.fromUtfProc = UtfToUcs2beProc;
- type.freeProc = NULL;
- type.clientData = NULL;
- type.nullSize = 2;
- Tcl_CreateEncoding(&type);
-#endif
+ ucs2 = Tcl_GetEncoding(NULL, "ucs-2be");
+ if (ucs2 == NULL) {
+ Tcl_EncodingType type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2};
+ Tcl_CreateEncoding(&type);
+ } else {
+ Tcl_FreeEncoding(ucs2);
+ }
Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL);
}
}
@@ -459,7 +449,6 @@ ControlUtfProc(
return result;
}
-#ifndef WORDS_BIGENDIAN
/*
*-------------------------------------------------------------------------
*
@@ -632,7 +621,6 @@ UtfToUcs2beProc(
*dstCharsPtr = numChars;
return result;
}
-#endif /* WORDS_BIGENDIAN */
/*
*---------------------------------------------------------------------------