summaryrefslogtreecommitdiff
path: root/Xprint
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-10-03 23:29:21 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-10-03 23:29:21 +0000
commite622b346113f65788110777d7d1b5fc436600a4d (patch)
tree70d30e28ee8c94a10c4196d32bb8eacb6d20fe25 /Xprint
parent8b2f127ea0db2c7fee223b69f4fceee0427fb2e4 (diff)
Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=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).
Diffstat (limited to 'Xprint')
-rw-r--r--Xprint/Init.c42
-rw-r--r--Xprint/pcl/PclInit.c4
-rw-r--r--Xprint/ps/PsInit.c4
3 files changed, 37 insertions, 13 deletions
diff --git a/Xprint/Init.c b/Xprint/Init.c
index cd16847ee..4160e5c85 100644
--- a/Xprint/Init.c
+++ b/Xprint/Init.c
@@ -1217,9 +1217,9 @@ AugmentFontPath(void)
* 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.
@@ -1238,10 +1238,10 @@ XpClientIsBitmapClient(
* 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;
}
@@ -1251,14 +1251,21 @@ XpClientIsBitmapClient(
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(
@@ -1266,11 +1273,28 @@ XpClientIsPrintClient(
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;
diff --git a/Xprint/pcl/PclInit.c b/Xprint/pcl/PclInit.c
index 460c11eb6..dd7575a4e 100644
--- a/Xprint/pcl/PclInit.c
+++ b/Xprint/pcl/PclInit.c
@@ -329,12 +329,12 @@ AllocatePclPrivates(ScreenPtr pScreen)
*/
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)
diff --git a/Xprint/ps/PsInit.c b/Xprint/ps/PsInit.c
index f2e064921..ba7ca5f66 100644
--- a/Xprint/ps/PsInit.c
+++ b/Xprint/ps/PsInit.c
@@ -282,12 +282,12 @@ AllocatePsPrivates(ScreenPtr pScreen)
*/
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)