summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-13 17:54:06 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-13 17:54:06 (GMT)
commit744eaf4fe647fb18ea2bfcfae3371a301136db47 (patch)
tree3eaccf823f5b289234015c541385d6d53faf8429 /unix
parentded849032ef8207aae7f1a111b78041de49fffcf (diff)
downloadtk-744eaf4fe647fb18ea2bfcfae3371a301136db47.zip
tk-744eaf4fe647fb18ea2bfcfae3371a301136db47.tar.gz
tk-744eaf4fe647fb18ea2bfcfae3371a301136db47.tar.bz2
increase FONATMAP_PAGES so it can hold 3 planes of Unicode characters in stead of just one. This appears to be one cause for crashes.
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixFont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 41b2df1..c1b1b14 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -37,8 +37,8 @@ static const char *const encodingList[] = {
#define FONTMAP_SHIFT 10
-#define FONTMAP_PAGES (1 << (sizeof(Tcl_UniChar)*8 - FONTMAP_SHIFT))
#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
+#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE)
typedef struct FontFamily {
struct FontFamily *nextPtr; /* Next in list of all known font families. */
@@ -1972,11 +1972,11 @@ FindSubFontForChar(
SubFont *subFontPtr;
Tcl_DString ds;
- if (FontMapLookup(&fontPtr->subFontArray[0], ch)) {
- return &fontPtr->subFontArray[0];
+ if (ch > 0x30000) {
+ ch = 0xfffd;
}
- for (i = 1; i < fontPtr->numSubFonts; i++) {
+ for (i = 0; i < fontPtr->numSubFonts; i++) {
if (FontMapLookup(&fontPtr->subFontArray[i], ch)) {
return &fontPtr->subFontArray[i];
}