home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 334_02 / kyo.trm < prev    next >
Text File  |  1991-02-05  |  2KB  |  108 lines

  1. /* Prescribe (KYOCERA) driver - Michael Waldor */
  2. /* Modified for gnuplot 2.0 sk@sun4 24-Apr-1990 13:23 */
  3. #ifdef PRESCRIBE
  4.  
  5. #define PRE_XMAX 2567
  6. #define PRE_YMAX 1815    /* X:Y = sqrt(2) */
  7.  
  8. #define PRE_XLAST (PRE_XMAX - 1)
  9. #define PRE_YLAST (PRE_YMAX - 1)
  10.  
  11. #define PRE_VCHAR (PRE_YMAX/30)
  12. #define PRE_HCHAR 33    /* about 9 chars per inch */
  13. #define PRE_HTIC (PRE_XMAX/80)
  14. #define PRE_VTIC PRE_HTIC
  15.  
  16. /* for Courier font: */
  17. #define KYO_VCHAR (14*(300/72))    /* 12 pt + 2 pt baselineskip */
  18. #define KYO_HCHAR (300/10)    /*  10 chars per inch */
  19.  
  20. enum JUSTIFY pre_justify=LEFT;    /* text is flush left */
  21.  
  22. PRE_init()
  23. {
  24.   (void) fprintf(outfile,"!R! RES;\n") ;
  25.   /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  26.   /* SPO: landscape format */
  27.   /* STM, SLM set top, left margin*/
  28.   /* Font: bold Helvetica (proportional font) */
  29.   (void) fprintf(outfile,"PAGE; UNIT D; SPO L; STM 280; SLM 440;\n") ;
  30.   (void) fprintf(outfile,"FTMD 15; FONT 29; SCPI 9;\n") ;
  31. }
  32.  
  33. KYO_init()
  34. {
  35.   (void) fprintf(outfile,"!R! RES;\n") ;
  36.   /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
  37.   /* SPO: landscape format */
  38.   /* STM, SLM set top, left margin */
  39.   /* Font: Courier (fixed width font) */
  40.   (void) fprintf(outfile,"PAGE; UNIT D; SPO L; STM 280; SLM 440;\n") ;
  41.   (void) fprintf(outfile,"FTMD 15; FONT 17; SCPI 10;\n") ;
  42. }
  43.  
  44. PRE_graphics()
  45. {
  46. }
  47.  
  48. PRE_text()            /* eject page after each plot */
  49. {
  50.   (void) fprintf(outfile,"PAGE;\n") ; 
  51. }
  52.  
  53. PRE_linetype(linetype)
  54. int linetype ;
  55. {
  56.   /* actually choose pendiameter */
  57.   if (linetype < 0) linetype = -linetype;
  58.   else linetype = 3;
  59.   (void) fprintf(outfile,"SPD %d;\n", linetype) ;
  60. }
  61.  
  62. PRE_move(x,y)
  63. unsigned int x,y ;
  64. {
  65.   (void) fprintf(outfile,"MAP %1d,%1d;\n",x,PRE_YMAX-y) ;
  66. }
  67.  
  68. PRE_vector(x,y)
  69. unsigned int x,y ;
  70. {
  71.   (void) fprintf(outfile,"DAP %1d, %1d;\n",x,PRE_YMAX-y) ;
  72. }
  73.  
  74. PRE_put_text(x, y, str)
  75. unsigned int x,y ;
  76. char *str;
  77. {
  78.   PRE_move(x,y);
  79.   switch(pre_justify){
  80.   case RIGHT:
  81.     (void) fprintf(outfile,"RTXT \"%s\", B;\n",str) ;
  82.     break;
  83.   default:
  84.     (void) fprintf(outfile,"TEXT \"%s\", B;\n",str) ;
  85.   }
  86. }
  87.  
  88. int PRE_justify_text(mode)
  89. enum JUSTIFY mode;
  90. {
  91.   pre_justify=mode;
  92.   switch(pre_justify){
  93.   case LEFT:
  94.   case RIGHT:
  95.     return(TRUE);
  96.   default:
  97.     return(FALSE);
  98.   }
  99.   
  100. }
  101.  
  102. PRE_reset()
  103. {
  104.   (void) fprintf(outfile,"PAGE; RES; EXIT;\n");
  105. }
  106.  
  107. #endif /* PRESCRIBE */
  108.