#include #include #include "basics.h" /* pfopen, my_fopen(), fatal() */ #include "filenames.h" /* my_fopen() */ #include "psearch.h" /* path() */ #include "PSres.h" #define PSRESOURCEPATH "." main() { char *fontName = "Utopia-Regular", *psrespath; char *encoding = "TeXBase1Encoding"; char **names, **files, **types; int count; pfopen = my_fopen; psrespath = path(PSRESOURCEPATH, getenv("PSRESOURCEPATH")); count = ListPSResourceTypes(psrespath, NULL, &types); if (count == 0) { printf("No TeX PostScript resource database found\n"); printf("Check PSRESOURCEPATH or create databases (See mkpsres(1).)\n"); exit(1); } else { printf("The following resource types were found:\n"); while (count-- > 0) { printf("\t%s\n", *types++); } } count = ListPSResourceFiles(psrespath, NULL, "FontOutline", fontName, &names, &files); if (count == 0) printf("No outline for %s found\n", fontName); else { printf("The following outline fonts for %s were found:\n", fontName); while (count-- > 0) { printf("\t%s\n", *files++); } } count = ListPSResourceFiles(psrespath, NULL, "FontAFM", fontName, &names, &files); if (count == 0) printf("No AFM for %s found\n", fontName); else { printf("The following AFM files for %s were found:\n", fontName); while (count-- > 0) { printf("\t%s\n", *files++); } } count = ListPSResourceFiles(psrespath, NULL, "Encoding", encoding, &names, &files); if (count == 0) printf("No encoding for %s found\n", encoding); else { printf("The following encodings for %s were found:\n", encoding); while (count-- > 0) { printf("\t%s\n", *files++); } } exit(0); }