postdaisy.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /*
  10. *
  11. * Definitions used by the PostScript translator for Diablo 1640 files.
  12. *
  13. * Diablo printers have horizontal and vertical resolutions of 120 and 48 dpi.
  14. * We'll use a single resolution of 240 dpi and let the program scale horizontal
  15. * and vertical positions by HSCALE and VSCALE.
  16. *
  17. */
  18. #define RES 240
  19. #define HSCALE 2
  20. #define VSCALE 5
  21. /*
  22. *
  23. * HMI is the default character spacing and VMI is the line spacing. Both values
  24. * are in terms of the 240 dpi resolution.
  25. *
  26. */
  27. #define HMI (12 * HSCALE)
  28. #define VMI (8 * VSCALE)
  29. /*
  30. *
  31. * Paper dimensions don't seem to be all that important. They're just used to
  32. * set the right and bottom margins. Both are given in terms of the 240 dpi
  33. * resolution.
  34. *
  35. */
  36. #define LEFTMARGIN 0
  37. #define RIGHTMARGIN 3168
  38. #define TOPMARGIN 0
  39. #define BOTTOMMARGIN 2640
  40. /*
  41. *
  42. * ROWS and COLUMNS set the dimensions of the horizontal and vertical tab arrays.
  43. * The way I've implemented both kinds of tabs leaves something to be desired, but
  44. * it was simple and should be good enough for now. If arrays are going to be used
  45. * to mark tab stops I probably should use malloc() to get enough space once the
  46. * initial hmi and vmi are know.
  47. *
  48. */
  49. #define ROWS 400
  50. #define COLUMNS 200
  51. /*
  52. *
  53. * An array of type Fontmap helps convert font names requested by users into
  54. * legitimate PostScript names. The array is initialized using FONTMAP, which must
  55. * end with an entry that has NULL defined as its name field.
  56. *
  57. */
  58. typedef struct {
  59. char *name; /* user's font name */
  60. char *val; /* corresponding PostScript name */
  61. } Fontmap;
  62. #define FONTMAP \
  63. \
  64. { \
  65. "R", "Courier", \
  66. "I", "Courier-Oblique", \
  67. "B", "Courier-Bold", \
  68. "CO", "Courier", \
  69. "CI", "Courier-Oblique", \
  70. "CB", "Courier-Bold", \
  71. "CW", "Courier", \
  72. "PO", "Courier", \
  73. "courier", "Courier", \
  74. "cour", "Courier", \
  75. "co", "Courier", \
  76. NULL, NULL \
  77. }
  78. /*
  79. *
  80. * Some of the non-integer functions in postdaisy.c.
  81. *
  82. */
  83. char *get_font();