Article View: comp.lang.postscript
Article #5983Re: Justifying strings, how??
From: Stephen Zisk
Date: Fri, 18 Dec 1992 23:07
Date: Fri, 18 Dec 1992 23:07
31 lines
2341 bytes
2341 bytes
In article <1992Dec17.011125.8658@trilithon.mpk.ca.us>, henry@trilithon.mpk.ca.us (Henry McGilton) wrote: > > In article <MEYER.92Dec16131125@ibsen.geomatic.no> writes: > * I want to be able to justify strings; left, right and middle. How can > * I do this when almost all PostScript fonts are non-fixed fonts? How do > * I calculate where to put the string??? > * Anybody have a piece of code, or a general idea of how to do this? > These kinds of calculations are trivially easy for the trivially > easy cases. Following is some PostScript code taken from Chapter > 3 of ``PostScript by Example'' by Mary Campione and Henry McGilton, > published by Addison-Wesley. More fun starts when the strings to be > justfified are in multiple fonts -- we also discuss this case. > <PostScript program was here> This works well, but puts the load onto the PostScript interpreter. For tests, short jobs, and personal use, this is fine, but if you are writing a driver with performance in mind, you should at least consider doing the job on the host. This is often required anyway, if you are doing line- or page-breaking, hyphenation, or other sophisticated typography. If this is what you need, look at the AFM files, which give character widths (and also provide other goodies like bounding boxes, kerning info, etc). The format is defined in technote #5004, and there are a bunch of other technotes on text setting for a driver, all available from the Adobe File Server. Stephen Zisk (zisk@adobe.com) Disclaimer: These are my personal views Adobe Systems Incorporated and do not represent the position of Eastern Regional Office Adobe Systems Incorporated. 24 New England Exec. Park Burlington, MA 01803 They pay me but they don't muzzle me!
Technical Details
Message-ID:
<zisk-181292180203@macne003.boston.us.adobe.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!decwrl!adobe!macne003.boston.us.adobe.com!userReferences:
<MEYER.92Dec16131125@ibsen.geomatic.no> <1992Dec17.011125.8658@trilithon.mpk.ca.us>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!decwrl!adobe!macne003.boston.us.adobe.com!user From: zisk@adobe.com (Stephen Zisk) Subject: Re: Justifying strings, how?? Message-ID: <zisk-181292180203@macne003.boston.us.adobe.com> Followup-To: comp.lang.postscript Sender: usenet@adobe.com (USENET NEWS) Organization: Adobe Systems Incorporated References: <MEYER.92Dec16131125@ibsen.geomatic.no> <1992Dec17.011125.8658@trilithon.mpk.ca.us> Date: Fri, 18 Dec 1992 23:07:29 GMT Lines: 31