Products   Support   Download   Contact

MODIFYING SCRIPTSERVER ENCODING VECTORS FOR CUSTOM CHARACTER SETS

Contents | Index | About the Icons

Abstract

When performing ASCII-to-PostScript translation, the ScriptServer print symbiont performs font re-encoding so that multi-national characters are printed correctly according to the DEC Multinational Character Set (DECMCS). By modifying the encoding array within the ScriptServer prolog (SSV$PROLOG), you can cause any ASCII value to generate any character description available in a PostScript font.


Solution

Change the character encoding used by ScriptServer, or use the Customer-defined Character set provided in ScriptServer Version 4.0-4 and higher, "CST".

1)Extract the prolog (SSV$PROLOG) from the ScriptServer device control library(SYS$LIBRARY:SSV$DEVCTL.TLB).
2) Modify the encoding array (called "CUCS") in SSV$PROLOG. This array contains the name of the character description indexed by ASCII value.(In the CUCS array, the first element changed from the default encodingis at index 145 (decimal). If you need to change a value prior to 145, insertthe ASCII value at the beginning of the encoding array with the name ofits replacement character, e.g. insert "85/percent" to cause ASCIIvalue 85 to generate a percent (%) character. As another example, to changeASCII value 165 (decimal) from the "yen" (¥) character tothe "Aring" (Å) character, find the text "yen"in the encoding vector and change it to "Aring". The names ofthe characters can be found in an appendix in the PostScript Language ReferenceManual ("the red book").
3)Replace the modified prolog in the device control library. Note that ifany ScriptServer queues are running, you won't have write access to thedevice control library. To get around this problem, create a copy of thelibrary and replace the module into the copy.
4)Stop and restart all ScriptServer queues to use the new prolog.

WARNING: Do not change the encoding of ASCII values 144 through 159, as these characters must be present in the font to create composite characters. Failure to observe this rule will result in "invalidfont" PostScript errors when composite characters that rely on these characters' presence are rendered.


Example

Modify the CUCS encoding array such that the ASCII code that would normally generate the "bar" (|) character (ASCII value 124.) generates the "oslash" (ø) character.

First, extract the SSV$PROLOG module from the device control library:

$ LIBR/EXTRACT=SSV$PROLOG/OUTPUT=SSV$PROLOG.PS SYS$LIBRARY:SSV$DEVCTL.TLB

Next, use your favorite editor to change the encoding array in SSV$PROLOG:

$ EDIT/TPU SSV$PROLOG.PS

Since the new encoding is at 124, we must insert the change in the encoding array at the start of the DMCS array.

Search for the string "/CUCS", the section of code we'll be changing looks something like this:

/CUCS[144/dotlessi/grave/acute/circumflex/tilde/macron
/breve/dotaccent/dieresis/fraction/ring/cedilla
/.notdef/hungarumlaut/ogonek/caron/.notdef/exclamdown
/cent/sterling/endash/yen/.notdef/section/currency

Insert "124/oslash" after the left bracket and before the "144/dotlessi".After this change, the first three lines of the new encoding array willlook like this:

/CUCS[124/oslash 144/dotlessi/grave/acute/circumflex/tilde/macron
/breve/dotacct/dieresis/fraction/ring/cedilla
/.notdef/hungarumlaut/ogonek/caron/.notdef/exclamdown
/cent/sterling/endash/yen/.notdef/section/currency

If ScriptServer queues are running, create a copy of the device control library for you to modify (this example assumes your library lives in SYS$COMMON):

$ COPY SYS$LIBRARY:SSV$DEVCTL.TLB SYS$COMMON:[SYSLIB]

Replace the modified version of the prolog in the device control library:

$ LIBR/REPLACE SYS$LIBRARY:SSV$DEVCTL.TLB SSV$PROLOG.PS

Stop (STOP/NEXT command is recommended) all ScriptServer queues, then restart them using the START/QUEUE command.

To use this encoding scheme, you will need to SCRIPT the file, changing the EC value to "CST" or you can do the following:

$ PRINT/PARAM=ENCODING=CST/QUEUE=queue-name file.ext
© 2020 GrayMatter Software Corporation