Xref: utzoo comp.lang.postscript:1007 comp.text:2527
Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!saturn!ucscb.UCSC.EDU!lupin3
From: lupin3@ucscb.UCSC.EDU (-=/ Larry Hastings /=-)
Newsgroups: comp.lang.postscript,comp.text
Subject: Re: Justified Text
Message-ID: <4937@saturn.ucsc.edu>
Date: 26 Sep 88 06:21:34 GMT
References: <647@jura.tcom.stc.co.uk>
Sender: usenet@saturn.ucsc.edu
Reply-To: lupin3@ucscb.UCSC.EDU (-=/ Larry Hastings /=-)
Organization: MetaWare, Incorporated
Lines: 41

+-In article <647@jura.tcom.stc.co.uk>, pjb@tcom.stc.co.uk (Peter J. Bishop) wrote:-
+----------
|
|I am trying to write a program (in C - or postscript if its possible) that will
| take the input, and produce the necessary PostScript code to write justified
| text (similar to troff).
| 
| My questions are:
| 
| a) Has anyone done this, and if so how?
| 
| b) If not, does anyone know where I could start looking to find out the
|    character widths for each font.
| 
| Peter Bishop.   || ...!mcvax!ukc!stc!pjb
+----------

  a) Yes, of course.  Just as an example, the Sprint formatter (Borland's
Sprint, for DOS machines, has a seperate editor and formatter) takes text and
produces beautiful justified text.  (You have to do your own hyphenation, as it
isn't that smart; at least it has conditional hyphens.. nevermind.)  As to
HOW they did it is quite interesting, but it would take a lot of explaining...
their formatter is very versitile, and makes not only beautiful PS text but
beautiful text on a variety of printers.  If you want more info, get a copy
of Sprint and start dissecting it, and dissecting both the data for Postscript
printers for its formatter, and the PS it spits out therafter.
  b) Yes.  A program came free with Final Word II (update 2.20, anyways) that
you sent to your printer and it would send back the character widths of a
particular font in a particular size, nicely formatted to be used as data
for Final Word's formatter.  I don't remember if this code is copyrighted; if
it isn't, I'd be happy to send you a copy (mail such a request to my work
address, shown below.)

--
 /|\ /|\   .. .  .   .    .     .      .       .        .         .          . 
| |\| |\|  .. .  .   .    .     .      .       .        .         .          .
|/|\|/|\|/||   _  _ _   _ |_| _  _ |_ -__  _  _ARPA: lupin3@ucscb.ucsc.EDU      
  | |/| |/|L_ (_\( ( (_/  | |(_\_) (_ || )(_)_)UUCP: *!ucbvax!ucscc!ucscb!lupin3
   \|/ \|/ larry      /   hastings        _/   WORK: sun!acad!metaware!funkster
  MetaWare "I wish people who have trouble communicating would just shut up."\\\
IncorporateDisclaimer:[MetaWare, UCSC]->opinion!=lhastings->opinion\\\Tom Lehrer