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).
This commit is contained in:
Roland Mainz 2004-10-03 23:29:21 +00:00
parent 8b2f127ea0
commit e622b34611
3 changed files with 37 additions and 13 deletions

View File

@ -1217,9 +1217,9 @@ AugmentFontPath(void)
* calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine * calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine
* the context associated with the client, and then queries the context's * the context associated with the client, and then queries the context's
* attributes to determine whether the bitmap fonts should be visible. * 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 * 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 * xp-list-glyph-fonts does this function return FALSE. In any other
* case the funtion returns TRUE, indicating that the bitmap fonts * case the funtion returns TRUE, indicating that the bitmap fonts
* should be visible to the client. * 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 page attributes, and if it's not defined there, then
* check the document attributes. * check the document attributes.
*/ */
mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-mode"); mode = XpGetOneAttribute(pContext, XPPageAttr, "xp-listfonts-modes");
if(!mode || !strlen(mode)) if(!mode || !strlen(mode))
{ {
mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-mode"); mode = XpGetOneAttribute(pContext, XPDocAttr, "xp-listfonts-modes");
if(!mode || !strlen(mode)) if(!mode || !strlen(mode))
return TRUE; return TRUE;
} }
@ -1251,14 +1251,21 @@ XpClientIsBitmapClient(
return TRUE; return TRUE;
} }
/* /*
* XpClientIsPrintClient is called by the font code to find out if * XpClientIsPrintClient is called by the font code to find out if
* a particular client has set a context which references a printer * a particular client has set a context which references a printer
* which utilizes a particular font path. This function works by * which utilizes a particular font path.
* calling XpContextOfClient (in Xserver/Xext/xprint.c) to determine * This function works by calling XpContextOfClient
* the context associated with the client, and then looks up the * (in Xserver/Xext/xprint.c) to determine the context associated with
* font directory for the context. The font directory is then compared * the client and then looks at the value of the xp-listfonts-modes
* with the directory specified in the FontPathElement which is passed in. * 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 Bool
XpClientIsPrintClient( XpClientIsPrintClient(
@ -1266,11 +1273,28 @@ XpClientIsPrintClient(
FontPathElementPtr fpe) FontPathElementPtr fpe)
{ {
XpContextPtr pContext; XpContextPtr pContext;
char *mode;
char *modelID, *fontDir; char *modelID, *fontDir;
if(!(pContext = XpContextOfClient(client))) if(!(pContext = XpContextOfClient(client)))
return FALSE; 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) if (!fpe)
return TRUE; return TRUE;

View File

@ -329,12 +329,12 @@ AllocatePclPrivates(ScreenPtr pScreen)
*/ */
static char DOC_ATT_SUPP[]="document-attributes-supported"; 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_SUPP[]="job-attributes-supported";
static char JOB_ATT_VAL[]=""; static char JOB_ATT_VAL[]="";
static char PAGE_ATT_SUPP[]="xp-page-attributes-supported"; static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \ 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 static int
PclInitContext(XpContextPtr pCon) PclInitContext(XpContextPtr pCon)

View File

@ -282,12 +282,12 @@ AllocatePsPrivates(ScreenPtr pScreen)
*/ */
static char DOC_ATT_SUPP[]="document-attributes-supported"; 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_SUPP[]="job-attributes-supported";
static char JOB_ATT_VAL[]=""; static char JOB_ATT_VAL[]="";
static char PAGE_ATT_SUPP[]="xp-page-attributes-supported"; static char PAGE_ATT_SUPP[]="xp-page-attributes-supported";
static char PAGE_ATT_VAL[]="content-orientation default-printer-resolution \ 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 static int
PsInitContext(pCon) PsInitContext(pCon)