home *** CD-ROM | disk | FTP | other *** search
- %%PsfStart
-
- $Id: language.PSF,v 3.2 1992/01/19 05:50:33 ajf Exp ajf $
-
- WARNING: This file must be edited to cause valid selection
- ======= of postscript characters for non-English languages.
- The sample "Scandinavian" translation table is
- used for testing purposes only and will not generate
- correct character selections. Read the comments in
- the "%%translate" section below to manually create
- a valid translation table and language character
- vector for the target language.
-
- This is an example language startup file that illustrates
- encoding of a font vector to use Scandinavian characters. This
- file must be appended to the end of "psfprint.def" with
-
- cat psfprint.old.def language.PSF > psfprint.def
-
- The comments may remain in the final file, or may be removed as
- desired - they are ignored by psf and friends.
-
- To set this code up for a different language, edit the lines
- prefixed with "%%font" and "%%translate". Then modify the
- section of postscript code following "ENCODE".
-
- The first section of the code must start with "%%PsfStart" and
- terminate with %%PsfEnd. The information within this section
- contains new font defintion and character translation tables.
- This section may be empty, however the "%%PsfStart" and
- "%%PsfEnd" lines must exist.
-
- This section is setup information processed by psf and psfbanner.
-
- Any postscript code following the "%%PsfEnd" marker is copied to
- the printer as part of the postscript prologue.
-
- The key words %%PsfStart, %%fontX %%translate %%copy %%PsfEnd
- must start in the first column of this file.
-
- ((( It might be possible to adapt this file to re-encode an
- entire font for a different character set such as EBCDIC. Refer
- to Adobe's Blue Book program #17 for hints on how this might be
- accomplished. Entries for %%fontX would be needed, %%translate
- would not be needed, and the postscript code after %%PsfEnd
- would have to be replaced. )))
- --------------------------------------------------------------
-
- Set up new language font names. Fonts in psf are numbered
- as 0..9, a..z. The "%%fontX" numbers (where 'X' represents the
- font number used by psf) reflect the font to be updated or
- added. If a font is not updated in the list below, the original
- font remains.
-
- The following are the standard fonts known to psf:
-
- # name # name
- - ------------------- - -------------------------
- 0 Courier 1 Helvetica
- 2 Times-Roman 3 AvantGarde-Book
- 4 Bookman-Light 5 NewCenturySchlbk-Roman
- 6 Palatino-Roman 7 Helvetical-Narrow
- 8 Garamond-Light 9 Korinna-Regular
- a Helvetica-Condensed b ZapfChancery-MediumItalic
-
- This example REPLACES standard Courier (%%font0) to become a
- Scandinavian equivalent for the default Courier font and add a
- NEW font (%%fontc) to be the Scandinavian encoded version of
- Times-Roman. New fonts should be numbered starting from "c". DO
- NOT leave gaps when adding new font numbers, add c, d, e, ... in
- sequence.
-
- New font definitions will appear with "psf -".
-
- The format of the %%fontX lines must always follow the pattern
- below - the new names created must be for the base, italic,
- bold and bold-italic, in order. The new font names are
- arbitrary, however must match the names later in the ENCODE
- section.
-
- font new base font new italic font new bold font new bold-italic
- # -------------- ------------------- ---------------- ---------------------
- %%font0 Courier-S Courier-Oblique-S Courier-Bold-S Courier-BoldOblique-S
- %%fontc Times-S Times-I-S Times-B-S Times-BI-S
- ------------------------------------------------------------------
-
- The following translates the letters from 'a' .. 't' to a series
- of characters that could be used in a Scandinavian language.
- Printing a file containing:
-
- abcdefghijklmnopqrst
-
- causes each 'English' letter to be replaced by an arbitrary
- special 'Scandanavian' letter.
-
- The translation table format is:
-
- <ascii text value> / <postscript value>
- e.g.:
- 141/300 translates "a" to "/Oacute"
-
- where 141 = "a", 300 = "/Oacute"
-
- The <ascii text value> is the octal value of a text character
- that actually appears in the text file. The <postscript value>
- is the octal value to which it is to be translated. This new
- value is set up in the "languagevec" array below.
-
- On SysV unix, the <ascii text value>s are (may be?) determined
- from the ttymap(1) table for the target language.
-
- Of course, this table is not "real", it is an example only -
- used for testing! Replace this with real translation
- information.
-
- %%translate 141/300 142/311 143/321 144/322 145/323 146/324 147/325 150/330
- %%translate 151/331 152/332 153/333 154/334 155/340 156/342 157/344 160/347
- %%translate 161/360 162/362 163/364 164/367
- ----------------------------------------------------------------
-
- An external file may be copied to the printer with "%%copy file"
- This file is inserted into the "prologue" code. It must be
- postscript.
-
- %%copy /etc/some.file
-
- %%PsfEnd
-
-
- % Psf and psbanner add the following code to the Prologue
- %
- % The following postscript code is from:
- % Adobe Postscript Language Tutorial and Cookbook
- % Blue book program 18, page 211.
- % Making small changes to encoding vectors
- %
-
- /reencsmalldict 12 dict def
- /ReEncodeSmall
- {reencsmalldict begin
- /newcodesandnames exch def
- /newfontname exch def
- /basefontname exch def
- /basefontdict basefontname findfont def
- /newfont basefontdict maxlength dict def
- basefontdict
- { exch dup /FID ne
- {dup /Encoding eq
- { exch dup length array copy
- newfont 3 1 roll put }
- { exch newfont 3 1 roll put }
- ifelse
- }
- { pop pop }
- ifelse
- } forall
-
- newfont /FontName newfontname put
- newcodesandnames aload pop
-
- newcodesandnames length 2 idiv
- { newfont /Encoding get 3 1 roll put }
- repeat
-
- newfontname newfont definefont pop
- end
- } def
-
- % Select the additional characters needed for the desired language.
- % "languagevec" below is set up as a Scandinavian character set
- % assignment. Other languages will need a different selection.
-
- /languagevec [
- 8#300 /Oacute
- 8#311 /Adieresis
- 8#321 /oacute
- 8#322 /Ograve
- 8#323 /Scaron
- 8#324 /ograve
- 8#325 /scaron
- 8#330 /Edieresis
- 8#331 /adieresis
- 8#332 /edieresis
- 8#333 /Odieresis
- 8#334 /odieresis
- 8#340 /Aacute
- 8#342 /Aring
- 8#344 /Zcaron
- 8#347 /Eacute
- 8#360 /aacute
- 8#362 /aring
- 8#364 /zcaron
- 8#367 /eacute
- ] def
-
- % ENCODE the new fonts for Scandinavian. Then new font name must
- % have been defined in the "%%fontX" lines above.
- %
- % base font new font name reencode the new font
- % ----------------- --------------------- -------------------------
- /Courier /Courier-S languagevec ReEncodeSmall
- /Courier-Oblique /Courier-Oblique-S languagevec ReEncodeSmall
- /Courier-Bold /Courier-Bold-S languagevec ReEncodeSmall
- /Courier-BoldOblique /Courier-BoldOblique-S languagevec ReEncodeSmall
- /Times-Roman /Times-S languagevec ReEncodeSmall
- /Times-Italic /Times-I-S languagevec ReEncodeSmall
- /Times-Bold /Times-B-S languagevec ReEncodeSmall
- /Times-BoldItalic /Times-BI-S languagevec ReEncodeSmall
-