How to justify text in PostScript?
The common approach is to do text formatting in an application. The application emits PostScript code reflecting the final format – now a simple question of dumping things at x, y coordinates. If an application overrides the default interword/interletter spacing (say, for justification or kerning), it should use PostScript’s ashow, widthshow, awidthshow, kshow, xshow, yshow, or xyshow operators, which take an intact text string and a separate specification for positioning the elements. The sloppy alternative, just using show on individual letters and small word fragments with movetos in between, is a hindrance for text extraction programs and distillers. To perform common functions of text formatters, such as hyphenation, multi-column text, footnotes, bibliography, glossary, etc., in PostScript itself requires implementing suitable algorithms in PostScript and supplying them along with the file to be rendered, either included in the file or downloaded in advance. Existing implementatio
It is strongly recommended to do text formatting in your application. Then, and only then, set the text – by now a simple question of dumping things at x, y coordinates. Use xyshow operators to keep the text flow undisturbed. This will help text extraction programs and distillers. A good text formatter supports hyphenation, multi-column text, footnotes, bibliogaphy, glossary, etc. PostScript language has no such features. Since kerning pairs are not available, sophisticated typesetting program cannot be implemented in PostScript at all. There are other opinions. The TinyDict, a formatter for PostScript Markup, is available from Cappella Archive. It provides book page formats with codes for setting text flush left or right, forcing justification, placing running headers and footers, creating coloured text, boxes and circles, and inserting up to five columns on a page. There are add-on resources for tables, equations, footnotes, pdf links, and automatic hyphenation using TeX UK or US pat