+ if(!db || !fi) {
+ fprintf(stderr, "Couldn't create temporary file in /tmp/\n");
+ exit(1);
+ }
+ t1searchpath[0] = 0;
+#ifdef HAVE_DIRENT_H
+ sprintf(buf, "%s/fonts",SWFTOOLS_DATADIR);
+ // pass 1
+ addfontdir(0, buf, &numfonts, 0);
+ for(t=0;t<fontpathpos;t++) {
+ addfontdir(0, fontpaths[t], &numfonts,0);
+ }
+ fprintf(db, "%d\n", numfonts);
+ // pass 2
+ addfontdir(db, buf, 0, t1searchpath);
+ for(t=0;t<fontpathpos;t++) {
+ addfontdir(db, fontpaths[t], 0, t1searchpath);
+ }
+#else
+/* This is a workaround. The correct way would be to
+ get directory listings working on all systems.
+*/
+ strcpy(t1searchpath, SWFTOOLS_DATADIR);
+ strcat(t1searchpath, "/fonts");
+ fprintf(db, "14\n");
+ fprintf(db, "n021003l.afm\n");
+ fprintf(db, "n021023l.afm\n");
+ fprintf(db, "n021004l.afm\n");
+ fprintf(db, "n021024l.afm\n");
+ fprintf(db, "n019003l.afm\n");
+ fprintf(db, "n019023l.afm\n");
+ fprintf(db, "n019004l.afm\n");
+ fprintf(db, "n019024l.afm\n");
+ fprintf(db, "n022003l.afm\n");
+ fprintf(db, "n022023l.afm\n");
+ fprintf(db, "n022004l.afm\n");
+ fprintf(db, "n022024l.afm\n");
+ fprintf(db, "s050000l.afm\n");
+ fprintf(db, "d050000l.afm\n");
+#endif
+
+ fprintf(fi, "FONTDATABASE=/tmp/FontDataBase\n");
+ fprintf(fi, "ENCODING=%s:.\n", t1searchpath);
+ fprintf(fi, "AFM=%s:.\n", t1searchpath);
+ fprintf(fi, "TYPE1=%s:.\n", t1searchpath);