/* * FIG : Facility for Interactive Generation of figures * Copyright (c) 1989-1998 by Brian V. Smith * * Any party obtaining a copy of these files is granted, free of charge, a * full and unrestricted irrevocable, world-wide, paid up, royalty-free, * nonexclusive right and license to deal in this software and * documentation files (the "Software"), including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons who receive * copies from any such party to do so, with the only requirement being * that this copyright notice remain intact. * */ #include "fig.h" #include "resources.h" #include "u_fonts.h" #include "object.h" /* printer font names for indicator window */ struct _xfstruct x_fontinfo[NUM_FONTS] = { {"-urw-times-medium-r-normal--", (struct xfont*) NULL}, {"-urw-times-medium-i-normal--", (struct xfont*) NULL}, {"-urw-times-bold-r-normal--", (struct xfont*) NULL}, {"-urw-times-bold-i-normal--", (struct xfont*) NULL}, {"-urw-avantgarde-book-r-normal--", (struct xfont*) NULL}, {"-urw-avantgarde-book-o-normal--", (struct xfont*) NULL}, {"-urw-avantgarde-demibold-r-normal--", (struct xfont*) NULL}, {"-urw-avantgarde-demibold-o-normal--", (struct xfont*) NULL}, {"-urw-bookman-light-r-normal--", (struct xfont*) NULL}, {"-urw-bookman-light-i-normal--", (struct xfont*) NULL}, {"-urw-bookman-demibold-r-normal--", (struct xfont*) NULL}, {"-urw-bookman-demibold-i-normal--", (struct xfont*) NULL}, {"-urw-courier-medium-r-normal--", (struct xfont*) NULL}, {"-urw-courier-medium-o-normal--", (struct xfont*) NULL}, {"-urw-courier-bold-r-normal--", (struct xfont*) NULL}, {"-urw-courier-bold-o-normal--", (struct xfont*) NULL}, {"-urw-helvetica-medium-r-normal--", (struct xfont*) NULL}, {"-urw-helvetica-medium-o-normal--", (struct xfont*) NULL}, {"-urw-helvetica-bold-r-normal--", (struct xfont*) NULL}, {"-urw-helvetica-bold-o-normal--", (struct xfont*) NULL}, {"-urw-helvetica-medium-r-condensed--", (struct xfont*) NULL}, {"-urw-helvetica-medium-o-condensed--", (struct xfont*) NULL}, {"-urw-helvetica-bold-r-condensed--", (struct xfont*) NULL}, {"-urw-helvetica-bold-o-condensed--", (struct xfont*) NULL}, {"-urw-new century schoolbook-medium-r-normal--", (struct xfont*) NULL}, {"-urw-new century schoolbook-medium-i-normal--", (struct xfont*) NULL}, {"-urw-new century schoolbook-bold-r-normal--", (struct xfont*) NULL}, {"-urw-new century schoolbook-bold-i-normal--", (struct xfont*) NULL}, {"-urw-palatino-medium-r-normal--", (struct xfont*) NULL}, {"-urw-palatino-medium-i-normal--", (struct xfont*) NULL}, {"-urw-palatino-bold-r-normal--", (struct xfont*) NULL}, {"-urw-palatino-bold-i-normal--", (struct xfont*) NULL}, {"-urw-symbol-medium-r-normal--", (struct xfont*) NULL}, {"-urw-zapf chancery-medium-i-normal--", (struct xfont*) NULL}, {"-urw-zapf dingbats-medium-r-normal--", (struct xfont*) NULL}, }; struct _fstruct ps_fontinfo[NUM_FONTS + 1] = { {"Default", -1}, {"Times-Roman", 0}, {"Times-Italic", 1}, {"Times-Bold", 2}, {"Times-BoldItalic", 3}, {"AvantGarde-Book", 4}, {"AvantGarde-BookOblique", 5}, {"AvantGarde-Demi", 6}, {"AvantGarde-DemiOblique", 7}, {"Bookman-Light", 8}, {"Bookman-LightItalic", 9}, {"Bookman-Demi", 10}, {"Bookman-DemiItalic", 11}, {"Courier", 12}, {"Courier-Oblique", 13}, {"Courier-Bold", 14}, {"Courier-BoldOblique", 15}, {"Helvetica", 16}, {"Helvetica-Oblique", 17}, {"Helvetica-Bold", 18}, {"Helvetica-BoldOblique", 19}, {"Helvetica-Narrow", 20}, {"Helvetica-Narrow-Oblique", 21}, {"Helvetica-Narrow-Bold", 22}, {"Helvetica-Narrow-BoldOblique", 23}, {"NewCenturySchlbk-Roman", 24}, {"NewCenturySchlbk-Italic", 25}, {"NewCenturySchlbk-Bold", 26}, {"NewCenturySchlbk-BoldItalic", 27}, {"Palatino-Roman", 28}, {"Palatino-Italic", 29}, {"Palatino-Bold", 30}, {"Palatino-BoldItalic", 31}, {"Symbol", 32}, {"ZapfChancery-MediumItalic", 33}, {"ZapfDingbats", 34}, }; struct _fstruct latex_fontinfo[NUM_LATEX_FONTS] = { {"Default", 0}, {"Roman", 0}, {"Bold", 2}, {"Italic", 1}, {"Sans Serif", 16}, {"Typewriter", 12}, }; x_fontnum(psflag, fnum) int psflag, fnum; { int x_font; if ((psflag && fnum >= NUM_FONTS) || (!psflag && fnum >= NUM_LATEX_FONTS)) { file_msg("Illegal font number, using font 0"); fnum = 0; } x_font = (psflag ? ps_fontinfo[fnum + 1].xfontnum : latex_fontinfo[fnum].xfontnum); return x_font; } psfontnum(font) char *font; { int i; if (font == NULL) return(DEF_PS_FONT); for (i=0; i