summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-13 05:12:12 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-13 05:12:12 +0000
commit534a492816258b6469e110c5e942b1a8fac8959b (patch)
tree4a02ff88b832aca7e01235e93fcef27734812274
parentc2f561e3a287a5bf7d6230cbcba81be08be3c4c3 (diff)
xc/programs/Xserver/Xprint/Init.c
xc/programs/Xserver/Xprint/pcl/PclInit.c //freedesktop.org/bugzilla/show_bug.cgi?id=1496) attachment #998 (https://bugs.freedesktop.org/attachment.cgi?id=998): 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 and Xprint specifications).
-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 565bb7770..cb47fa144 100644
--- a/Xprint/Init.c
+++ b/Xprint/Init.c
@@ -1218,9 +1218,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.
@@ -1239,10 +1239,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;
}
@@ -1252,14 +1252,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(
@@ -1267,11 +1274,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 30c6600de..f85ad78b9 100644
--- a/Xprint/ps/PsInit.c
+++ b/Xprint/ps/PsInit.c
@@ -428,12 +428,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)