r37893 - trunk/gui/skin/font.c
Author: ib Date: Thu Aug 25 14:39:03 2016 New Revision: 37893 Log: Lift the limitation of 256 characters in font description files. When the memory reserved for 8-bit characters has been used up, don't start skipping entries in the font description file, but dynamically allocate memory to process further. That way there is no longer any limitation (besides available memory) on the number of entries in a font description file. This closes Trac #2303. Modified: trunk/gui/skin/font.c Modified: trunk/gui/skin/font.c ============================================================================== --- trunk/gui/skin/font.c Thu Aug 25 14:31:49 2016 (r37892) +++ trunk/gui/skin/font.c Thu Aug 25 14:39:03 2016 (r37893) @@ -232,7 +232,13 @@ int fntRead(char *path, char *fname) cutStr(item, item, '"', 1); if (item[0] & 0x80) { - for (i = 0; i < Fonts[id]->extra_chrs; i++) { + for (i = 0;; i++) { + if (i == Fonts[id]->extra_chrs) { + if (!fntAllocChr(Fonts[id], EXTRA_CHRS) || + !fntAllocBit8Chr(Fonts[id], EXTRA_CHRS)) + break; + } + if (!(Fonts[id]->bit8_chr + i * UTF8LENGTH)[0]) { strncpy(Fonts[id]->bit8_chr + i * UTF8LENGTH, item, UTF8LENGTH); break;
participants (1)
-
ib