*** empty log message ***
authorpcg <pcg>
Thu, 4 Dec 2003 00:43:26 +0000 (00:43 +0000)
committerpcg <pcg>
Thu, 4 Dec 2003 00:43:26 +0000 (00:43 +0000)
src/defaultfont.C
src/defaultfont.h

index 572e3e6ad10280fc8b4d12704b0c26c7c5a697cf..91a750b6e493efb02fb7a81f179c3cefa0abf425 100644 (file)
@@ -893,13 +893,15 @@ rxvt_fontset::realize_font (int i)
   if (fonts[i]->loaded)
     return true;
 
-  if (fonts[i]->load (height))
-    return fonts[i]->loaded = true;
+  fonts[i]->loaded = true;
 
-  delete fonts[i];
-  fonts.erase (fonts.begin () + i);
+  if (!fonts[i]->load (height))
+    {
+      fonts[i]->cs = CS_UNKNOWN;
+      return false;
+    }
 
-  return false;
+  return true;
 }
 
 void
@@ -946,15 +948,10 @@ rxvt_fontset::find_font (uint32_t unicode)
             goto next_font;
 
           if (!realize_font (i))
-            {
-              --i;
-              goto next_font;
-            }
-
-          //printf ("added font %s for %04lx\n", f->name, unicode);
+            goto next_font;
         }
 
-      if (f->has_codepoint (unicode))
+      if (f->cs != CS_UNKNOWN && f->has_codepoint (unicode))
         return i;
 
     next_font:
@@ -962,6 +959,7 @@ rxvt_fontset::find_font (uint32_t unicode)
         {
           fonts.push_back (new_font (fallback->name, fallback->cs));
           fallback++;
+          i = 0;
         }
     }
 
index f5d7d2b07d985336e752d716b38d7ddb8350a3e0..b59404cfa23397afebe219035e7cd520ef02ec60 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: defaultfont.h,v 1.5 2003-11-25 15:25:17 pcg Exp $
+ * $Id: defaultfont.h,v 1.6 2003-12-04 00:43:26 pcg Exp $
  */
 
 #ifndef _DEFAULTFONT_H_
@@ -30,7 +30,7 @@ struct rxvt_font {
 
   char *name;
   codeset cs;
-  bool loaded;
+  bool loaded; // wether we tried loading it before (not wether it's loaded)
 
   // managed by the font object
   bool prop; // wether this is a proportional font or has other funny characteristics