Laurence J. Lane wrote:
raster wrote this patch to provide the "fixed" font if the etheme's default font is not available. For an example scenario, start e with
brushedmetal-tigert and a font server that does not have the Lucida
font. e starts with no titlebar/menu/dialogbox/whatver fonts. The
"fixed" font or whateveryoucallthenonfixed font (scaled?) is probably always there.



------------------------------------------------------------------------


--- enlightenment-0.16.6-upstream/src/text.c 2003-11-05 12:58:51.000000000 -0500
+++ enlightenment-0.16.6-debian/src/text.c 2003-11-06 05:06:03.000000000 -0500
@@ -203,6 +203,13 @@
/* EDBUG_RETURN_; */
}
if (!ts->xfontset)
+ {
+ ts->xfontset =
+ XCreateFontSet(disp, "fixed", &missing_list, &missing_cnt,
+ &def_str);
+ if (missing_cnt)
+ XFreeStringList(missing_list);
+ }
EDBUG_RETURN_;
ts->xfontset_ascent = 0;
@@ -210,6 +217,8 @@
for (i = 0; i < font_cnt; i++)
ts->xfontset_ascent = MAX(fs[i]->ascent, ts->xfontset_ascent);
}
+ if (!ts->xfont)
+ ts->xfont = XLoadQueryFont(disp, "fixed");
}
EDBUG_RETURN_;
}

Something is not right. This patch leaves some lines of code after EDBUG_RETURN_ unreachable.

How about doing as in the attached one?

/Kim
--- src/text.c  5 Nov 2003 17:24:46 -0000       1.23
+++ src/text.c  12 Nov 2003 19:50:52 -0000
@@ -202,14 +202,27 @@
                  XFreeStringList(missing_list);
                  /* EDBUG_RETURN_; */
               }
+
             if (!ts->xfontset)
-               EDBUG_RETURN_;
+              {
+                 ts->xfontset =
+                    XCreateFontSet(disp, "fixed", &missing_list, &missing_cnt,
+                                   &def_str);
+                 if (missing_cnt)
+                    XFreeStringList(missing_list);
+              }
 
-            ts->xfontset_ascent = 0;
-            font_cnt = XFontsOfFontSet(ts->xfontset, &fs, &fn);
-            for (i = 0; i < font_cnt; i++)
-               ts->xfontset_ascent = MAX(fs[i]->ascent, ts->xfontset_ascent);
+            if (ts->xfontset)
+              {
+                 ts->xfontset_ascent = 0;
+                 font_cnt = XFontsOfFontSet(ts->xfontset, &fs, &fn);
+                 for (i = 0; i < font_cnt; i++)
+                    ts->xfontset_ascent =
+                       MAX(fs[i]->ascent, ts->xfontset_ascent);
+              }
          }
+       if (!ts->xfont)
+          ts->xfont = XLoadQueryFont(disp, "fixed");
      }
    EDBUG_RETURN_;
 }

Reply via email to