summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-19 16:25:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-19 16:25:29 (GMT)
commit13b2c628195ebf4fa696dbfe3eaa54e95b3cc529 (patch)
tree2e1457468f29e0716c78635ffac3fb31973f9541 /unix
parentb9b549c629dec05a3812bdd812dca3688c1f5ba9 (diff)
parent2e563e6660d0175319b9b2d9abdb240599c2cd92 (diff)
downloadtk-13b2c628195ebf4fa696dbfe3eaa54e95b3cc529.zip
tk-13b2c628195ebf4fa696dbfe3eaa54e95b3cc529.tar.gz
tk-13b2c628195ebf4fa696dbfe3eaa54e95b3cc529.tar.bz2
Merge 8.6
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixFont.c4
-rw-r--r--unix/tkUnixRFont.c15
2 files changed, 14 insertions, 5 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index d352c16..9a8d1f7 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -63,7 +63,7 @@ typedef struct FontFamily {
/* Two-level sparse table used to determine
* quickly if the specified character exists.
* As characters are encountered, more pages
- * in this table are dynamically alloced. The
+ * in this table are dynamically allocated. The
* contents of each page is a bitmask
* consisting of FONTMAP_BITSPERPAGE bits,
* representing whether this font can be used
@@ -520,7 +520,7 @@ Ucs2beToUtfProc(
* UCS-2BE. We know this is an LE->BE swap.
*/
- dst += TkUniCharToUtf(htons(*((short *)src)), dst);
+ dst += Tcl_UniCharToUtf(htons(*((short *)src)), dst);
src += 2 /* sizeof(UCS-2) */;
}
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index bca193a..e69dab0 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -74,6 +74,15 @@ static Tcl_ThreadDataKey dataKey;
*-------------------------------------------------------------------------
*/
+
+static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes)
+{
+ if (numBytes >= 6) {
+ return TkUtfToUniChar(source, (int *)c);
+ }
+ return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes);
+}
+
void
TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
@@ -897,7 +906,7 @@ Tk_DrawChars(
XftFont *ftFont;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1037,7 +1046,7 @@ TkDrawAngledChars(
XftFont *ftFont;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1141,7 +1150,7 @@ TkDrawAngledChars(
XftFont *ftFont, *ft0Font;
FcChar32 c;
- clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
+ clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.