From 74003cdc55c5ca091c0804328c3d140b2b38baa4 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 26 Jun 2009 21:08:37 -0700 Subject: Remove unused Xprint support BUILD_PRINTSUPPORT has never been defined in autoconf/automake builds, so it hasn't been built since 6.9 Signed-off-by: Alan Coopersmith --- dsimple.c | 95 ++----------------------- dsimple.h | 7 -- xlsfonts.c | 223 ---------------------------------------------------------- xlsfonts.man | 88 +---------------------- xlsfonts.sgml | 218 -------------------------------------------------------- 5 files changed, 7 insertions(+), 624 deletions(-) diff --git a/dsimple.c b/dsimple.c index e9eda72..9139b00 100644 --- a/dsimple.c +++ b/dsimple.c @@ -41,9 +41,6 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ -#ifdef BUILD_PRINTSUPPORT -#include -#endif /* BUILD_PRINTSUPPORT */ #include "dsimple.h" /* @@ -61,10 +58,6 @@ from The Open Group. char *program_name = "unknown_program"; Display *dpy = NULL; int screen = 0; -Bool printer_output = False; /* Video or printer output ? */ -#ifdef BUILD_PRINTSUPPORT -XPContext pcontext = None; -#endif /* BUILD_PRINTSUPPORT */ static void _bitmap_error(int, char *); @@ -136,42 +129,6 @@ Get_Display_Name(int *pargc/* MODIFIED */, char **argv/* MODIFIED */) } -#ifdef BUILD_PRINTSUPPORT -/* - * Get_Printer_Name (argc, argv) Look for -printer, -p, - * If found, remove it from command line. Don't go past a lone -. - */ -char * -Get_Printer_Name(int *pargc/* MODIFIED */, char **argv/* MODIFIED */) -{ - int argc = *pargc; - char **pargv = argv+1; - char *printername = NULL; - int i; - - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (!strcmp (arg, "-printer") || !strcmp (arg, "-p")) { - if (++i >= argc) usage (); - - printername = argv[i]; - *pargc -= 2; - continue; - } - if (!strcmp(arg,"-")) { - while (i #include #include -#ifdef BUILD_PRINTSUPPORT -#include -#endif /* BUILD_PRINTSUPPORT */ #include "dsimple.h" #define N_START INT_MAX /* Maximum # of fonts to start with (should @@ -61,18 +58,11 @@ static int min_max; typedef struct { char *name; XFontStruct *info; -#ifdef BUILD_PRINTSUPPORT - char *listfonts_modes; -#endif /* BUILD_PRINTSUPPORT */ } FontList; static FontList *font_list = NULL; /* Local prototypes */ -#ifdef BUILD_PRINTSUPPORT -static Bool IsListfontsModesChangeSupported(char *mode); -static int SetListfontsModes(const char *attrname, Bool enableattr); -#endif /* BUILD_PRINTSUPPORT */ static void get_list(char *pattern); static int compare(const void *arg1, const void *arg2); static void show_fonts(void); @@ -92,24 +82,11 @@ void usage(void) fprintf (stderr, " -C force columns\n"); fprintf (stderr, " -1 force single column\n"); fprintf (stderr, " -u keep output unsorted\n"); -#ifdef BUILD_PRINTSUPPORT - fprintf (stderr, " -r resolution set print resolution\n"); - fprintf (stderr, " -b list printer builtin fonts\n"); - fprintf (stderr, " -B do not list printer builtin fonts\n"); - fprintf (stderr, " -g list glyph fonts\n"); - fprintf (stderr, " -G do not list glyph fonts\n"); - fprintf (stderr, " -x mode enable listfont mode\n"); - fprintf (stderr, " -X mode disable listfont mode\n"); -#endif /* BUILD_PRINTSUPPORT */ fprintf (stderr, " -o use OpenFont/QueryFont instead of ListFonts\n"); fprintf (stderr, " -w width maximum width for multiple columns\n"); fprintf (stderr, " -n columns number of columns if multi column\n"); fprintf (stderr, " -display displayname X server to contact\n"); fprintf (stderr, " -d displayname (alias for -display displayname)\n"); -#ifdef BUILD_PRINTSUPPORT - fprintf (stderr, " -printer printername printer to use\n"); - fprintf (stderr, " -p printername (alias for -p printername)\n"); -#endif /* BUILD_PRINTSUPPORT */ fprintf (stderr, "\n"); Close_Display(); exit(EXIT_FAILURE); @@ -118,23 +95,12 @@ void usage(void) int main(int argc, char **argv) { int argcnt = 0, i; -#ifdef BUILD_PRINTSUPPORT - char *mode; -#endif INIT_NAME; /* Handle command line arguments, open display */ Setup_Display_And_Screen(&argc, argv); -#ifdef BUILD_PRINTSUPPORT - if (printer_output) { - /* XListFonts*()/XLoadFont*() honor xp-listfonts-modes only - * if there is an context _SET_ for this display */ - XpSetContext(dpy, pcontext); - } -#endif /* BUILD_PRINTSUPPORT */ - for (argv++, argc--; argc; argv++, argc--) { if (argv[0][0] == '-') { if (argcnt > 0) usage (); @@ -175,83 +141,6 @@ int main(int argc, char **argv) case 'u': sort_output = False; break; -#ifdef BUILD_PRINTSUPPORT - case 'r': - { - const char *resname; - XpuResolutionList rlist; - int num_rlist; - XpuResolutionRec *res; - - if (--argc <= 0) usage (); - argv++; - resname = argv[0]; - - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i]); - rlist = XpuGetResolutionList(dpy, pcontext, &num_rlist); - if (!rlist) - Fatal_Error("Could not get list of supported resolutions (Server configuration error ?)."); - res = XpuFindResolutionByName(rlist, num_rlist, resname); - if (!res) - Fatal_Error("Could not find resolution '%s'.", resname); - XpuSetDocResolution(dpy, pcontext, res); - XpuFreeResolutionList(rlist); - } - goto next; - case 'b': - mode = "xp-list-internal-printer-fonts"; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, True); - break; - case 'B': - mode = "xp-list-internal-printer-fonts"; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, False); - break; - case 'g': - mode = "xp-list-glyph-fonts"; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, True); - break; - case 'G': - mode = "xp-list-glyph-fonts"; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, False); - break; - case 'x': - if (--argc <= 0) usage (); - argv++; - mode = argv[0]; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i-1]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, True); - goto next; - case 'X': - if (--argc <= 0) usage (); - argv++; - mode = argv[0]; - if (!printer_output) - Fatal_Error("Option '%c' only supported for printers.", argv[0][i-1]); - if (!IsListfontsModesChangeSupported(mode)) - Fatal_Error("Printer does not support changing '%s'.", mode); - SetListfontsModes(mode, False); - goto next; -#endif /* BUILD_PRINTSUPPORT */ default: usage(); break; @@ -274,86 +163,6 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } -#ifdef BUILD_PRINTSUPPORT -/* This should be moved to XprintUtils */ -static -Bool IsListfontsModesChangeSupported(char *mode) -{ - char *value; - Bool isSupported; - - value = XpGetOneAttribute(dpy, pcontext, XPPrinterAttr, "xp-listfonts-modes-supported"); - if (!value) - return False; - - isSupported = (strstr(value, mode) != NULL)?(True):(False); - XFree(value); - - return isSupported; -} - -/* XXX: This should be moved to XprintUtils (and should have a Document/Page-level - * option and should verify that the matching leven supports xp-listfonts-modes - * changes)*/ -static -int SetListfontsModes(const char *attrname, Bool enableattr) -{ - char *value, - *newvalue; - - value = XpGetOneAttribute(dpy, pcontext, XPDocAttr, "xp-listfonts-modes"); - if (!value) - value = strdup(""); - - /* Set attribute */ - if (enableattr) - { - /* Return success if |attrname| is already set */ - if (strstr(value, attrname) != NULL) - { - XFree(value); - return 1; /* success */ - } - - newvalue = malloc(strlen(value) + strlen(attrname) + 2); - if (!newvalue) - { - XFree(value); - Fatal_Error("SetListfontsModes: No memory."); - } - - sprintf(newvalue, "%s %s", value, attrname); - XpuSetOneAttribute(dpy, pcontext, XPDocAttr, "*xp-listfonts-modes", newvalue, XPAttrMerge); - - free(newvalue); - XFree(value); - return 1; /* success */ - } - else - { - char *s, /* copy string "source" */ - *d; /* copy string "destination" */ - - /* Return success if |attrname| not set */ - d = strstr(value, attrname); - if (d == NULL) - { - XFree(value); - return 1; /* success */ - } - - /* strip |attrname| from |value| */ - s = d+strlen(attrname); - while( (*d++ = *s++) != '\0' ) - ; - - XpuSetOneAttribute(dpy, pcontext, XPDocAttr, "*xp-listfonts-modes", value, XPAttrMerge); - - XFree(value); - return 1; /* success */ - } -} -#endif /* BUILD_PRINTSUPPORT */ static void get_list(char *pattern) @@ -405,24 +214,6 @@ void get_list(char *pattern) font_list[font_cnt].info = info + i; else font_list[font_cnt].info = NULL; - -#ifdef BUILD_PRINTSUPPORT - if (printer_output) { - char *listfonts_modes; - - listfonts_modes = XpGetOneAttribute(dpy, pcontext, XPDocAttr, "xp-listfonts-modes"); - - /* Save status of xp-listfonts-modes */ - font_list[font_cnt].listfonts_modes = strdup(listfonts_modes?listfonts_modes:""); - - if (listfonts_modes) - XFree(listfonts_modes); - } - else - { - font_list[font_cnt].listfonts_modes = NULL; - } -#endif /* BUILD_PRINTSUPPORT */ font_cnt++; } @@ -454,13 +245,6 @@ void show_fonts(void) if (long_list > L_MEDIUM) { for (i = 0; i < font_cnt; i++) { -#ifdef BUILD_PRINTSUPPORT - if (printer_output) { - /* Restore saved xp-listfonts-modes status */ - XpuSetOneAttribute(dpy, pcontext, XPDocAttr, "*xp-listfonts-modes", font_list[i].listfonts_modes, XPAttrMerge); - } -#endif /* BUILD_PRINTSUPPORT */ - do_query_font (dpy, font_list[i].name); } return; @@ -668,15 +452,8 @@ static char* stringValued [] = { /* values are atoms */ "RASTERIZER_VERSION", /* other registered font properties (see the X.org Registry, sec. 15) */ - -#ifdef BUILD_PRINTSUPPORT - /* Used by Xprint's Postscript and PDF DDX */ "_ADOBE_POSTSCRIPT_FONTNAME", - /* Used by Xprint's PCL DDXs */ - "PCL_FONT_NAME", -#endif /* BUILD_PRINTSUPPORT */ - /* unregistered font properties */ "CHARSET_COLLECTIONS", "CLASSIFICATION", diff --git a/xlsfonts.man b/xlsfonts.man index bb414a5..fea41c5 100644 --- a/xlsfonts.man +++ b/xlsfonts.man @@ -6,9 +6,6 @@ xlsfonts \- server font list displayer for X .ad l \fBxlsfonts\fR [\fB\-display \fBhost:dpy\fR\fR] [\fB\-l\fR] [\fB\-ll\fR] [\fB\-lll\fR] [\fB\-m\fR] [\fB\-C\fR] [\fB\-1\fR] [\fB\-w \fBwidth\fR\fR] [\fB\-n \fBcolumns\fR\fR] [\fB\-u\fR] [\fB\-o\fR] [\fB\-fn \fBpattern\fR\fR] -.br -\fBxlsfonts\fR -\fB\-printer \fBprintername\fR\fR [\fB\-l\fR] [\fB\-ll\fR] [\fB\-lll\fR] [\fB\-m\fR] [\fB\-C\fR] [\fB\-1\fR] [\fB\-w \fBwidth\fR\fR] [\fB\-n \fBcolumns\fR\fR] [\fB\-u\fR] [\fB\-o\fR] [\fB\-r \fBresolution\fR\fR] [\fB\-b\fR] [\fB\-B\fR] [\fB\-g\fR] [\fB\-G\fR] [\fB\-x \fBmode\fR\fR] [\fB\-X \fBmode\fR\fR] [\fB\-fn \fBpattern\fR\fR] .SH DESCRIPTION xlsfonts lists the fonts that match the given pattern. The wildcard character "*" may be used to match any sequence of characters @@ -21,15 +18,9 @@ The "*" and "?" characters must be quoted to prevent them from being expanded by \fB\-display \fIhost:dpy\fB\fR This option specifies the X server to contact. .TP -\fB\-printer \fIprintername\fB\fR -This option specifies the Xprint printer to contact. -.TP \fB\-d \fIhost:dpy\fB\fR Same as \fB\-display \fIhost:dpy\fB\fR. .TP -\fB\-p \fIprintername\fB\fR -Same as \fB\-printer \fIprintername\fB\fR. -.TP \fB\-l\fR Lists some attributes of the font on one line in addition to its name. @@ -73,91 +64,14 @@ This is useful if ListFonts or ListFontsWithInfo fail to list a known font (as is the case with some scaled font systems). .TP -\fB\-r \fIresolutionname\fB\fR -Set print resolution name (usually values like \fB300dpi\fR -or \fB300x600\fR, see output of xplsprinters). -This may alter the output of xlsfonts if there are printer -fonts which get enabled/disabled on per-resolution basis by the DDX. - -(printer mode only) -.TP -\fB\-b\fR -List printer builtin fonts. -This is the same as \fB\-x xp\-list\-internal\-printer\-fonts\fR. - -(printer mode only) -.TP -\fB\-B\fR -Do not list printer builtin fonts. -This is the same as \fB\-X xp\-list\-internal\-printer\-fonts\fR. - -(printer mode only) -.TP -\fB\-g\fR -List glyph fonts. -This is the same as \fB\-x xp\-list\-glyph\-fonts\fR. - -(printer mode only) -.TP -\fB\-G\fR -Do not list glyph fonts. -This is the same as \fB\-X xp\-list\-glyph\-fonts\fR. - -(printer mode only) -.TP -\fB\-x \fImode\fB\fR -Enable listfont mode \fImode\fR. - -Supported modes are: -.RS -.TP -xp-listinternal-printer-fonts -If \fBxp\-listinternal\-printer\-fonts\fR was set -(via option \fB\-b\fR or -\fB\-x xp\-listinternal\-printer\-fonts\fR xlsfonts -will include all of the fonts defined as internal printer fonts. -.TP -xp-list-glyph-fonts -If \fBxp\-list\-glyph\-fonts\fR was set (via option \fB\-g\fR or -\fB\-x xp\-list\-glyph\-fonts\fR) xlsfonts will -include all of the fonts available to the server which have -glyphs associated with them. -.RE - - -The default value is implicitly determined by the ddx driver to be the -all of the listfonts modes specified in the \fBxp\-listfonts\-modes\-supported\fR -printer attribute. - - -The value of \fBxp\-listfonts\-modes\-supported\fR and -\fBxp\-listfonts\-modes\fR (the defaults) can be looked-up via -\fBxplsprinters\fR(__appmansuffix__). - - -(printer mode only) -.TP -\fB\-X \fImode\fB\fR -Disable listfont mode \fImode\fR. -See option \fB\-x\fR for a list of valid -\fImode\fR values. - -(printer mode only) -.TP \fB\-fn \fIpattern\fB\fR This option specifies the font name pattern to match. .SH "SEE ALSO" -\fBX\fR(__miscmansuffix__), \fBXprint\fR(__miscmansuffix__), \fBXserver\fR(__appmansuffix__), \fBxset\fR(__appmansuffix__), \fBxfd\fR(__appmansuffix__), \fBxplsprinters\fR(__appmansuffix__), X Logical Font Description Conventions +\fBX\fR(__miscmansuffix__), \fBXserver\fR(__appmansuffix__), \fBxset\fR(__appmansuffix__), \fBxfd\fR(__appmansuffix__), X Logical Font Description Conventions .SH ENVIRONMENT .TP \fBDISPLAY\fR \fBDISPLAY\fR must be set to get the default host and display to use. -.TP -\fBXPSERVERLIST\fR -\fBXPSERVERLIST\fR must be set for the \fB\-printer\fR option -identifying the available Xprint servers. -See \fBXprint\fR(__miscmansuffix__) -for more details. .SH BUGS Doing ``xlsfonts -l'' can tie up your server for a very long time. This is really a bug with single-threaded diff --git a/xlsfonts.sgml b/xlsfonts.sgml index ff313ca..c4bf859 100644 --- a/xlsfonts.sgml +++ b/xlsfonts.sgml @@ -24,7 +24,6 @@ manual volume numbers. - xlsfonts @@ -52,49 +51,6 @@ manual volume numbers. - - - - xlsfonts - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -125,16 +81,6 @@ manual volume numbers. - - - - - - This option specifies the Xprint printer to contact. - - - - @@ -145,16 +91,6 @@ manual volume numbers. - - - - - - Same as . - - - - @@ -268,147 +204,6 @@ manual volume numbers. - - - - - - Set print resolution name (usually values like 300dpi - or 300x600, see output of xplsprinters). - This may alter the output of xlsfonts if there are printer - fonts which get enabled/disabled on per-resolution basis by the DDX. - - - (printer mode only) - - - - - - - - - - List printer builtin fonts. - This is the same as . - - - (printer mode only) - - - - - - - - - - Do not list printer builtin fonts. - This is the same as . - - - (printer mode only) - - - - - - - - - - List glyph fonts. - This is the same as . - - - (printer mode only) - - - - - - - - - - Do not list glyph fonts. - This is the same as . - - - (printer mode only) - - - - - - - - - - Enable listfont mode mode. - - - Supported modes are: - - - xp-listinternal-printer-fonts - - - If xp-listinternal-printer-fonts was set - (via option or - xlsfonts - will include all of the fonts defined as internal printer fonts. - - - - - - xp-list-glyph-fonts - - - If xp-list-glyph-fonts was set (via option or - ) xlsfonts will - include all of the fonts available to the server which have - glyphs associated with them. - - - - - - - The default value is implicitly determined by the ddx driver to be the - all of the listfonts modes specified in the xp-listfonts-modes-supported - printer attribute. - - - - The value of xp-listfonts-modes-supported and - xp-listfonts-modes (the defaults) can be looked-up via - xplsprinters__appmansuffix__. - - - - - (printer mode only) - - - - - - - - - - Disable listfont mode mode. - See option for a list of valid - mode values. - - - (printer mode only) - - - - @@ -426,11 +221,9 @@ manual volume numbers. X__miscmansuffix__ - Xprint__miscmansuffix__ Xserver__appmansuffix__ xset__appmansuffix__ xfd__appmansuffix__ - xplsprinters__appmansuffix__ X Logical Font Description Conventions @@ -449,17 +242,6 @@ manual volume numbers. - - XPSERVERLIST - - - XPSERVERLIST must be set for the option - identifying the available Xprint servers. - See Xprint__miscmansuffix__ - for more details. - - - -- cgit v1.2.3