diff options
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r-- | unix/tkUnixRFont.c | 15 |
1 files changed, 12 insertions, 3 deletions
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. |