Index: xc/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.422 diff -u -2 -0 -r1.422 ChangeLog --- xc/ChangeLog 3 Oct 2004 20:08:41 -0000 1.422 +++ xc/ChangeLog 3 Oct 2004 23:19:59 -0000 @@ -1,20 +1,34 @@ +2004-10-03 Roland Mainz + * xc/programs/Xserver/Xprint/Init.c + * xc/programs/Xserver/Xprint/pcl/PclInit.c + * xc/programs/Xserver/Xprint/ps/PsInit.c + Bugzilla #1496: Fixed Xprt font handling which did not support + "*xp-listfonts-modes: xp-list-internal-printer-fonts" or + "*xp-listfonts-modes: xp-list-glyph-fonts" to toggle + the usage of printer-builtin and glyph fonts in XListFonts*(), + XLoad*Font(), etc. + Additionally the Xprint DDX now explicitly list "xp-listfonts-modes" + in "document-attributes-supported" (for document-level) or + "xp-page-attributes-supported" (for page-level) when the DDX implements + this feature (as described in the CDE DtPrint specification). + 2004-10-03 Matthieu Herrb * doc/man/Xt/XtManChild.man: * doc/man/Xt/XtName.man: Xt Manual pages fixes from Dmitry Bolkhovitanov (Bugzilla #1498, $1499). 2004-10-03 Roland Mainz * xc/programs/Xserver/Xprint/ps/PsGC.c * xc/programs/Xserver/Xprint/ps/PsPixmap.c Bugzilla #1416: Fix Xprt PostScript DDX crashes when copying offscreen pixmap content to the same pixmap (the crash can be reproduced with % x11perf -copypixpix500 ... # or the reduced testcase in bug #1416 (attachment #993)). 2004-10-03 Vladimir Dergachev Modified: * xc/programs/Xserver/hw/xfree86/drivers/i2c/fi1236.c Make sure formatting style is consistent within a single 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 3 Oct 2004 23:21:21 -0000 @@ -1200,94 +1200,118 @@ { 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. + * 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 at the value of the xp-listfonts-modes + * document/page attribute to see if xp-list-internal-printer-fonts has + * been left out of the mode list. + * If the xp-listfonts-modes attribute exists, and it does not contain + * xp-list-internal-printer-fonts this function returns FALSE. + * Otherwise it 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/pcl/PclInit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/pcl/PclInit.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 PclInit.c --- xc/programs/Xserver/Xprint/pcl/PclInit.c 23 Apr 2004 18:57:50 -0000 1.2 +++ xc/programs/Xserver/Xprint/pcl/PclInit.c 3 Oct 2004 23:21:24 -0000 @@ -312,46 +312,46 @@ PclPixmapPrivateIndex = AllocatePixmapPrivateIndex(); AllocatePixmapPrivate( pScreen, PclPixmapPrivateIndex, sizeof( PclPixmapPrivRec ) ); PclGeneration = serverGeneration; } pScreen->devPrivates[PclScreenPrivateIndex].ptr = (pointer)xalloc( sizeof(PclScreenPrivRec)); } /* * PclInitContext * * Establish the appropriate values for a PrintContext used with the PCL * 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 PclInitContext(XpContextPtr pCon) { XpDriverFuncsPtr pFuncs; PclContextPrivPtr pConPriv; char *server, *attrStr; char *modelID; char *configDir; char *pathName; int i, j; float width, height; XpOidMediumDiscreteSizeList* ds_list; XpOidArea* repro; XpOid page_size; XpOidMediumSS* m; /* * Initialize the attribute store for this printer. */ 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 3 Oct 2004 23:21:25 -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;