Index: xc/programs/Xserver/Xprint/Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Init.c,v retrieving revision 1.6 diff -u -2 -0 -r1.6 Init.c --- xc/programs/Xserver/Xprint/Init.c 24 Jun 2004 06:26:27 -0000 1.6 +++ xc/programs/Xserver/Xprint/Init.c 30 Sep 2004 03:40:51 -0000 @@ -1200,94 +1200,111 @@ { AddToFontPath(fontDir); xfree(fontDir); freeDefaultFontPath = TRUE; } } if(allIDs) xfree(allIDs); return; } /* * XpClientIsBitmapClient is called by the font code to find out if * a particular client should be granted access to bitmap fonts. * This function works by * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine * the context associated with the client, and then queries the context's * attributes to determine whether the bitmap fonts should be visible. - * It looks at the value of the xp-listfonts-mode document/page attribute to + * It looks at the value of the xp-listfonts-modes document/page attribute to * see if xp-list-glyph-fonts has been left out of the mode list. Only - * if the xp-listfonts-mode attribute exists, and it does not contain + * if the xp-listfonts-modes attribute exists, and it does not contain * xp-list-glyph-fonts does this function return FALSE. In any other * case the funtion returns TRUE, indicating that the bitmap fonts * should be visible to the client. */ Bool XpClientIsBitmapClient( ClientPtr client) { XpContextPtr pContext; char *mode; if(!(pContext = XpContextOfClient(client))) return TRUE; /* * Check the page attributes, and if it's not defined there, then * check the document attributes. */ - mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-mode"); + mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes"); if(!mode || !strlen(mode)) { - mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-mode"); + mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes"); if(!mode || !strlen(mode)) return TRUE; } if(!strstr(mode, "xp-list-glyph-fonts")) return FALSE; return TRUE; } /* * XpClientIsPrintClient is called by the font code to find out if * a particular client has set a context which references a printer * which utilizes a particular font path. This function works by * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine * the context associated with the client, and then looks up the * font directory for the context. The font directory is then compared * with the directory specified in the FontPathElement which is passed in. */ Bool XpClientIsPrintClient( ClientPtr client, FontPathElementPtr fpe) { XpContextPtr pContext; + char *mode; char *modelID, *fontDir; if(!(pContext = XpContextOfClient(client))) return FALSE; + /* + * Check the page attributes, and if it's not defined there, then + * check the document attributes. + */ + mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes"); + if(!mode || !strlen(mode)) + { + mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes"); + } + + if(mode && strlen(mode)) + { + if(!strstr(mode, "xp-list-internal-printer-fonts")) + return FALSE; + } + if (!fpe) return TRUE; modelID = XpGetOneAttribute(pContext, XPPrinterAttr, "xp-model-identifier"); if(!modelID || !strlen(modelID)) return FALSE; if(!(fontDir = FindFontDir(modelID))) return FALSE; /* * The grunge here is to ignore the PATH_PREFIX at the front of the * fpe->name. */ if(fpe->name_length < PATH_PREFIX_LEN || (strlen(fontDir) != (fpe->name_length - PATH_PREFIX_LEN)) || strncmp(fontDir, fpe->name + PATH_PREFIX_LEN, fpe->name_length - PATH_PREFIX_LEN)) { xfree(fontDir); Index: xc/programs/Xserver/Xprint/ps/PsInit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsInit.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 PsInit.c --- xc/programs/Xserver/Xprint/ps/PsInit.c 26 Apr 2004 11:07:03 -0000 1.3 +++ xc/programs/Xserver/Xprint/ps/PsInit.c 30 Sep 2004 03:40:51 -0000 @@ -265,46 +265,46 @@ sizeof(PsContextPrivRec)); PsPixmapPrivateIndex = AllocatePixmapPrivateIndex(); AllocatePixmapPrivate(pScreen, PsPixmapPrivateIndex, sizeof(PsPixmapPrivRec)); PsGeneration = serverGeneration; } pScreen->devPrivates[PsScreenPrivateIndex].ptr = (pointer)xalloc(sizeof(PsScreenPrivRec)); } /* * PsInitContext * * Establish the appropriate values for a PrintContext used with the PS * driver. */ static char DOC_ATT_SUPP[]="document-attributes-supported"; -static char DOC_ATT_VAL[]="document-format"; +static char DOC_ATT_VAL[]="document-format xp-listfonts-modes"; static char JOB_ATT_SUPP[]="job-attributes-supported"; static char JOB_ATT_VAL[]=""; static char PAGE_ATT_SUPP[]="xp-page-attributes-supported"; static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \ -default-input-tray default-medium plex"; +default-input-tray default-medium plex xp-listfonts-modes"; static int PsInitContext(pCon) XpContextPtr pCon; { XpDriverFuncsPtr pFuncs; PsContextPrivPtr pConPriv; char *server, *attrStr; /* * Initialize the attribute store for this printer. */ XpInitAttributes(pCon); /* * Initialize the function pointers */ pFuncs = &(pCon->funcs); pFuncs->StartJob = PsStartJob; pFuncs->EndJob = PsEndJob;