Hi!

----

Below is a quick crashcourse-style overview of Xprint:
1. General:
"Xprint" is a printing system which enables X11 applications to use 
devices like printers, FAX or create documents in vector formats like 
PostScript, PDF or SVGprint etc. The rendering commands of the client 
are transformed by the print DDX into vector rendering instructions 
(e.g. you don't operate on bitmaps; however Pixmaps are supported in a 
way that all rendering instructions to a pixmap are "recorded" and 
played-back when you do a |XCopyArea()| or similar calls), e.g. the 
paper output is a (usually scalable) vector representation of the 
client's rendering commands.
Since the output is on a "paginated device" (e.g. paper surface) which 
cannot scroll etc. the server has a X11 extension ("XpExtension") to 
control how the output is distributed over a print job, one or multiple 
documents in a print job and the pages itself (e.g. StartJob, 
StartDocument, StartPage, EndPage, EndDocument, EndJob), the generation 
of matching X11 events for these calls (for example that the 
XawPrintShell widget can "drive itself" using the events alone) and to 
handle the additional attributes of a print job, e.g. paper size, page 
orientation (landscape, portrait, reverse-landscape etc,), resolution 
etc. Each job gets a XpContext assigned which can be shared between 
multiple clients (which means multiple clients can render into one 
window/print job; in CDE's case this was used to let a different process 
to display the print dialog and configure the XpContext and then pass 
this to the calling application (which can read all he configuration 
information from the XpContext)) which is used to store the extension 
properties.


2. The server:
The server contains all the generic X11, Xprint framework and DDX stuff. 
On startup the server looks at the XPCONFIGDIR variable and reads the 
configuration - the configuration says the server how to find a list of 
printers, the server then uses these names to try to assign a list of 
"model-config" names to these names. The "model-configs" contain printer 
propperties, e.g. which capabilties the printer and DDX has and a list 
of builtin fonts (these are the PMF fonts which are like PCF except that 
they only contain the glyph metrics (measured at the printers highest 
resolution; for PostScript it's defined at 1200x1200 DPI) and no font 
bitmaps itself). More server configuration details about this are 
described in the attached "dtprint_fspec.pdf".

WARNING: The Xprt server MUST find it's configuration, otherwise it will 
go completly nuts - which means you must make any Xprt package depend on 
the Xprint server configuration (or put it into one file) to avoid that 
the server misbehaves (this issue caused lot pain in the past since 
people tried to run Xprt like this $ Xprt :30 & # and then wondered by 
the output looks horrible (<--- understatement) ...).


3. Notes about font handling:
Xprt handles fonts a bit different than a normal Xserver since it has 
support for printer-builtin fonts which are rendered by the printer 
itself - these fonts are only available when a XpContext is completely 
configured for a printer and the print resolution matches some 
requirements). We modified the "xlsfonts" utilty to accept a printer 
name and resolution to list these fonts on demand.


4. Suported X11 extensions:
* Most non-video-specific extensions work with Xprint, e.g. ...
- DOUBLE-BUFFER
- SHAPE,
- TOG-CUP
- GLX (Xprt supports the MESA rasterizer for all DDXs (Hitachi 
developled a GL renderer for PostScript but never released it to 
X.org... ;-( (the code is still stuck somewhere in h*ll because there 
was never a way to negotiate a solution which would allow to use the 
MESA and the PSGL bits in one binary (and keithp did another slice of 
bashing to p*ss them off (sorry for cursing but it still hurts a bit...)))))
... will work. Other extensions like "MIT-SHM" and "DGA" are not 
implemented because they explicitly operate on bitmaps and the RENDER 
implementation in the PostScript DDX is unfinished (it would go through 
bits of PSGL which is currently... erm.. stuck...).


5. Looking-up the Xprint server ("Xprt"):
Originally CDE used both a Xrm resource called *XpServerList and an 
environment variable ("XPSERVERLIST") to lookup the servers (note: 
XPSERVERLIST may contain _multiple_ servers, for example one 
network-wide one, one machine-global and one running per-user), however 
the applications/utilties/tools in the X11 tree and "mozilla"/"firefox" 
only use the XPSERVERLIST variable. Since CDE is no longer involved we 
invented a new way to populate the XPSERVERLIST variable which is done 
using the /etc/init.d/xprint script which is responsible to start/stop 
and "autoconfigure" a machine-wide Xprt instance when called as user 
"root" or a per-user instance when called as normal user. The script 
contains a seperate command called "getserverlist" which will print the 
server(s) ; the output of this script is used by 
/etc/profile.d/xprint.(sh|csh) to set the XPSERVERLIST variable for 
login shell sessions.


6. Client-side helper applications:
X.org comes with two client-side helper applications:
- "xplsprinters" can list printers and printer attributes (similar to 
xlsfonts&&xlsclients)
- "xpreashprinterlist" can be used to tell the server to check the list 
of printers and re-fresh it (this will not re-load the configutation 
itself, only the list of printers itself is refreshed).
Additionally some other tools like "xdpyinfo" and "xset" have been made 
aware of the Xprint extension.

Uhm... AFAIK that's all for now...
... attached are "dtprint_fspec.pdf" and the old Xprint FAQ (<--- 
warning: Marketing language inside...) ...

----

Bye,
Roland

-- 
   __ .  . __
  (o.\ \/ /.o) roland.mainz at nrubsig.org
   \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
   /O /==\ O\  TEL +49 641 7950090
  (;O/ \/ \O;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/xwin-discuss/attachments/20080416/c1e39a33/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dtprint_fspec.pdf
Type: application/pdf
Size: 407986 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/xwin-discuss/attachments/20080416/c1e39a33/attachment.pdf>

Reply via email to