diff --git a/XpConfig/C/print/models/CANONBJ10E-GS/model-config b/XpConfig/C/print/models/CANONBJ10E-GS/model-config new file mode 100644 index 000000000..97bfd8196 --- /dev/null +++ b/XpConfig/C/print/models/CANONBJ10E-GS/model-config @@ -0,0 +1,23 @@ +# $Xprint.org: CANONBJ10E-GS model-config,v 1.4 2003/02/10 14:48:04 gisburn Exp $ + +*content-orientations-supported: portrait landscape +*descriptor: Canon BJ-10e (GhostScript) +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ +} + +*plexes-supported: simplex +*printer-model: "Canon BJ-10e (GhostScript)" +*printer-resolutions-supported: 360 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional +# EOF. diff --git a/XpConfig/C/print/models/GSdefault/model-config b/XpConfig/C/print/models/GSdefault/model-config new file mode 100644 index 000000000..61dac18b8 --- /dev/null +++ b/XpConfig/C/print/models/GSdefault/model-config @@ -0,0 +1,137 @@ +# $Xprint.org: GSdefault model-config,v 1.1 2003/02/10 14:48:04 gisburn Exp $ +# Generic default model-config for the PostScript DDX when using GhostScript +# as printer driver +# +# DO NOT MODIFY THIS FILE!! +# +# If you want to make customisations for your printer create a copy +# of this printer model. +# Example (for creating a model config "MYCOMPANYlaserxx"): +# 1. Create model config dir: +# % mkdir MYCOMPANYlaserxx +# 2. Link (or copy) the PMF (printer font metrics) for the +# printer buildin fonts: +# % ln -s GSdefault/fonts MYCOMPANYlaserxx/. +# 3. Copy the model config file: +# % cp GSdefault/model-config MYCOMPANYlaserxx/. +# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. +# + +# Attributes supported for this printer model +# You may want to cut the lists here down to the attributes supported +# by your printer. +*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape +*descriptor: GhostScript default model +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ + {executive FALSE {6.35 177.80 6.35 260.35}}\ + {folio FALSE {6.35 204.47 6.35 323.85}}\ + {invoice FALSE {6.35 133.35 6.35 209.55}}\ + {ledger FALSE {6.35 273.05 6.35 425.45}}\ + {quarto FALSE {6.35 209.55 6.35 268.732}}\ + {a FALSE {6.35 209.55 6.35 273.05}}\ + {b FALSE {6.35 273.05 6.35 425.45}}\ + {c FALSE {6.35 425.45 6.35 552.45}}\ + {d FALSE {6.35 552.45 6.35 857.25}}\ + {e FALSE {6.35 857.25 6.35 1111.25}}\ + {na-6x9-envelope FALSE {6.35 146.05 6.35 222.25}}\ + {na-10x15-envelope FALSE {6.35 247.65 6.35 374.65}}\ + {monarch-envelope FALSE {6.35 91.948 6.35 184.15}}\ + {na-10x13-envelope FALSE {6.35 247.65 6.35 323.85}}\ + {na-9x12-envelope FALSE {6.35 222.25 6.35 298.45}}\ + {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}}\ + {na-7x9-envelope FALSE {6.35 171.45 6.35 222.25}}\ + {na-9x11-envelope FALSE {6.35 222.25 6.35 273.05}}\ + {na-10x14-envelope FALSE {6.35 247.65 6.35 349.25}}\ + {na-number-9-envelope FALSE {6.35 92.075 6.35 219.075}}\ + {iso-a0 FALSE {6.35 834.65 6.35 1182.65}}\ + {iso-a1 FALSE {6.35 587.65 6.35 834.65}}\ + {iso-a2 FALSE {6.35 413.65 6.35 587.65}}\ + {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ + {iso-a6 FALSE {6.35 98.65 6.35 141.65}}\ + {iso-a7 FALSE {6.35 67.65 6.35 98.65}}\ + {iso-a8 FALSE {6.35 45.65 6.35 67.65}}\ + {iso-a9 FALSE {6.35 30.65 6.35 45.65}}\ + {iso-a10 FALSE {6.35 19.65 6.35 30.65}}\ + {iso-b1 FALSE {6.35 700.65 6.35 993.65}}\ + {iso-b2 FALSE {6.35 493.65 6.35 700.65}}\ + {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ + {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {iso-b6 FALSE {6.35 118.65 6.35 169.65}}\ + {iso-b7 FALSE {6.35 81.65 6.35 118.65}}\ + {iso-b8 FALSE {6.35 55.65 6.35 81.65}}\ + {iso-b9 FALSE {6.35 37.65 6.35 55.65}}\ + {iso-b10 FALSE {6.35 24.65 6.35 37.65}}\ + {jis-b1 FALSE {6.35 721.65 6.35 1023.65}}\ + {jis-b2 FALSE {6.35 508.65 6.35 721.65}}\ + {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ + {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ + {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ + {jis-b6 FALSE {6.35 121.65 6.35 175.65}}\ + {jis-b7 FALSE {6.35 84.65 6.35 121.65}}\ + {jis-b8 FALSE {6.35 57.65 6.35 84.65}}\ + {jis-b9 FALSE {6.35 38.65 6.35 57.65}}\ + {jis-b10 FALSE {6.35 25.65 6.35 38.65}}\ + {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ + {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ + {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ + {iso-c6 FALSE {6.35 107.65 6.35 155.65}}\ + {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ + {hp-2x-postcard FALSE {6.35 141.65 6.35 193.65}}\ + {hp-european-edp FALSE {6.35 298.45 6.35 349.25}}\ + {hp-mini FALSE {6.35 133.35 6.35 209.55}}\ + {hp-postcard FALSE {6.35 93.65 6.35 141.65}}\ + {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ + {hp-us-edp FALSE {6.35 273.05 6.35 349.25}}\ + {hp-us-government-legal FALSE {6.35 196.85 6.35 323.85}}\ + {hp-us-government-letter FALSE {6.35 196.85 6.35 247.65}}\ +} +# If you have more than one tray use the following example: +# 1. List the supported trays +#*input-trays-supported: main manual +# 2. Define each tray and it's paper sizes +#*medium-source-sizes-supported: \ +#{ main \ +# {na-letter FALSE {6.35 209.55 6.35 273.05}} \ +# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ +# {iso-a4 FALSE {6.35 203.65 6.35 290.65}} \ +#} \ +#{ manual \ +# {iso-a5 FALSE {6.35 141.65 6.35 203.65}} \ +# {iso-c5 FALSE {6.35 155.65 6.35 222.65}} \ +# {iso-designated-long FALSE {6.35 103.65 6.35 213.65}} \ +# {jis-b5 FALSE {6.35 175.65 6.35 250.65}} \ +# {monarch-envelope FALSE {6.35 91.948 6.35 184.15}} \ +# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ +# {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}} \ +# {executive FALSE {6.35 177.8 6.35 260.35}} \ +# {iso-a3 FALSE {6.35 290.65 6.35 413.65}} \ +# {iso-a0 FALSE {6.35 834.65 6.35 1182.65}} \ +#} +*plexes-supported: simplex duplex tumble +*printer-model: "GhostScript default model" +# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, +# 940, 1200 and 2440 are supported DPI values, we limit it here +# to some common values: +*printer-resolutions-supported: 300 360 400 600 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional + +# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. +# xp-psddx-download-fonts defines which fonts should be downloaded as outlines +# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") +*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc +# xp-psddx-download-font-type defines which font type is used to download outlines +# (valid values are "bitmap", "pstype1" and "pstype3") +*xp-psddx-download-font-type: pstype1 +# EOF. diff --git a/XpConfig/C/print/models/HPLJ4050-PS/model-config b/XpConfig/C/print/models/HPLJ4050-PS/model-config new file mode 100644 index 000000000..159206de2 --- /dev/null +++ b/XpConfig/C/print/models/HPLJ4050-PS/model-config @@ -0,0 +1,36 @@ +# $Xprint.org: HPLJ4050-PS model-config,v 1.1 2003/12/16 00:48:04 gisburn Exp $ +# model-config for the HP LaserJet 4050 PostScript printer series +# +*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape +*descriptor: Hewlett-Packard LaserJet 4050 PostScript printer +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ + {executive FALSE {6.35 177.80 6.35 260.35}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ +} + +# Duplex unit is optional for HPLJ4050 series +*plexes-supported: simplex +*printer-model: "Hewlett-Packard LaserJet 4050 PostScript printer" +*printer-resolutions-supported: 600 1200 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional + +# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. +# xp-psddx-download-fonts defines which fonts should be downloaded as outlines +# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") +*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc +# xp-psddx-download-font-type defines which font type is used to download outlines +# (valid values are "bitmap", "pstype1" and "pstype3") +*xp-psddx-download-font-type: pstype1 +# EOF. diff --git a/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config b/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config new file mode 100644 index 000000000..1d74b8676 --- /dev/null +++ b/XpConfig/C/print/models/PS2PDFspooldir-GS/model-config @@ -0,0 +1,72 @@ +# $Xprint.org: PS2PDFspooldir-GS model-config,v 1.1 2003/11/20 03:48:04 gisburn Exp $ +# PostScript DDX model-config which converts jobs to PDF via GhostScript's "ps2pdf" +# and then sends them to a spool dir instead to a print queue +# +# This model is basically a cut-down GSdefault model with a custom *xp-spooler-command +# +# DO NOT MODIFY THIS FILE!! +# +# If you want to make customisations for your printer create a copy +# of this printer model. +# Example (for creating a model config "MYCOMPANYlaserxx"): +# 1. Create model config dir: +# % mkdir MYCOMPANYlaserxx +# 2. Link (or copy) the PMF (printer font metrics) for the +# printer buildin fonts: +# % ln -s PS2PDFspooldir-GS/fonts MYCOMPANYlaserxx/. +# 3. Copy the model config file: +# % cp PS2PDFspooldir-GS/model-config MYCOMPANYlaserxx/. +# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. +# +# Attributes supported for this printer model +*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape +*descriptor: PDF job spool dir /tmp/Xprintjobs +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ + {executive FALSE {6.35 177.80 6.35 260.35}}\ + {ledger FALSE {6.35 273.05 6.35 425.45}}\ + {quarto FALSE {6.35 209.55 6.35 268.732}}\ + {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ + {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ + {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ + {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ + {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ + {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ + {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ + {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ +} + +*plexes-supported: simplex duplex tumble +*printer-model: "PDF job spool dir /tmp/Xprintjobs" +# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, +# 940, 1200 and 2440 are supported DPI values, we limit it here +# to some common values: +*printer-resolutions-supported: 300 360 400 600 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional + +# Use custom spooler script which sends the output to a dir instead to a printer queue +# Note that "%xpconfigdir%" is currently only supported in Xprt servers build +# from xprint.mozdev.org sources, other platforms have replace it with the +# absolute path name to the script +*xp-spooler-command: %xpconfigdir%/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh -d /tmp/Xprintjobs -s .pdf -u 077 -p %printer-name% -c %copy-count% -t %job-name% -o "%options%" + +# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. +# xp-psddx-download-fonts defines which fonts should be downloaded as outlines +# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") +*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc +# xp-psddx-download-font-type defines which font type is used to download outlines +# (valid values are "bitmap", "pstype1" and "pstype3") +*xp-psddx-download-font-type: pstype1 +# EOF. diff --git a/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh b/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh new file mode 100755 index 000000000..5739807d8 --- /dev/null +++ b/XpConfig/C/print/models/PS2PDFspooldir-GS/ps2pdf_spooltodir.sh @@ -0,0 +1,130 @@ +#!/bin/sh +PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin +export PATH + +verbose_msgs="false" +DEFAULT_SPOOLDIR=/tmp/Xprintjobs + +usage() +{ + printf "Usage: ${0}: [options]\n" + printf "-v\tbe verbose\n" + printf "-d dirname\tdefine spool dir\n" + printf "-p string\tname of printer selected by user\n" + printf "-c integer\tnumber of copies\n" + printf "-t string\tjob title\n" + printf "-s string\tfile name suffix\n" + printf "-o string\tspooler options\n" + printf "-u mask\tpermission mask for new files (see umask)\n" + exit 2 +} + +verbose() +{ + if ${verbose_msgs} ; then + echo "$1" + fi +} + +spooldir="${DEFAULT_SPOOLDIR}" +printername= +num_job_copies= +job_title= +filename_suffix= +spooler_options= +permmask= +while getopts va:b:d:p:c:t:s:o:u: i +do + case $i in + v) + verbose_msgs="true" + ;; + d) + spooldir="$OPTARG" + ;; + p) + printername="$OPTARG" + ;; + c) + num_job_copies="$OPTARG" + ;; + t) + job_title="$OPTARG" + ;; + s) + filename_suffix="$OPTARG" + ;; + o) + spooler_options="$OPTARG" + ;; + u) + permmask="$OPTARG" + ;; + ?) usage + ;; + esac +done + +verbose "# spooldir=\"$spooldir\"" +verbose "# printername=\"$printername\"" +verbose "# num_job_copies=\"$num_job_copies\"" +verbose "# job_title=\"$job_title\"" +verbose "# spooler_options=\"$spooler_options\"" +verbose "# umask=\"$permmask\"" + +if [ ! -d "${DEFAULT_SPOOLDIR}" ] ; then + mkdir "${DEFAULT_SPOOLDIR}" + chmod a+rwxt "${DEFAULT_SPOOLDIR}" +fi + +if [ "${permmask}" != "" ] ; then + umask ${permmask} +fi + +if [ ! -d "$spooldir" ] ; then + echo "$0: spooldir \"$spooldir\" does not exits." >&2 + exit 1 +fi +if [ ! -w "$spooldir" ] ; then + echo "$0: Cannot write to spooldir \"$spooldir\"." >&2 + exit 1 +fi + +# Create first part of the output file name (prefix and an "unique" +# id(=date and time))... +filename="Xpjob_`date +%Y%m%d%H%M%S`" + +# ... then add options ... +if [ "${printername}" != "" ] ; then + filename="${filename}_${printername}" +fi +if [ "${num_job_copies}" != "" -a "${num_job_copies}" != "1" ] ; then + filename="${filename}_copies_${num_job_copies}" +fi +if [ "${job_title}" != "" ] ; then + filename="${filename}_title_${job_title}" +fi + +# ... mangle output file name and filter chars (like whitespaces) +# which may screw-up further processing by other shell scripts ... +filename="`echo \"${filename}\" | tr '[:blank:]' '_' | tr -c -d '[:alnum:]_.-'`" + +# ... add path and suffix ... +filename="${spooldir}/${filename}${filename_suffix}" + +verbose "# File name is \"$filename\"." + +# ... and finally capture stdin to the file (we are using "gs" directly to +# avoid the problem that "ps2pdf" is not available in all Linux +# distributions by default). +#ps2pdf - - | cat >"${filename}" +gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=-" -dCompatibilityLevel=1.2 -c .setpdfwrite -f - | cat >"${filename}" + +if ${verbose_msgs} ; then + printf "# File is " ; ls -l "${filename}" +fi + +verbose "# Done." + +exit 0 +# EOF. diff --git a/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf new file mode 100644 index 000000000..331178985 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Book.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf new file mode 100644 index 000000000..61bcb22b9 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-BookOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf new file mode 100644 index 000000000..88ccf0834 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf new file mode 100644 index 000000000..45cc8857b Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf b/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf new file mode 100644 index 000000000..ac760fdb9 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Courier-Bold.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf new file mode 100644 index 000000000..8db974018 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Courier-BoldOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf new file mode 100644 index 000000000..87aee16cc Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Courier-Oblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf b/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf new file mode 100644 index 000000000..6109c8c11 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Courier.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf new file mode 100644 index 000000000..30d462d95 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Bold.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf new file mode 100644 index 000000000..89619516f Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-BoldOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf new file mode 100644 index 000000000..2a0de8afc Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Helvetica-Oblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf b/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf new file mode 100644 index 000000000..b1fd475bb Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Helvetica.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf new file mode 100644 index 000000000..aff4b4949 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Book.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf new file mode 100644 index 000000000..b5b77f353 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-BookOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf new file mode 100644 index 000000000..100339854 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-Demi.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf new file mode 100644 index 000000000..a8550e70d Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/LubalinGraph-DemiOblique.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf new file mode 100644 index 000000000..ab22aabf5 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf new file mode 100644 index 000000000..e68811eb7 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf new file mode 100644 index 000000000..390f223cb Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf new file mode 100644 index 000000000..655b9b6c0 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf new file mode 100644 index 000000000..5e786ec42 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Demi.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf new file mode 100644 index 000000000..094b348cc Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-DemiItalic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf new file mode 100644 index 000000000..0bb62bde6 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-Light.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf new file mode 100644 index 000000000..3c19a7fbf Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Souvenir-LightItalic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf b/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf new file mode 100644 index 000000000..48925f816 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Symbol.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf b/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf new file mode 100644 index 000000000..cf46ca03f Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Times-Bold.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf b/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf new file mode 100644 index 000000000..ffe51af80 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Times-BoldItalic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf b/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf new file mode 100644 index 000000000..865433f83 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Times-Italic.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf b/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf new file mode 100644 index 000000000..625e0c43f Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/Times-Roman.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf b/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf new file mode 100644 index 000000000..1ae9a7688 Binary files /dev/null and b/XpConfig/C/print/models/PSdefault/fonts/ZapfDingbats.pmf differ diff --git a/XpConfig/C/print/models/PSdefault/model-config b/XpConfig/C/print/models/PSdefault/model-config new file mode 100644 index 000000000..05a19d859 --- /dev/null +++ b/XpConfig/C/print/models/PSdefault/model-config @@ -0,0 +1,136 @@ +# $Xprint.org: PSdefault model-config,v 1.2 2002/11/07 19:48:04 gisburn Exp $ +# Generic default model-config for the PostScript DDX +# +# DO NOT MODIFY THIS FILE!! +# +# If you want to make customisations for your printer create a copy +# of this printer model. +# Example (for creating a model config "MYCOMPANYlaserxx"): +# 1. Create model config dir: +# % mkdir MYCOMPANYlaserxx +# 2. Link (or copy) the PMF (printer font metrics) for the +# printer buildin fonts: +# % ln -s PSdefault/fonts MYCOMPANYlaserxx/. +# 3. Copy the model config file: +# % cp PSdefault/model-config MYCOMPANYlaserxx/. +# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. +# + +# Attributes supported for this printer model +# You may want to cut the lists here down to the attributes supported +# by your printer. +*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape +*descriptor: PostScript default model +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ + {executive FALSE {6.35 177.80 6.35 260.35}}\ + {folio FALSE {6.35 204.47 6.35 323.85}}\ + {invoice FALSE {6.35 133.35 6.35 209.55}}\ + {ledger FALSE {6.35 273.05 6.35 425.45}}\ + {quarto FALSE {6.35 209.55 6.35 268.732}}\ + {a FALSE {6.35 209.55 6.35 273.05}}\ + {b FALSE {6.35 273.05 6.35 425.45}}\ + {c FALSE {6.35 425.45 6.35 552.45}}\ + {d FALSE {6.35 552.45 6.35 857.25}}\ + {e FALSE {6.35 857.25 6.35 1111.25}}\ + {na-6x9-envelope FALSE {6.35 146.05 6.35 222.25}}\ + {na-10x15-envelope FALSE {6.35 247.65 6.35 374.65}}\ + {monarch-envelope FALSE {6.35 91.948 6.35 184.15}}\ + {na-10x13-envelope FALSE {6.35 247.65 6.35 323.85}}\ + {na-9x12-envelope FALSE {6.35 222.25 6.35 298.45}}\ + {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}}\ + {na-7x9-envelope FALSE {6.35 171.45 6.35 222.25}}\ + {na-9x11-envelope FALSE {6.35 222.25 6.35 273.05}}\ + {na-10x14-envelope FALSE {6.35 247.65 6.35 349.25}}\ + {na-number-9-envelope FALSE {6.35 92.075 6.35 219.075}}\ + {iso-a0 FALSE {6.35 834.65 6.35 1182.65}}\ + {iso-a1 FALSE {6.35 587.65 6.35 834.65}}\ + {iso-a2 FALSE {6.35 413.65 6.35 587.65}}\ + {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ + {iso-a6 FALSE {6.35 98.65 6.35 141.65}}\ + {iso-a7 FALSE {6.35 67.65 6.35 98.65}}\ + {iso-a8 FALSE {6.35 45.65 6.35 67.65}}\ + {iso-a9 FALSE {6.35 30.65 6.35 45.65}}\ + {iso-a10 FALSE {6.35 19.65 6.35 30.65}}\ + {iso-b1 FALSE {6.35 700.65 6.35 993.65}}\ + {iso-b2 FALSE {6.35 493.65 6.35 700.65}}\ + {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ + {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {iso-b6 FALSE {6.35 118.65 6.35 169.65}}\ + {iso-b7 FALSE {6.35 81.65 6.35 118.65}}\ + {iso-b8 FALSE {6.35 55.65 6.35 81.65}}\ + {iso-b9 FALSE {6.35 37.65 6.35 55.65}}\ + {iso-b10 FALSE {6.35 24.65 6.35 37.65}}\ + {jis-b1 FALSE {6.35 721.65 6.35 1023.65}}\ + {jis-b2 FALSE {6.35 508.65 6.35 721.65}}\ + {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ + {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ + {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ + {jis-b6 FALSE {6.35 121.65 6.35 175.65}}\ + {jis-b7 FALSE {6.35 84.65 6.35 121.65}}\ + {jis-b8 FALSE {6.35 57.65 6.35 84.65}}\ + {jis-b9 FALSE {6.35 38.65 6.35 57.65}}\ + {jis-b10 FALSE {6.35 25.65 6.35 38.65}}\ + {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ + {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ + {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ + {iso-c6 FALSE {6.35 107.65 6.35 155.65}}\ + {iso-designated-long FALSE {6.35 103.65 6.35 213.65}}\ + {hp-2x-postcard FALSE {6.35 141.65 6.35 193.65}}\ + {hp-european-edp FALSE {6.35 298.45 6.35 349.25}}\ + {hp-mini FALSE {6.35 133.35 6.35 209.55}}\ + {hp-postcard FALSE {6.35 93.65 6.35 141.65}}\ + {hp-tabloid FALSE {6.35 273.05 6.35 425.45}}\ + {hp-us-edp FALSE {6.35 273.05 6.35 349.25}}\ + {hp-us-government-legal FALSE {6.35 196.85 6.35 323.85}}\ + {hp-us-government-letter FALSE {6.35 196.85 6.35 247.65}}\ +} +# If you have more than one tray use the following example: +# 1. List the supported trays +#*input-trays-supported: main manual +# 2. Define each tray and it's paper sizes +#*medium-source-sizes-supported: \ +#{ main \ +# {na-letter FALSE {6.35 209.55 6.35 273.05}} \ +# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ +# {iso-a4 FALSE {6.35 203.65 6.35 290.65}} \ +#} \ +#{ manual \ +# {iso-a5 FALSE {6.35 141.65 6.35 203.65}} \ +# {iso-c5 FALSE {6.35 155.65 6.35 222.65}} \ +# {iso-designated-long FALSE {6.35 103.65 6.35 213.65}} \ +# {jis-b5 FALSE {6.35 175.65 6.35 250.65}} \ +# {monarch-envelope FALSE {6.35 91.948 6.35 184.15}} \ +# {na-legal FALSE {6.35 209.55 6.35 349.25}} \ +# {na-number-10-envelope FALSE {6.35 98.425 6.35 234.95}} \ +# {executive FALSE {6.35 177.8 6.35 260.35}} \ +# {iso-a3 FALSE {6.35 290.65 6.35 413.65}} \ +# {iso-a0 FALSE {6.35 834.65 6.35 1182.65}} \ +#} +*plexes-supported: simplex duplex tumble +*printer-model: "PostScript default model" +# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, +# 940, 1200 and 2440 are supported DPI values, we limit it here +# to some common values: +*printer-resolutions-supported: 300 360 400 600 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional + +# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. +# xp-psddx-download-fonts defines which fonts should be downloaded as outlines +# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") +*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc +# xp-psddx-download-font-type defines which font type is used to download outlines +# (valid values are "bitmap", "pstype1" and "pstype3") +*xp-psddx-download-font-type: pstype1 +# EOF. diff --git a/XpConfig/C/print/models/PSspooldir/model-config b/XpConfig/C/print/models/PSspooldir/model-config new file mode 100644 index 000000000..6bb477767 --- /dev/null +++ b/XpConfig/C/print/models/PSspooldir/model-config @@ -0,0 +1,71 @@ +# $Xprint.org: PSspooldir model-config,v 1.1 2002/11/25 19:48:04 gisburn Exp $ +# PostScript DDX model-config which sends jobs to a spool dir instead to a print queue +# +# This model is basically a cut-down PSdefault model with a custom *xp-spooler-command +# +# DO NOT MODIFY THIS FILE!! +# +# If you want to make customisations for your printer create a copy +# of this printer model. +# Example (for creating a model config "MYCOMPANYlaserxx"): +# 1. Create model config dir: +# % mkdir MYCOMPANYlaserxx +# 2. Link (or copy) the PMF (printer font metrics) for the +# printer buildin fonts: +# % ln -s PSspooldir/fonts MYCOMPANYlaserxx/. +# 3. Copy the model config file: +# % cp PSspooldir/model-config MYCOMPANYlaserxx/. +# 4. Customize MYCOMPANYlaserxx/model-config to match your needs. +# +# Attributes supported for this printer model +*content-orientations-supported: portrait landscape reverse-portrait reverse-landscape +*descriptor: PostScript job spool dir /tmp/Xprintjobs +*document-formats-supported: {POSTSCRIPT 2} +*input-trays-supported: +*medium-source-sizes-supported: \ +{ '' \ + {na-letter FALSE {6.35 209.55 6.35 273.05}}\ + {na-legal FALSE {6.35 209.55 6.35 349.25}}\ + {executive FALSE {6.35 177.80 6.35 260.35}}\ + {ledger FALSE {6.35 273.05 6.35 425.45}}\ + {quarto FALSE {6.35 209.55 6.35 268.732}}\ + {iso-a3 FALSE {6.35 290.65 6.35 413.65}}\ + {iso-a4 FALSE {6.35 203.65 6.35 290.65}}\ + {iso-a5 FALSE {6.35 141.65 6.35 203.65}}\ + {iso-b3 FALSE {6.35 346.65 6.35 493.65}}\ + {iso-b4 FALSE {6.35 243.65 6.35 346.65}}\ + {iso-b5 FALSE {6.35 169.65 6.35 243.65}}\ + {jis-b3 FALSE {6.35 357.65 6.35 508.65}}\ + {jis-b4 FALSE {6.35 250.65 6.35 357.65}}\ + {jis-b5 FALSE {6.35 175.65 6.35 250.65}}\ + {iso-c3 FALSE {6.35 317.65 6.35 451.65}}\ + {iso-c4 FALSE {6.35 222.65 6.35 317.65}}\ + {iso-c5 FALSE {6.35 155.65 6.35 222.65}}\ +} + +*plexes-supported: simplex duplex tumble +*printer-model: "PostScript job spool dir /tmp/Xprintjobs" +# 75, 100, 120, 150, 180, 200, 240, 300, 360, 400, 600, 720, +# 940, 1200 and 2440 are supported DPI values, we limit it here +# to some common values: +*printer-resolutions-supported: 300 360 400 600 +*xp-ddx-identifier: XP-POSTSCRIPT +*xp-listfonts-modes-supported: xp-list-internal-printer-fonts xp-list-glyph-fonts +*xp-embedded-formats-supported: {POSTSCRIPT 2} +*xp-raw-formats-supported: {POSTSCRIPT 2} +*xp-setup-proviso: setup-optional + +# Use custom spooler script which sends the output to a dir instead to a printer queue +# Note that "%xpconfigdir%" is currently only supported in Xprt servers build +# from xprint.mozdev.org sources, other platforms have replace it with the +# absolute path name to the script +*xp-spooler-command: %xpconfigdir%/C/print/models/PSspooldir/spooltodir.sh -d /tmp/Xprintjobs -s .ps -u 077 -p %printer-name% -c %copy-count% -t %job-name% -o "%options%" + +# NOTE: xp-psddx-* attributes are EXPERIMENTAL for now. +# xp-psddx-download-fonts defines which fonts should be downloaded as outlines +# (valid types are "pfa", "pfb", "ttf", "ttc", "otf", "otc") +*xp-psddx-download-fonts: pfa pfb ttf ttc otf otc +# xp-psddx-download-font-type defines which font type is used to download outlines +# (valid values are "bitmap", "pstype1" and "pstype3") +*xp-psddx-download-font-type: pstype1 +# EOF. diff --git a/XpConfig/C/print/models/PSspooldir/spooltodir.sh b/XpConfig/C/print/models/PSspooldir/spooltodir.sh new file mode 100755 index 000000000..aba14e1b3 --- /dev/null +++ b/XpConfig/C/print/models/PSspooldir/spooltodir.sh @@ -0,0 +1,127 @@ +#!/bin/sh +PATH=/usr/bin:/usr/sbin:/bin:/sbin +export PATH + +verbose_msgs="false" +DEFAULT_SPOOLDIR=/tmp/Xprintjobs + +usage() +{ + printf "Usage: ${0}: [options]\n" + printf "-v\tbe verbose\n" + printf "-d dirname\tdefine spool dir\n" + printf "-p string\tname of printer selected by user\n" + printf "-c integer\tnumber of copies\n" + printf "-t string\tjob title\n" + printf "-s string\tfile name suffix\n" + printf "-o string\tspooler options\n" + printf "-u mask\tpermission mask for new files (see umask)\n" + exit 2 +} + +verbose() +{ + if ${verbose_msgs} ; then + echo "$1" + fi +} + +spooldir="${DEFAULT_SPOOLDIR}" +printername= +num_job_copies= +job_title= +filename_suffix= +spooler_options= +permmask= +while getopts va:b:d:p:c:t:s:o:u: i +do + case $i in + v) + verbose_msgs="true" + ;; + d) + spooldir="$OPTARG" + ;; + p) + printername="$OPTARG" + ;; + c) + num_job_copies="$OPTARG" + ;; + t) + job_title="$OPTARG" + ;; + s) + filename_suffix="$OPTARG" + ;; + o) + spooler_options="$OPTARG" + ;; + u) + permmask="$OPTARG" + ;; + ?) usage + ;; + esac +done + +verbose "# spooldir=\"$spooldir\"" +verbose "# printername=\"$printername\"" +verbose "# num_job_copies=\"$num_job_copies\"" +verbose "# job_title=\"$job_title\"" +verbose "# spooler_options=\"$spooler_options\"" +verbose "# umask=\"$permmask\"" + +if [ ! -d "${DEFAULT_SPOOLDIR}" ] ; then + mkdir "${DEFAULT_SPOOLDIR}" + chmod a+rwxt "${DEFAULT_SPOOLDIR}" +fi + +if [ "${permmask}" != "" ] ; then + umask ${permmask} +fi + +if [ ! -d "$spooldir" ] ; then + echo "$0: spooldir \"$spooldir\" does not exits." >&2 + exit 1 +fi +if [ ! -w "$spooldir" ] ; then + echo "$0: Cannot write to spooldir \"$spooldir\"." >&2 + exit 1 +fi + +# Create first part of the output file name (prefix and an "unique" +# id(=date and time))... +filename="Xpjob_`date +%Y%m%d%H%M%S`" + +# ... then add options ... +if [ "${printername}" != "" ] ; then + filename="${filename}_${printername}" +fi +if [ "${num_job_copies}" != "" -a "${num_job_copies}" != "1" ] ; then + filename="${filename}_copies_${num_job_copies}" +fi +if [ "${job_title}" != "" ] ; then + filename="${filename}_title_${job_title}" +fi + +# ... mangle output file name and filter chars (like whitespaces) +# which may screw-up further processing by other shell scripts ... +filename="`echo \"${filename}\" | tr '[:blank:]' '_' | tr -c -d '[:alnum:]_.-'`" + +# ... add path and suffix ... +filename="${spooldir}/${filename}${filename_suffix}" + +verbose "# File name is \"$filename\"." + +# ... and finally capture stdin to the file. +cat >"${filename}" + +if ${verbose_msgs} ; then + printf "# File is " ; ls -l "${filename}" +fi + +verbose "# Done." + +exit 0 +# EOF. diff --git a/XpConfig/en_US/print/attributes/document b/XpConfig/en_US/print/attributes/document new file mode 100644 index 000000000..253c46bce --- /dev/null +++ b/XpConfig/en_US/print/attributes/document @@ -0,0 +1,13 @@ +# $Xorg: document,v 1.2 2002/11/30 22:10:03 gisburn Exp $ +# Document DPA-Object initial attribute values for en_US(-like) locales +# +# Note that the defaults (for all locales) are set in +# ${XPCONFIGDIR}/C/print/attributes/document +# Values in ${XPCONFIGDIR}/${LANG}/print/attributes/document are used to +# set/override these defaults for a specific locale on demand + +# US and some other countries use US-Letter as default paper size +# ("C"-locale default is "ISO-A4") +*default-medium: na-letter + +# EOF. diff --git a/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh b/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh new file mode 100644 index 000000000..3fb6bba7c --- /dev/null +++ b/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh @@ -0,0 +1,30 @@ +#!/bin/sh +##################################################################### +### File: 0018.xprint +### +### Default Location: /usr/dt/config/Xsession.d/ +### +### Purpose: Setup Xprint env vars +### +### Description: This script is invoked by means of the Xsession file +### at user login. +### +### Invoked by: /usr/dt/bin/Xsession +### +### (c) Copyright 2003-2004 Roland Mainz +### +### please send bugfixes or comments to http://xprint.mozdev.org/ +### +##################################################################### + + +# +# Obtain list of Xprint servers +# + +if [ -f "/etc/init.d/xprint" ] ; then + XPSERVERLIST="`/bin/sh /etc/init.d/xprint get_xpserverlist`" + export XPSERVERLIST +fi + +########################## eof ##################### diff --git a/Xprint/etc/profile.d/xprint.csh b/Xprint/etc/profile.d/xprint.csh new file mode 100644 index 000000000..7cc675840 --- /dev/null +++ b/Xprint/etc/profile.d/xprint.csh @@ -0,0 +1,16 @@ +# +# /etc/profile.d/xprint.csh +# +# Copyright (c) 2002-2004 by Roland Mainz +# please send bugfixes or comments to http://xprint.mozdev.org/ + + +# +# Obtain list of Xprint servers +# + +if ( -f /etc/init.d/xprint ) then + setenv XPSERVERLIST "`/bin/sh /etc/init.d/xprint get_xpserverlist`" +endif + +# /etc/profile.d/xprint.csh ends here. diff --git a/Xprint/etc/profile.d/xprint.sh b/Xprint/etc/profile.d/xprint.sh new file mode 100644 index 000000000..b5b46c1e7 --- /dev/null +++ b/Xprint/etc/profile.d/xprint.sh @@ -0,0 +1,16 @@ +# +# /etc/profile.d/xprint.sh +# +# Copyright (c) 2002-2004 by Roland Mainz +# please send bugfixes or comments to http://xprint.mozdev.org/ + +# +# Obtain list of Xprint servers +# + +if [ -f "/etc/init.d/xprint" ] ; then + XPSERVERLIST="`/bin/sh /etc/init.d/xprint get_xpserverlist`" + export XPSERVERLIST +fi + +# /etc/profile.d/xprint.sh ends here. diff --git a/Xprint/ps/PsFTFonts.c b/Xprint/ps/PsFTFonts.c new file mode 100644 index 000000000..cfdee93d1 --- /dev/null +++ b/Xprint/ps/PsFTFonts.c @@ -0,0 +1,80 @@ + +/* +Copyright (c) 2003-2004 Roland Mainz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include +#include +#include + +#include "regionstr.h" +#include "fontstruct.h" +#include "dixfontstr.h" +#include "scrnintstr.h" +#include "fontxlfd.h" +#include "fntfil.h" +#include "fntfilst.h" + +#include "Ps.h" + +#include +#include FT_FREETYPE_H + +#include "ft.h" +#include "ftfuncs.h" + +char * +PsGetFTFontFileName(FontPtr pFont) +{ + FTFontPtr tf = (FTFontPtr)pFont->fontPrivate; + return tf->instance->face->filename; +} + +Bool +PsIsFreeTypeFont(FontPtr pFont) +{ + int i; + int nprops = pFont->info.nprops; + FontPropPtr props = pFont->info.props; + /* "RASTERIZER_NAME" must match the rasterizer name set in + * xc/lib/font/FreeType/ftfuncs.c */ + Atom name = MakeAtom("RASTERIZER_NAME", 15, True); + Atom value = (Atom)0; + char *rv; + + for( i=0 ; i + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include +#include +#include "os.h" +#define USE_PSOUT_PRIVATE 1 +#include "psout.h" + +#include +#include FT_FREETYPE_H +#include FT_TYPE1_TABLES_H + +#include "Xproto.h" +#include "font.h" +#include "fontstruct.h" +#include "fntfilst.h" +#include "fontutil.h" +#include "fontenc.h" +#include "ft.h" +#include "ftfuncs.h" +#include "servermd.h" /* needed for endian test (IMAGE_BYTE_ORDER) */ + +#define USE_FT_PS_NAMES 1 + +#ifdef USE_FT_PS_NAMES +void PsOut_Get_FreeType_Glyph_Name( char *destbuf, FontPtr pFont, unsigned long x11fontindex) +{ + FTFontPtr tf = (FTFontPtr)pFont->fontPrivate; + FT_Face ttface = tf->instance->face->face; + FT_Error error; + char buf[256]; + unsigned long ftindex; + + /* Remap X11 font index to FreeType font index */ + ftindex = FTRemap(ttface, &tf->mapping, x11fontindex); + + if( FT_Has_PS_Glyph_Names(ttface) ) + { + error = FT_Get_Glyph_Name(ttface, ftindex, buf, 64); + } + else + { + error = 1; + } + + if( error ) + { + /* Check for unicode mapping + * See Adobe document "Unicode and Glyph Names" + * (http://partners.adobe.com/asn/tech/type/unicodegn.jsp) + */ + if( (tf->mapping.mapping->type == FONT_ENCODING_UNICODE) && + (ftindex < 0xFFFE) ) + { + sprintf(buf, "uni%04lx", ftindex); + } + else + { + sprintf(buf, "ch%02lx", ftindex); + } + } + + strcpy(destbuf, buf); +} +#endif /* USE_FT_PS_NAMES */ + +int PsOut_DownloadFreeType(PsOutPtr self, PsFTDownloadFontType downloadfonttype, const char *psfontname, FontPtr pFont, long block_offset) +{ + switch(downloadfonttype) + { + case PsFontType3: + return PsOut_DownloadFreeType3(self, psfontname, pFont, block_offset); + case PsFontType1: + return PsOut_DownloadFreeType1(self, psfontname, pFont, block_offset); + default: + FatalError("PS DDX: PsOut_DownloadFreeType(downloadfonttype='%d' not implemented\n", + (int)downloadfonttype); + return 0; /* NO-OP, FatalError() will call |exit()| */ + } +} + +/* cloned from |PsOut_TextAttrs16| */ +void +PsOut_FreeType_TextAttrs16(PsOutPtr self, char *fnam, int siz, int iso) +{ + int i; + if( self->FontName && strcmp(fnam, self->FontName)==0 && + siz==self->FontSize ) return; + if( self->FontName ) xfree(self->FontName); + self->FontName = (char *)xalloc(strlen(fnam)+1); + strcpy(self->FontName, fnam); + self->FontSize = siz; + for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; +} + +/* cloned from |PsOut_TextAttrsMtx16| */ +void +PsOut_FreeType_TextAttrsMtx16(PsOutPtr self, char *fnam, float *mtx, int iso) +{ + int i; + if( self->FontName && strcmp(fnam, self->FontName)==0 && + mtx[0]==self->FontMtx[0] && mtx[1]==self->FontMtx[1] && + mtx[2]==self->FontMtx[2] && mtx[3]==self->FontMtx[3] ) return; + if( self->FontName ) xfree(self->FontName); + self->FontName = (char *)xalloc(strlen(fnam)+1); + strcpy(self->FontName, fnam); + for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = mtx[i]; + self->FontSize = -1; +} + +static +int FT_Get_CharcellMetricsCharacterHeight(FontPtr pFont) +{ + FTFontPtr ftfont = (FTFontPtr)pFont->fontPrivate; + + return ftfont->instance->charcellMetrics->ascent + + ftfont->instance->charcellMetrics->descent; +} + +static +int FT_Get_CharcellMetricsCharacterWidth(FontPtr pFont) +{ + FTFontPtr ftfont = (FTFontPtr)pFont->fontPrivate; + + if( ftfont->instance->spacing != FT_PROPORTIONAL ) + { + int width = ftfont->instance->charcellMetrics->characterWidth; + + /* If the font uses a matrix make sure we transform the |characterWidth| + * back to it's original value since we download the untransformed font + * and use a PostScript transformation matrix to transform the font when + * rendering the text + */ + if( ftfont->instance->transformation.nonIdentity ) + { + FT_Vector v; + + FT_Matrix m = ftfont->instance->transformation.matrix; + (void)FT_Matrix_Invert(&m); /* FixMe: We should check the return code */ + v.x = width; + v.y = FT_Get_CharcellMetricsCharacterHeight(pFont); + FT_Vector_Transform(&v, &m); + width = v.x; + } + + return width; + } + + return 0; +} + +void +PsOut_FreeType_Text(FontPtr pFont, PsOutPtr self, int x, int y, char *text, int textl) +{ + int i; + int xo = self->XOff, + yo = self->YOff; + char buf[256]; + int cwidth = FT_Get_CharcellMetricsCharacterWidth(pFont); + + if( self->InFrame || self->InTile ) xo = yo = 0; + x += xo; y += yo; + + S_OutNum(self, (float)x); + S_OutNum(self, (float)y); + S_OutTok(self, "moveto", 1); + + S_OutTok(self, "[ ", 0); + + for( i = 0 ; i < textl ; i++ ) + { +#ifdef USE_FT_PS_NAMES + char namebuf[256]; + unsigned int ch = text[i]&0xFF; + unsigned long block_offset = 0; + PsOut_Get_FreeType_Glyph_Name(namebuf, pFont, ch+block_offset); + + sprintf(buf, "/%s ", namebuf); +#else + sprintf(buf, "/ch%02x ", text[i]&0xFF); +#endif /* USE_FT_PS_NAMES */ + S_OutTok(self, buf, 0); + } + + /* Check whether we have any special spacing requirements (e.g. non-proportional fonts) ... */ + if( cwidth != 0 ) + { + /* If the we use a matrix to render the font (instead of using |self->FontSize|) + * we must apply the matrix to the "rmoveto" which is used to force the exact + * character width. The "trmoveto" macro will do that for us... + */ + if( self->FontSize == -1 ) + { + sprintf(buf, "]{gs glyphshow gr %d 0 trmoveto}fa", cwidth); + } + else + { + sprintf(buf, "]{gs glyphshow gr %d 0 rm}fa", cwidth); + } + } + else + { + sprintf(buf, "]{glyphshow}fa"); + } + S_OutTok(self, buf, 0); +} + +/* XXX: |PsOut_FreeType_Text16| should be rewritten - currently it uses lame, + * slow hacks and makes some risky assumtions about how |PsOut_Text16| + * allocates memory */ +void +PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short *text, int textl) +{ + int i; + int xo = self->XOff, + yo = self->YOff; + unsigned short c, + c_hiByte, + c_lowByte, + fontPage; + long lastFontPage = -1; + char baseFontName[256]; + char buf[256]; + + if( self->InFrame || self->InTile ) xo = yo = 0; + x += xo; y += yo; + + strcpy(baseFontName, self->FontName); + + S_OutNum(self, (float)x); + S_OutNum(self, (float)y); + S_OutTok(self, "moveto", 1); + + for( i = 0 ; i < textl ; i++ ) + { + c = text[i]; +#if IMAGE_BYTE_ORDER == LSBFirst + c_hiByte = c & 0x00FF; + c_lowByte = (c >> 8) & 0x00FF; +#elif IMAGE_BYTE_ORDER == MSBFirst + c_hiByte = (c >> 8) & 0x00FF; + c_lowByte = c & 0x00FF; +#else +#error Unsupported byte order +#endif + fontPage = c_hiByte; + + if( fontPage != lastFontPage ) + { + if( fontPage > 0 ) + { + sprintf(buf, "%s_%x", baseFontName, fontPage); + } + else + { + sprintf(buf, "%s", baseFontName); + } + + if( self->FontSize == -1 ) + { + PsOut_TextAttrsMtx(self, buf, self->FontMtx, FALSE); + } + else + { + PsOut_TextAttrs(self, buf, self->FontSize, FALSE); + } + lastFontPage = fontPage; + } + +#ifdef USE_FT_PS_NAMES + { + char namebuf[256]; + unsigned int ch = c_lowByte; + unsigned long block_offset = c_hiByte * 0x100 /* same as c_hiByte << 8 */; + int cwidth = FT_Get_CharcellMetricsCharacterWidth(pFont); + PsOut_Get_FreeType_Glyph_Name(namebuf, pFont, ch+block_offset); + + /* Check whether we have any special spacing requirements (e.g. non-proportional fonts) ... */ + if( cwidth != 0 ) + { + /* If the we use a matrix to render the font (instead of using |self->FontSize|) + * we must apply the matrix to the "rmoveto" which is used to force the exact + * character width. The "trmoveto" macro will do that for us... + */ + if( self->FontSize == -1 ) + { + sprintf(buf, "gs /%s glyphshow gr %d 0 trmoveto", namebuf, cwidth); + } + else + { + sprintf(buf, "gs /%s glyphshow gr %d 0 rm", namebuf, cwidth); + } + } + else + { + sprintf(buf, "/%s glyphshow", namebuf); + } + } +#else + sprintf(buf, "/ch%02x glyphshow", c_lowByte); +#endif /* USE_FT_PS_NAMES */ + S_OutTok(self, buf, 1); + } + + if( self->FontName ) xfree(self->FontName); + self->FontName = (char *)xalloc(strlen(baseFontName)+1); + strcpy(self->FontName, baseFontName); +} + diff --git a/Xprint/ps/psout_ftpstype1.c b/Xprint/ps/psout_ftpstype1.c new file mode 100644 index 000000000..a9b0cfe86 --- /dev/null +++ b/Xprint/ps/psout_ftpstype1.c @@ -0,0 +1,180 @@ + +/* +Copyright (c) 2003-2004 Roland Mainz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + + +#include +#include +#include +#include + +#include "os.h" +#define USE_PSOUT_PRIVATE 1 +#include "psout.h" + +#include +#include FT_FREETYPE_H + +#include "Xproto.h" +#include "font.h" +#include "fontstruct.h" +#include "fntfilst.h" +#include "fontutil.h" +#include "fontenc.h" +#include "ft.h" +#include "ftfuncs.h" + +int do_debug_ft2pt1 = FALSE; +int do_enable_ft2pt1_optimizer = FALSE; + +/* Defined in ttf2pt1.c */ +int ft2pt1_main(int argc, char **argv, + FTFontPtr tf, const char *download_psfontname, unsigned long download_font_block_offset); + +/* Download FreeType outlines as PS Type1 font */ +int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset) +{ + FTFontPtr tf; + FT_Face face; + int ft2pt1_numargs = 0; + char *ft2pt1_args[40]; + char *pstype1filename_prefix; + char pstype1filename[PATH_MAX+1]; + int ft2pt1_main_retval; + pid_t childpid; + + tf = (FTFontPtr)pFont->fontPrivate; + face = tf->instance->face->face; + + /* Set debugging flags */ + do_debug_ft2pt1 = (getenv("XPRT_PSDDX_DO_DEBUG_FT2PT1") != NULL); + do_enable_ft2pt1_optimizer = (getenv("XPRT_PSDDX_DO_ENABLE_FT2PT1_OPTIMIZER") != NULL); + + if( do_debug_ft2pt1 ) + { + fprintf(stderr, "# Converting FT2 font to PS Type1 filename='%s', ttface=%lx\n", tf->instance->face->filename, (long)face); + } + + pstype1filename_prefix = tempnam(NULL, "Xprt_"); + + ft2pt1_args[ft2pt1_numargs] = "ft2pt1"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-Ob"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-e"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-a"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-Ga"; ft2pt1_numargs++; + if( do_enable_ft2pt1_optimizer ) + { + /* Scale fonts to a 1000x1000 matrix */ + ft2pt1_args[ft2pt1_numargs] = "-Ot"; ft2pt1_numargs++; + } + else + { + /* Disable the ttf2pt1 optimisations */ + ft2pt1_args[ft2pt1_numargs] = "-Ou"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-Oo"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-Os"; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = "-Oh"; ft2pt1_numargs++; + } + + if( !do_debug_ft2pt1 ) + { + ft2pt1_args[ft2pt1_numargs] = "-W 0"; ft2pt1_numargs++; + } + ft2pt1_args[ft2pt1_numargs] = tf->instance->face->filename; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = pstype1filename_prefix; ft2pt1_numargs++; + ft2pt1_args[ft2pt1_numargs] = NULL; + +/* XXX: ttf2pt1 has lots of leaks and global vars which are not cleaned-up + * As long this problem exists we will simply fork() and call the converter + * from the child process (all resources are free'ed when the child process + * exists) as a workaround. + */ +#define FT2PT1_NEEDS_SEPERATE_PROCESS 1 + +#ifdef FT2PT1_NEEDS_SEPERATE_PROCESS + /* Flush internal buffer and then the stdio stream before fork()! */ + S_Flush(self); + fflush(self->Fp); + + childpid = fork(); + switch(childpid) + { + case -1: + FatalError("PS DDX internal error: Cannot fork() converter child process, errno=%d\n", (int)errno); + break; + case 0: /* child */ + fclose(self->Fp); + self->Fp = NULL; + + ft2pt1_main_retval = ft2pt1_main(ft2pt1_numargs, ft2pt1_args, tf, psfontname, block_offset); + if( do_debug_ft2pt1 ) + { + fprintf(stderr, "## ft2pt1_main returned %d (child)\n", ft2pt1_main_retval); + } + exit(ft2pt1_main_retval); + break; + default: /* parent */ + waitpid(childpid, &ft2pt1_main_retval, 0); + break; + } + + if( do_debug_ft2pt1 ) + { + fprintf(stderr, "## ft2pt1_main returned %d (parent)\n", ft2pt1_main_retval); + } +#else + S_Flush(self); + + ft2pt1_main_retval = ft2pt1_main(ft2pt1_numargs, ft2pt1_args, tf, psfontname, block_offset); + if( do_debug_ft2pt1 ) + { + fprintf(stderr, "## ft2pt1_main returned %d (child)\n", ft2pt1_main_retval); + } +#endif /* FT2PT1_NEEDS_SEPERATE_PROCESS */ + + if( ft2pt1_main_retval != EXIT_SUCCESS ) + { + FatalError("PS DDX internal error while converting FreeType font '%s' to PS Type1, error=%d\n", + tf->instance->face->filename, ft2pt1_main_retval); + } + + sprintf(pstype1filename, "%s.pfa", pstype1filename_prefix); + if( do_debug_ft2pt1 ) + { + fprintf(stderr, "# Downloading converted FT2/PS Type1 filename='%s'\n", pstype1filename); + } + + PsOut_DownloadType1(self, "PsOut_DownloadFreeType1", psfontname, pstype1filename); + + if( !do_debug_ft2pt1 ) + { + unlink(pstype1filename); + } + + free(pstype1filename_prefix); + + S_Flush(self); + + return 0; +} + + diff --git a/Xprint/ps/psout_ftpstype3.c b/Xprint/ps/psout_ftpstype3.c new file mode 100644 index 000000000..bceb1d479 --- /dev/null +++ b/Xprint/ps/psout_ftpstype3.c @@ -0,0 +1,463 @@ + +/* +Copyright (c) 2003-2004 Roland Mainz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include +#include +#include "os.h" +#define USE_PSOUT_PRIVATE 1 +#include "psout.h" + +#include +#include FT_FREETYPE_H +#include FT_TRUETYPE_TABLES_H +#include FT_BBOX_H +#include FT_GLYPH_H + +#include FT_CONFIG_CONFIG_H +#include FT_CONFIG_OPTIONS_H +#include FT_ERRORS_H +#include FT_SYSTEM_H +#include FT_IMAGE_H +#include FT_TYPES_H +#include FT_OUTLINE_H +#include FT_MODULE_H +#include FT_RENDER_H +#include FT_TYPE1_TABLES_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_CACHE_H +#include FT_CACHE_IMAGE_H +#include FT_CACHE_SMALL_BITMAPS_H +#include FT_MULTIPLE_MASTERS_H +#include FT_SFNT_NAMES_H + +#define USE_FT_INTERNALS 1 +#ifdef USE_FT_INTERNALS +#include FT_INTERNAL_TYPE1_TYPES_H +#include "t42types.h" +#include FT_INTERNAL_OBJECTS_H +#endif /* USE_FT_INTERNALS */ + +#include "Xproto.h" +#include "font.h" +#include "fontstruct.h" +#include "fntfilst.h" +#include "fontutil.h" +#include "fontenc.h" +#include "ft.h" +#include "ftfuncs.h" + +struct ft2info +{ + FontPtr pFont; + FTFontPtr tf; + FT_Face ttface; + struct + { + char *full_name; + char *copyright; + char *family; + char *subfamily; + char *version; + } nameid; + TT_Postscript *ttpostscript; + TT_Header *ttheader; +}; + +/* Local prototypes */ +static FT_Error PSType3_createOutlineGlyphs(FILE *out, struct ft2info *ti, unsigned long unicode, const char *psglyphname); +static int PSType3_generateOutlineFont(FILE *out, const char *psfontname, struct ft2info *ti, long block_offset); + +extern FT_Library ftypeLibrary; /* defined in xc/lib/font/FreeType/ftfuncs.c */ + +#define USE_FT_PS_NAMES 1 + +static +FT_Error PSType3_createOutlineGlyphs( FILE *out, struct ft2info *ti, unsigned long x11fontindex, const char *psglyphname ) +{ + unsigned long ftindex; + FT_BBox bbox; + FT_Error error; + FT_Outline outline; + + /* Remap X11 font index to FreeType font index */ + ftindex = FTRemap(ti->ttface, &ti->tf->mapping, x11fontindex); + + error = FT_Load_Glyph(ti->ttface, ftindex, (FT_LOAD_NO_BITMAP | FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING)); + if( error ) + { + fprintf(stderr, "PSType3_createOutlineGlyphs: FT_Load_Glyph() failure, error=%d\n", (int)error); + return error; + } + + outline = ti->ttface->glyph->outline; + + FT_Outline_Get_CBox(&outline, &bbox); + + fprintf(out, "/%s {\n", psglyphname); + fprintf(out, "%ld 0 %ld %ld %ld %ld setcachedevice\n", + (signed long)ti->ttface->glyph->metrics.horiAdvance, + (long)bbox.xMin, + (long)bbox.yMin, + (long)bbox.xMax, + (long)bbox.yMax); + + if( outline.n_contours > 0 ) + { + long i, + j, + k, k1, + cs, ce, + nguide, + contour_start, + contour_end, + last_point; + Bool first; + FT_Vector *vec; + + contour_start = ce = 0; + + vec = outline.points; + last_point = outline.n_points; + + i = j = k = 0; + first = TRUE; + + while( i <= outline.contours[outline.n_contours - 1] ) + { + contour_end = outline.contours[j]; + + if( first ) + { + fprintf(out, "%ld %ld moveto\n", vec[i].x, vec[i].y); + contour_start = i; + first = FALSE; + } + else if( outline.tags[i] & FT_CURVE_TAG_ON ) + { + fprintf(out, "%ld %ld lineto\n", vec[i].x, vec[i].y); + } + else + { + Bool finished = FALSE; + + cs = i-1; + nguide = 0; + while( !finished ) + { + if( i == contour_end+1 ) + { + ce = contour_start; + finished = TRUE; + } + else if( outline.tags[i] & FT_CURVE_TAG_ON ) + { + ce = i; + finished = TRUE; + } + else + { + i++; + nguide++; + } + } + + switch( nguide ) + { + case 0: + fprintf(out, "%ld %ld lineto\n", vec[ce].x, vec[ce].y); + break; + + case 1: + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[cs].x+2*vec[cs+1].x)/3, + (vec[cs].y+2*vec[cs+1].y)/3, + (2*vec[cs+1].x+vec[ce].x)/3, + (2*vec[cs+1].y+vec[ce].y)/3, + vec[ce].x, vec[ce].y); + break; + + case 2: + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (-vec[cs].x+4*vec[cs+1].x)/3, + (-vec[cs].y+4*vec[cs+1].y)/3, + (4*vec[cs+2].x-vec[ce].x)/3, + (4*vec[cs+2].y-vec[ce].y)/3, + vec[ce].x, vec[ce].y); + break; + + case 3: + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[cs].x+2*vec[cs+1].x)/3, + (vec[cs].y+2*vec[cs+1].y)/3, + (5*vec[cs+1].x+vec[cs+2].x)/6, + (5*vec[cs+1].y+vec[cs+2].y)/6, + (vec[cs+1].x+vec[cs+2].x)/2, + (vec[cs+1].y+vec[cs+2].y)/2); + + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[cs+1].x+5*vec[cs+2].x)/6, + (vec[cs+1].y+5*vec[cs+2].y)/6, + (5*vec[cs+2].x+vec[cs+3].x)/6, + (5*vec[cs+2].y+vec[cs+3].y)/6, + (vec[cs+3].x+vec[cs+2].x)/2, + (vec[cs+3].y+vec[cs+2].y)/2); + + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[cs+2].x+5*vec[cs+3].x)/6, + (vec[cs+2].y+5*vec[cs+3].y)/6, + (2*vec[cs+3].x+vec[ce].x)/3, + (2*vec[cs+3].y+vec[ce].y)/3, + vec[ce].x, vec[ce].y); + break; + + default: /* anything |nguide > 3| */ + k1 = cs + nguide; + + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[cs].x+2*vec[cs+1].x)/3, + (vec[cs].y+2*vec[cs+1].y)/3, + (5*vec[cs+1].x+vec[cs+2].x)/6, + (5*vec[cs+1].y+vec[cs+2].y)/6, + (vec[cs+1].x+vec[cs+2].x)/2, + (vec[cs+1].y+vec[cs+2].y)/2); + + for( k = cs+2 ; k <= k1-1 ; k++ ) + { + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[k-1].x+5*vec[k].x)/6, + (vec[k-1].y+5*vec[k].y)/6, + (5*vec[k].x+vec[k+1].x)/6, + (5*vec[k].y+vec[k+1].y)/6, + (vec[k].x+vec[k+1].x)/2, + (vec[k].y+vec[k+1].y)/2); + } + + fprintf(out, "%ld %ld %ld %ld %ld %ld curveto\n", + (vec[k1-1].x+5*vec[k1].x)/6, + (vec[k1-1].y+5*vec[k1].y)/6, + (2*vec[k1].x+vec[ce].x)/3, + (2*vec[k1].y+vec[ce].y)/3, + vec[ce].x, vec[ce].y); + break; + } + } + + if( i >= contour_end ) + { + fprintf(out, "closepath\n"); + first = TRUE; + i = contour_end + 1; + j++; + } + else + { + i++; + } + } + } + + fprintf(out, "fill } bind def\n"); + + return 0; +} + +#ifdef USE_FT_INTERNALS +static FT_BBox * +FT_Get_PS_Font_BBox( FT_Face face ) +{ + const char *driver_name; + FT_BBox *font_bbox = NULL; + + if ( face && face->driver && face->driver->root.clazz ) + { + driver_name = face->driver->root.clazz->module_name; + if ( ft_strcmp( driver_name, "type1" ) == 0 ) + font_bbox = &(((T1_Face)face)->type1.font_bbox); + else if ( ft_strcmp( driver_name, "t1cid" ) == 0 ) + font_bbox = &(((CID_Face)face)->cid.font_bbox); + else if ( ft_strcmp( driver_name, "type42" ) == 0 ) + font_bbox = &(((T42_Face)face)->type1.font_bbox); + } + + return font_bbox; +} +#endif /* USE_FT_INTERNALS */ + +static +int PSType3_generateOutlineFont(FILE *out, const char *psfontname, struct ft2info *ti, long block_offset) +{ + long i; + double scaler; + const int numchars = 256; +#ifdef USE_FT_PS_NAMES + int linewidth = 0; +#endif /* USE_FT_PS_NAMES */ + + fprintf(out, "%%%%BeginFont: %s\n", psfontname); + fprintf(out, "22 dict begin\n"); + fprintf(out, "/FontType 3 def\n"); + fprintf(out, "/StrokeWidth 0 def\n"); + fprintf(out, "/PaintType 0 def\n"); + fprintf(out, "/FontName (%s) def\n", psfontname); + fprintf(out, "/FontInfo 9 dict dup begin\n"); + fprintf(out, " /FullName (%s) def\n", ti->nameid.full_name?ti->nameid.full_name:psfontname); + fprintf(out, " /Notice (%s) def\n", ti->nameid.copyright?ti->nameid.copyright:"nothing here"); + fprintf(out, " /FamilyName (%s) def\n", ti->nameid.family?ti->nameid.family:psfontname); + fprintf(out, " /Weight (%s) def\n", ti->nameid.subfamily?ti->nameid.subfamily:"Regular"); + fprintf(out, " /version (%s) def\n", ti->nameid.version?ti->nameid.version:"0.1"); + + if( ti->ttpostscript ) + { + fprintf(out, " /italicAngle %.9g def\n", (double)ti->ttpostscript->italicAngle); + fprintf(out, " /underlineThickness %d def\n", (int)ti->ttpostscript->underlineThickness); + fprintf(out, " /underlinePosition %d def\n", (int)ti->ttpostscript->underlinePosition); + fprintf(out, " /isFixedPitch %s def\n", ((ti->ttpostscript->isFixedPitch)?("true"):("false"))); + } + else + { + fprintf(out, " /italicAngle %.9g def\n", 0.0); + fprintf(out, " /underlineThickness %d def\n", 100); + fprintf(out, " /underlinePosition %d def\n", 0); + fprintf(out, " /isFixedPitch false def\n"); + } + + fprintf(out, "end def\n"); + + scaler = (1000.0 / (double)ti->ttface->units_per_EM) / 1000.0; + fprintf(out, "/FontMatrix [%.9g 0 0 %.9g 0 0] def\n", scaler, scaler); + + if( ti->ttheader ) + { + fprintf(out, "/FontBBox [%d %d %d %d] def\n", + (int)ti->ttheader->xMin, + (int)ti->ttheader->yMin, + (int)ti->ttheader->xMax, + (int)ti->ttheader->yMax); + } + else + { + FT_BBox *font_bbox = FT_Get_PS_Font_BBox(ti->ttface); + fprintf(out, "/FontBBox [%d %d %d %d] def\n", + (int)font_bbox->xMin, + (int)font_bbox->yMin, + (int)font_bbox->xMax, + (int)font_bbox->yMax); + } + + fprintf(out, "/Encoding [\n"); + for( i = 0 ; i < 256 ; i++ ) + { +#ifdef USE_FT_PS_NAMES + char namebuf[256]; + PsOut_Get_FreeType_Glyph_Name(namebuf, ti->pFont, i+block_offset); + linewidth += strlen(namebuf) + 2; + fprintf(out, "/%s%s", namebuf, (linewidth > 70)?(linewidth = 0, "\n"):(" ")); +#else + fprintf(out, "/ch%02x%s", i, (((i % 10) == 9)?("\n"):(" "))); +#endif /* USE_FT_PS_NAMES */ + } + fprintf(out, "] def\n"); + + fprintf(out, "/CharProcs %d dict def CharProcs begin\n", (int)(numchars + 1)); + fprintf(out, "/.notdef {\n" + "1000 0 0 0 0 0 setcachedevice\n" + "fill } bind def\n"); + for( i = 0 ; i < numchars ; i++ ) + { + char buf[32]; +#ifdef USE_FT_PS_NAMES + char namebuf[256]; + PsOut_Get_FreeType_Glyph_Name(namebuf, ti->pFont, i+block_offset); + sprintf(buf, "%s ", namebuf); +#else + sprintf(buf, "ch%02lx ", i); +#endif /* USE_FT_PS_NAMES */ + PSType3_createOutlineGlyphs(out, ti, i+block_offset, buf); + } + fprintf(out, "end\n" + "/BuildGlyph {\n" + " exch /CharProcs get exch\n" + " 2 copy known not {pop /.notdef} if get exec } bind def\n" + "/BuildChar { 1 index /Encoding get exch get\n" + " 1 index /Encoding get exec } bind def\n"); + fprintf(out, "currentdict end /%s exch definefont pop\n", psfontname); + fprintf(out, "%%EndFont\n"); + + return 0; +} + +static +char *FT_Get_TT_NAME_ID(FT_Face ttface, int index) +{ + FT_SfntName name; + char *s; + + if( index >= FT_Get_Sfnt_Name_Count(ttface) ) + return NULL; + + FT_Get_Sfnt_Name(ttface, index, &name); + s = (char *)malloc(name.string_len+2); + if( !s ) + return NULL; + memcpy(s, (char *)name.string, name.string_len); + s[name.string_len] = '\0'; + return s; +} + +int PsOut_DownloadFreeType3(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset) +{ + struct ft2info cft2info = { 0 }; + struct ft2info *ti = &cft2info; + + S_Flush(self); + + ti->tf = (FTFontPtr)pFont->fontPrivate; + ti->ttface = ti->tf->instance->face->face; + ti->pFont = pFont; +#ifdef DEBUG_gisburn + fprintf(stderr, "# Downloading FT2 font filename='%s', ttface=%lx\n", ti->tf->instance->face->filename, (long)ti->ttface); +#endif /* DEBUG_gisburn */ + + ti->nameid.full_name = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FULL_NAME); + ti->nameid.copyright = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_COPYRIGHT); + ti->nameid.family = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FONT_FAMILY); + ti->nameid.subfamily = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_FONT_SUBFAMILY); + ti->nameid.version = FT_Get_TT_NAME_ID(ti->ttface, TT_NAME_ID_VERSION_STRING); + + ti->ttheader = (TT_Header *)FT_Get_Sfnt_Table(ti->ttface, ft_sfnt_head); + ti->ttpostscript = (TT_Postscript *)FT_Get_Sfnt_Table(ti->ttface, ft_sfnt_post); + + PSType3_generateOutlineFont(self->Fp, psfontname, ti, block_offset); + + free(ti->nameid.full_name); + free(ti->nameid.copyright); + free(ti->nameid.family); + free(ti->nameid.subfamily); + free(ti->nameid.version); + + S_Flush(self); + + return 0; +} + diff --git a/Xprint/spooler.h b/Xprint/spooler.h new file mode 100644 index 000000000..ac1257c55 --- /dev/null +++ b/Xprint/spooler.h @@ -0,0 +1,72 @@ + +#ifndef SPOOLER_H +#define SPOOLER_H 1 + +/* $Xorg: spooler.h,v 1.1 2003/09/14 1:19:56 gisburn Exp $ */ +/* +Copyright (c) 2003-2004 Roland Mainz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the copyright holders shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from said +copyright holders. +*/ + +/* + * Define platform-specific default spooler type + */ +#if defined(sun) +#define XPDEFAULTSPOOLERNAMELIST "solaris" +#elif defined(AIXV4) +#define XPDEFAULTSPOOLERNAMELIST "aix4" +#elif defined(hpux) +#define XPDEFAULTSPOOLERNAMELIST "hpux" +#elif defined(__osf__) +#define XPDEFAULTSPOOLERNAMELIST "osf" +#elif defined(__uxp__) +#define XPDEFAULTSPOOLERNAMELIST "uxp" +#elif defined(CSRG_BASED) || defined(linux) +/* ToDo: This should be "cups:bsd" in the future, but for now + * the search order first-bsd-then-cups is better for backwards + * compatibility. + */ +#define XPDEFAULTSPOOLERNAMELIST "bsd:cups" +#else +#define XPDEFAULTSPOOLERNAMELIST "other" +#endif + +typedef struct +{ + const char *name; + const char *list_queues_command; + const char *spool_command; +} XpSpoolerType, *XpSpoolerTypePtr; + +/* prototypes */ +extern XpSpoolerTypePtr XpSpoolerNameToXpSpoolerType(char *name); +extern void XpSetSpoolerTypeNameList(char *namelist); +extern char *XpGetSpoolerTypeNameList(void); + +/* global vars */ +extern XpSpoolerTypePtr spooler_type; +extern XpSpoolerType xpstm[]; + +#endif /* !SPOOLER_H */ + diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index c5eaaee03..d98defc29 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1124,7 +1124,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) } else if (iReturn == WIN_JMP_ERROR_IO) { - ErrorF ("winInitMultiWindowWM - Caught IO Erro. Exiting.\n"); + ErrorF ("winInitMultiWindowWM - Caught IO Error. Exiting.\n"); pthread_exit (NULL); }