rem: font->font_name().cc());
add: font->font_name().c_str());
context: main(int argc, char **argv){    PsresDatabase *psres = new PsresDatabase;    psres->add_psres_path(getenv("PSRESOURCEPATH"), 0, false);      Clp_Parser *clp =	Clp_NewParser(argc, argv, sizeof(options) / sizeof(options[0]), options);    program_name = Clp_ProgramName(clp);      ErrorHandler *errh = ErrorHandler::static_initialize(new FileErrorHandler(stderr));    const char *output_file = 0;      while (1) {	int opt = Clp_Next(clp);	switch (opt) {      	  case OUTPUT_OPT:	    if (output_file)		errh->fatal("output file already specified");	    output_file = clp->arg;	    break;      	  case VERSION_OPT:	    printf("t1testpage (LCDF typetools) %s\n", VERSION);	    printf("Copyright (C) 1999-2003 Eddie Kohler\n\This is free software; see the source for copying conditions.\n\There is NO warranty, not even for merchantability or fitness for a\n\particular purpose.\n");	    exit(0);	    break;      	  case HELP_OPT:	    usage();	    exit(0);	    break;      	  case Clp_NotOption:	    if (font)		errh->fatal("font already specified");	    do_file(clp->arg, psres, errh);	    break;      	  case Clp_Done:	    goto done;      	  case Clp_BadOption:	    usage_error(errh, 0);	    break;      	  default:	    break;      	}    }    done:    if (!font)	do_file(0, psres, errh);      FILE *outf;    if (!output_file || strcmp(output_file, "-") == 0)	outf = stdout;    else {	outf = fopen(output_file, "w");	if (!outf)	    errh->fatal("%s: %s", output_file, strerror(errno));    }    //font->undo_synthetic();      fprintf(outf, "%%!PS-Adobe-3.0\n%%%%LanguageLevel: 2\n%%%%BeginProlog\n");    fprintf(outf, "/magicstr 1 string def\n\/magicbox { %% row col char name encoding  magicbox  -\n\  5 3 roll 54 mul 36 add exch 54 mul neg 702 add moveto currentpoint\n\  .8 setgray 54 0 rlineto 0 54 rlineto -54 0 rlineto closepath stroke\n\  0 setgray moveto\n\  gsave /Helvetica 7 selectfont 3 1.5 rmoveto show grestore\n\  gsave /Helvetica 7 selectfont 3 45.5 rmoveto show grestore\n\  magicstr 0 3 -1 roll put\n\  magicstr stringwidth pop 54 sub -2 div 16 rmoveto magicstr show\n\} bind def\n");    Type1PFAWriter w(outf);    font->write(w);    fprintf(outf, "%%%%EndProlog\n");    // sort glyphs by name    // First, prepare names.    int gindex = 0;    char buf[7] = "Asmall";    for (int c = 0; c < 26; c++) {	buf[0] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[c];	glyph_order.insert(PermString(buf[0]), gindex++);	glyph_order.insert(PermString("abcdefghijklmnopqrstuvwxyz"[c]), gindex++);	glyph_order.insert(PermString(buf), gindex++);    }    glyph_order.insert("parenleft", gindex++);    glyph_order.insert("period", gindex++);    glyph_order.insert("comma", gindex++);    glyph_order.insert("hyphen", gindex++);    glyph_order.insert("ampersand", gindex++);    glyph_order.insert("semicolon", gindex++);    glyph_order.insert("exclamation", gindex++);    glyph_order.insert("question", gindex++);    glyph_order.insert("parenright", gindex++);    glyph_order.insert("zero", gindex++);    glyph_order.insert("one", gindex++);    glyph_order.insert("two", gindex++);    glyph_order.insert("three", gindex++);    glyph_order.insert("four", gindex++);    glyph_order.insert("five", gindex++);    glyph_order.insert("six", gindex++);    glyph_order.insert("seven", gindex++);    glyph_order.insert("eight", gindex++);    glyph_order.insert("nine", gindex++);    glyph_order.insert("zerooldstyle", gindex++);    glyph_order.insert("oneoldstyle", gindex++);    glyph_order.insert("twooldstyle", gindex++);    glyph_order.insert("threeoldstyle", gindex++);    glyph_order.insert("fouroldstyle", gindex++);    glyph_order.insert("fiveoldstyle", gindex++);    glyph_order.insert("sixoldstyle", gindex++);    glyph_order.insert("sevenoldstyle", gindex++);    glyph_order.insert("eightoldstyle", gindex++);    glyph_order.insert("nineoldstyle", gindex++);    glyph_order.insert(".notdef", gindex++);    glyph_order.insert("space", gindex++);    HashMap<PermString, int> encodings(-1);    Type1Encoding *encoding = font->type1_encoding();    if (encoding)	for (int i = 255; i >= 0; i--)	    encodings.insert(encoding->elt(i), i);        Vector<PermString> glyph_names;    int nglyphs = font->nglyphs();    for (int i = 0; i < nglyphs; i++)	glyph_names.push_back(font->glyph_name(i));    qsort(&glyph_names[0], nglyphs, sizeof(PermString), glyphcompare);    int per_row = 10;    int nrows = 13;    int per_page = nrows * per_row;      int page = 0;    for (int gi = 0; gi < nglyphs; gi++) {    	if (gi % per_page == 0) {	    if (page)		fprintf(outf, "showpage restore\n");	    page++;	    fprintf(outf, "%%%%Page: %d %d\nsave\n", page, page);	    // make new font	    fprintf(outf, "/%s findfont dup length dict begin\n\ { 1 index /FID ne {def} {pop pop} ifelse } forall\n /Encoding [",		    font->font_name().cc());	    for (int i = gi; i < gi + per_page && i < nglyphs; i++) {		fprintf(outf, " /%s", glyph_names[i].cc());		if (i % 10 == 9) fprintf(outf, "\n");	    }	    fprintf(outf, " ] def\n currentdict end /X exch definefont pop\n\/X 24 selectfont\n");	}		int row = (gi % per_page) / per_row;	int col = gi % per_row;	fprintf(outf, "%d %d %d (%s)", row, col, gi % per_page, glyph_names[gi].cc());	if (encodings[glyph_names[gi]] >= 0) {	    int e = encodings[glyph_names[gi]];	    if (e == '\\')		fprintf(outf, " ('\\\\\\\\')");	    else if (e == '\'')		fprintf(outf, " ('\\\\'')");	    else if (e == '(' || e == ')')		fprintf(outf, " ('\\%c')", e);	    else if (e >= 32 && e < 127)		fprintf(outf, " ('%c')", e);	    else		fprintf(outf, " ('\\\\%03o')", e);	} else	    fprintf(outf, " ()");	fprintf(outf, " magicbox\n");    }    if (page)	fprintf(outf, "showpage restore\n");    fprintf(outf, "%%%%EOF\n");    fclose(outf);      exit(0);}