postdaisy.h 2.0 KB

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