} Fontcache;
 
 /* Fontcache is an array now. A new font will be appended to the array. */
-static Fontcache frc[16];
+static Fontcache *frc = NULL;
 static int frclen = 0;
+static int frccap = 0;
 static char *usedfont = NULL;
 static double usedfontsize = 0;
 static double defaultfontsize = 0;
                                        fcpattern, &fcres);
 
                        /*
-                        * Overwrite or create the new cache entry.
+                        * Allocate memory for the new cache entry.
                         */
-                       if (frclen >= LEN(frc)) {
-                               frclen = LEN(frc) - 1;
-                               XftFontClose(xw.dpy, frc[frclen].font);
-                               frc[frclen].unicodep = 0;
+                       if (frclen >= frccap) {
+                               frccap += 16;
+                               if (!frc)
+                                       frc = xmalloc(frccap * sizeof(Fontcache));
+                               else
+                                       frc = xrealloc(frc, frccap * sizeof(Fontcache));
                        }
 
                        frc[frclen].font = XftFontOpenPattern(xw.dpy,