## Printer Device Driver

[prev][next][parent][TOC]

### prda_RemapString

Converts an the text string of an application into a string suitable for sending to PostScript as an argument to a SHOW command. This conversion requires that the following four procedures be completed:

Convert code points to the right code page
Possibly download a new font remapping to PostScript
Add backslashes before parentheses
Use octal for non-ASCII characters

This function scans the string, looking for troublesome code points ( characters without a numeric value in the Adobe Standard Encoding). If the string contains any such characters and a font remap has not yet been downloaded to the printer, the remap is downloaded. Next, the string is scanned a second time, converting each code point to the proper code page, adding backslashes and octal digits as needed, and storing the final string in a buffer in the display context instance data.

Warnings:

The font remapping is downloaded only if absolutely necessary. The download causes a loss of performance.

The text buffer in the display context instance is limited in size ( presently 256 bytes long). If the provided string is too long, it will be truncated. Therefore, it is the responsibility of the major functions to make sure this never happens. For example, CharStringPos will automatically break longer strings into shorter ones to avoid truncated text.