g_pagetype.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* This file is part of the GNU plotutils package. Copyright (C) 1995,
  2. 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
  3. The GNU plotutils package is free software. You may redistribute it
  4. and/or modify it under the terms of the GNU General Public License as
  5. published by the Free Software foundation; either version 2, or (at your
  6. option) any later version.
  7. The GNU plotutils package is distributed in the hope that it will be
  8. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public License along
  12. with the GNU plotutils package; see the file COPYING. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
  14. Boston, MA 02110-1301, USA. */
  15. /* This header file is #include'd by g_pagetype.c. It is a database rather
  16. than a true header file: it lists known page sizes and dimensions.
  17. Fields are:
  18. (1) name, (2) alternative name, (3) name used by Fig,
  19. (4) whether metric, as opposed to imperial, units are associated
  20. with this page size.
  21. (5) width in inches,
  22. (6) height in inches,
  23. (7) the size of the viewport (a square) we place on the page.
  24. (The viewport is positioned at the center of the page except when
  25. producing HP-GL[/2] output. For HP-GL[/2], as opposed to HP-GL/2
  26. embedded in PCL5, we have no definite information about the location
  27. of the origin of the device coordinate system [we don't even know
  28. whether the device is plotting in portrait or landscape mode,
  29. though it's probably landscape mode].)
  30. Our convention: both in the pure-HP-GL[/2] case and in all other
  31. cases, the viewport is chosen to have a fixed size that's no larger
  32. than the smaller dimension of the plotting area used, for the
  33. specified page type, by AutoCAD. AutoCAD presumably does a good job
  34. of selecting a plotting area (a rectangle) that will fit on a
  35. landscape-mode HP-GL[/2] page.
  36. In the HP-GL[/2] case we make no attempt at centering the viewport,
  37. though at least one of the two coordinates shouldn't be centered too
  38. badly. The user can manually adjust the location of the viewport.
  39. (8,9) the origin of the device coordinate system, when HP-GL/2 is
  40. embedded in PCL5; relative to the lower left corner of page.
  41. Source: the "PCL 5 Comparison Guide", from Hewlett-Packard.
  42. Note that when a PCL5 "dual context" portrait-mode device is
  43. switched to HP-GL/2 mode, the HP-GL/2 plotting is also in portrait
  44. mode. I.e., on a PCL5 device doing HP-GL/2 emulation it's possible
  45. to set the portrait/landscape mode programmatically, unlike a pure
  46. HP-GL/2 device.
  47. (10) the plot length (of importance mostly for roll plotters, when
  48. pure HP-GL/2, rather than HP-GL/2 embedded in PCL5, is output).
  49. I've come up with values that I hope are appropriate.
  50. Explanatory comments:
  51. In general, the origin for the HP-GL[/2] coordinate system is not a
  52. corner of the printed page. (This is an old convention, dating back to
  53. early pen plotter days.) It is the lower left corner of the `hard-clip
  54. region', a proper subrectangle of the printed page. The size and
  55. orientation of the hard-clip region differ from device to device.
  56. Fields #8, #9 below give the location of the origin in a PCL device
  57. supporting HP-GL/2. Fields #8, #9 could equally well be defined as the
  58. x margin and y margin between the HP-GL/2 hard-clip region and the
  59. boundary of the page. The HP-GL/2 hard-clip region is a proper
  60. subrectangle of the rectangular area of the page that is imageable from
  61. within PCL.
  62. In a pure HP-GL/2 device, there is no easy way to determine the origin.
  63. (In fact in early HP-GL plotters, unlike HP-GL/2 plotters, the lower
  64. left corner of the hard-clip region wasn't even the same as the default
  65. location of the so-called HP-GL `scaling point' P1.) */
  66. #define PL_NUM_PAGESIZES 13
  67. static const plPageData _pagedata[PL_NUM_PAGESIZES] =
  68. {
  69. /* ANSI A, 8.5in x 11.0in */
  70. /* AutoCAD plotting area is 8.0x10.5;
  71. we choose viewport size 8.0in */
  72. { "a", "letter", "Letter", false,
  73. 8.5, 11.0, 8.0, 75.0/300, 150.0/300, 10.5 },
  74. /* ANSI B, 11.0in x 17.0in */
  75. /* AutoCAD plotting area is 10.0x16.0;
  76. we choose viewport size 10.0in */
  77. { "b", "tabloid", "B", false,
  78. 11.0, 17.0, 10.0, 75.0/300, 150.0/300, 16.0 },
  79. /* ANSI C, 17.0in x 22.0in */
  80. /* AutoCAD plotting area is 16.0x21.0;
  81. we choose viewport size 16.0in */
  82. { "c", NULL, "C", false,
  83. 17.0, 22.0, 16.0, 75.0/300, 150.0/300, 21.0 },
  84. /* ANSI D, 22.0in x 34.0in */
  85. /* AutoCAD plotting area is 21.0x33.0;
  86. we choose viewport size 20.0in */
  87. { "d", NULL, "D", false,
  88. 22.0, 34.0, 20.0, 75.0/300, 150.0/300, 33.0 },
  89. /* ANSI E, 34.0in x 44.0in */
  90. /* AutoCAD plotting area is 33.0x43.0;
  91. we choose viewport size 32.0in */
  92. { "e", NULL, "E", false,
  93. 34.0, 44.0, 32.0, 75.0/300, 150.0/300, 43.0 },
  94. /* legal, 8.5in x 14in; not an ANSI size */
  95. /* AutoCAD plotting area unknown;
  96. we choose viewport size = 8.0in */
  97. { "legal", NULL, "Legal", false,
  98. 8.5, 14.0, 8.0, 75.0/300, 150.0/300, 16.0 },
  99. /* ledger, 17in x 11in (rotated ANSI B); not an ANSI size ? */
  100. /* we use viewport size = 10.0in */
  101. { "ledger", NULL, "Ledger", false,
  102. 17.0, 11.0, 10.0, 150.0/300, 75.0/300, 10.0 },
  103. /* ISO A4, 21.0cm x 29.7 cm = 8.27 x 11.69 */
  104. /* AutoCAD plotting area is 7.8x11.2;
  105. we choose viewport size 7.8in=19.81cm [N.B. 7.87in = 20cm] */
  106. { "a4", NULL, "A4", true,
  107. 8.27, 11.69, 7.8, 71.0/300, 150.0/300, 11.2 },
  108. /* ISO A3, 29.7cm x 42.0 cm = 11.69 x 16.54 */
  109. /* AutoCAD plotting area is 10.7x15.6;
  110. we choose viewport size 10.7in=27.18cm [N.B. 10.62in = 27cm] */
  111. { "a3", NULL, "A3", true,
  112. 11.69, 16.54, 10.7, 71.0/300, 150.0/300, 15.6 },
  113. /* ISO A2, 42.0cm x 59.4 cm = 16.54 x 23.39 */
  114. /* AutoCAD plotting area is 15.6x22.4;
  115. we choose viewport size 15.6in=39.62cm [N.B. 15.75in = 40cm] */
  116. { "a2", NULL, "A2", true,
  117. 16.54, 23.39, 15.6, 71.0/300, 150.0/300, 22.4 },
  118. /* ISO A1, 59.4cm x 84.1 cm = 23.39 x 33.11 */
  119. /* AutoCAD plotting area is 22.4x32.2;
  120. we choose viewport size 22.4in=56.90cm [N.B. 21.26in = 54cm] */
  121. { "a1", NULL, "A1", true,
  122. 23.39, 33.11, 22.4, 71.0/300, 150.0/300, 32.2 },
  123. /* ISO A0, 84.1cm x 118.9 cm = 33.11 x 46.81 */
  124. /* AutoCAD plotting area is 32.2x45.9;
  125. we choose viewport size 32.2in=81.79cm [N.B. 31.50in = 80cm] */
  126. { "a0", NULL, "A0", true,
  127. 33.11, 46.81, 32.2, 71.0/300, 150.0/300, 45.9 },
  128. /* JIS B5, 18.2cm x 25.7 cm = 7.17 x 10.12 */
  129. /* AutoCAD plotting area is 6.67x9.62(?);
  130. we choose viewport size 6.67in=16.94cm [N.B. 6.30in = 16cm] */
  131. { "b5", NULL, "B5", true,
  132. 7.17, 10.12, 6.67, 71.0/300, 150.0/300, 9.62 }
  133. };