9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] troff paper size
@ 2012-03-16 11:38 Yoshi Rokuko
  2012-03-16 21:49 ` Richard Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshi Rokuko @ 2012-03-16 11:38 UTC (permalink / raw)
  To: 9fans

OK this is really troff / ps related, but I think the right
people sit around in this place - and I'm talking about
plan9 troff ;-)

There was this thing on the list:
http://9fans.net/archive/2008/07/639

but I'm still not sure. If I choose a certain paper size,
lets say DIN A0, how do I generate a postscript that has
this size? DIN A0 is defined in mm, so I say:

.pl 118.9c
.ll 84.1c

large font:

.ps 144
Hello, world!

If I generate a postscript with just these 4 lines, will it
print out correctly on an A0 printer? If I have more text
then this 'Hello, world!' will the text cover the whole
paper and just the paper?
And how come that this postscript is displayed wrongly on
different postscript viewers (like gv on lunix)? There are
postscript files in A0 that are correctly displayed - gv is
even telling me that these files are A0.

Something must be missing? Some definition of paper size?

Thanks and best regards, Yoshi

PS
By displayed wrongly I mean that the text is cut off at the
right side and on the top ...



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] troff paper size
  2012-03-16 11:38 [9fans] troff paper size Yoshi Rokuko
@ 2012-03-16 21:49 ` Richard Miller
  2012-03-17 12:09   ` Yoshi Rokuko
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Miller @ 2012-03-16 21:49 UTC (permalink / raw)
  To: 9fans

The postscript file generated from troff output by aux/tr2post doesn't
dictate the paper size.  The postscript prologue (copied from
/sys/lib/postscript/prologues/dpost.ps) includes a routine
/pagedimensions which finds the actual page boundaries (clippath) from
the runtime environment (ie the postscript interpreter), and tries to
centre the printed material on the page.  The paper size is selected
when you display or print the postscript file, for example using the
'-sPAPERSIZE=' command option for ghostscript or sending the file to a
real A0 postscript printer [must be a big beast].

In the case of page(1) with the '-b' option, and possibly other
postscript display programs, the size of the "paper" can be set by
including a BoundingBox definition at the beginning of your postscript
file as described in the 9fans item you referred to.  For A0, this
would be

	%%BoundingBox: 0 0 2384 3370

In your simple example of raw troff using '.ps 144', you should also
set '.vs 144' so the text won't be cut off at the top.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] troff paper size
  2012-03-16 21:49 ` Richard Miller
@ 2012-03-17 12:09   ` Yoshi Rokuko
  2012-03-17 21:17     ` Richard Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshi Rokuko @ 2012-03-17 12:09 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

OK, thanks a lot! Now I know more. However I still think
it's odd that postscripts don't include the paper size for
which they are designed - I think it makes a difference
whether a document is written for legal, letter, DIN A4 or
DIN B4 etc. ...

Regards, Yoshi



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] troff paper size
  2012-03-17 12:09   ` Yoshi Rokuko
@ 2012-03-17 21:17     ` Richard Miller
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Miller @ 2012-03-17 21:17 UTC (permalink / raw)
  To: 9fans

> it's odd that postscripts don't include the paper size for
> which they are designed

Postscript files can specify paper size (using %% comments),
but postscript files generated by tr2post don't.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-17 21:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-16 11:38 [9fans] troff paper size Yoshi Rokuko
2012-03-16 21:49 ` Richard Miller
2012-03-17 12:09   ` Yoshi Rokuko
2012-03-17 21:17     ` Richard Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).