home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / postscri / 5530 next >
Encoding:
Text File  |  1992-11-15  |  2.2 KB  |  51 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!gatech!udel!intercon!psinntp!nntp1.radiomail.net!fernwood!trilithon!henry
  3. From: henry@trilithon.mpk.ca.us (Henry McGilton)
  4. Subject: Re: Text formatters turn PostScript upside down -- why?
  5. Message-ID: <1992Nov15.171106.29063@trilithon.mpk.ca.us>
  6. Sender: henry@trilithon.mpk.ca.us
  7. Organization: Trilithon Software
  8. References: <1992Nov14.222532.8727@cs.brown.edu>
  9. Date: Sun, 15 Nov 1992 17:11:06 GMT
  10. Lines: 39
  11.  
  12. In article <1992Nov14.222532.8727@cs.brown.edu> jgm@cs.brown.edu (Jonathan  
  13. Monsarrat) writes:
  14.  
  15.     *  Why do text formatters/converters like dvips (for TeX) and
  16.     *  grops (for Troff) define everything upside down in PostScript?
  17.     *  Just to be mean?
  18. Speaking only from my knowledge of troff here.  First of all,
  19. remember that both troff and TeX (even TeX 82) predate PostScript,
  20. but that's probably irrelevant to the issue anyway.
  21.  
  22. The main reason stems from the nature of printed pages.  Pages of
  23. text, whether Western or Asian, read from top to bottom.  Therefore
  24. there's some sense in defining a coordinate system with (0, 0) at
  25. the top left (for Western style text).  In troff, the first line
  26. of the page is at the top of the page, loosely speaking, and the
  27. y coordinate increases as you move down the page towards the bottom.
  28. The  \v  escape sequence moves down for positive arguments and up
  29. for negative arguments.  The  .sp  request moves down for positive
  30. arguments and up for negative arguments, and so on.
  31.  
  32. This is opposite from PostScript's coordinate system which places
  33. (0, 0) at the lower left corner of the page, like the regular first
  34. quadrant of a Cartesian coordinate system we all learned about in
  35. school.
  36.  
  37. To switch between the troff (and I assume TeX) coordinate system
  38. and the PostScript coordinate system is simple -- translate up by
  39. the height of the page and do a 1 -1 scale operation so the CTM is
  40. ``upside down'' from the standard PostScript coordinate system.
  41. If you just stop there, of course, all your text will come out
  42. upside down as well, so every time you make a font, you have to
  43. use a [ S 0 0 -S 0 0 ] makefont to get the text coming out the
  44. right way up.
  45.  
  46.     ........  Henry
  47.  
  48.     Do not meddle in the affairs of troff,
  49.     for she is subtle and quick to anger.
  50.                 -----  Bill Joy, circa 1980.
  51.