home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1881 < prev    next >
Internet Message Format  |  1990-12-28  |  7KB

  1. From: blair@obdient.chi.il.us (Doug Blair)
  2. Newsgroups: comp.periphs.printers,comp.editors,alt.sources
  3. Subject: Epson LQ-510 shadow, enhanced, etc
  4. Message-ID: <5818@obdient.chi.il.us>
  5. Date: 28 Sep 90 14:54:28 GMT
  6.  
  7. I saw a couple of postings in (I think) comp.periphs.printers from Epson
  8. LQ-510 owners unable to use their enhanced shadow, outline and shadow+outline
  9. modes (activated with ESC q [0-3]).  Tried it here and it worked just fine.
  10. (make sure your printer interface passes all 8 bits and that you haven't issued
  11. an ESC [=>#]).  I'd been working on a project to use some of the fancier
  12. typestyles from within shell scripts and the results are enclosed.
  13.  
  14. There are two files here: epfont and epdemo. Epfont will issue the necessary
  15. escape sequences to change fonts, typestyles, point sizes, height and width,
  16. underlining and a few other modes.  Epdemo excercises these features and
  17. will produce SEVEN pages of output per font!  To use these, cut epfont and
  18. epdemo out of this file.  Epfont will accept commands on the order of
  19.  
  20.     epfont -f Orator -p 12 -i italic -s outline 
  21.  
  22. to change to the Orator typestyle 12 pitch outlined and italicised.  
  23. Include epfont commands in shell scripts designed to be piped to lp.  To 
  24. show off ALL the typestyles (well, most actually) available on your LQ-510, 
  25. first comment out an appropriate line in epdemo if you have or don't 
  26. have the font module cartridge, then run 
  27.  
  28.     epdemo | lp
  29.  
  30. And you'll see almost all your printer can do.  Yes, it does improve the
  31. appearances of the invoices around here tremendously!
  32.  
  33. Enjoy
  34.  
  35.  
  36. Doug
  37.  ___  _           _  _             _    
  38. |   || |_  ___  _| ||_| ___  __  _| |_  Doug Blair    Obedient Software Corp.
  39. | | ||  .\/ ._\/.  || |/ ._\|  \|_   _| 1007 Naperville Rd, Wheaton IL  60187 
  40. |___||___/\___/\___||_|\___/|_|_| |_|   708-653-5527  blair@obdient.chi.il.us
  41.  
  42.  
  43. ---------------------------- epdemo ----------------------------------------
  44.  
  45. # epdemo
  46. # exercises epfont functions for Epson LQ-510 printer
  47.  
  48. # uncomment one of the following lines - use second if you have font module
  49. fonts="Roman Sans"
  50. #fonts="Roman Sans Courier Prestige Script Ocra Ocrb Orator OratorS"
  51.  
  52. epfont -z
  53. epfont -q lq 
  54.  
  55. for font in $fonts
  56. do
  57. epfont -f $font
  58.  
  59. for style in normal outline shadow
  60. do
  61. epfont -s $style
  62.  
  63. for pitch in 15 12 10
  64. do
  65. epfont -p $pitch
  66.  
  67. for width in normal wide
  68. do
  69. epfont -w $width
  70.  
  71. for high in normal tall
  72. do
  73. epfont -h $high
  74.  
  75. for italic in normal italic
  76. do
  77. epfont -i $italic
  78.  
  79. for emphasis in normal emphasis
  80. do
  81. epfont -e $emphasis
  82.  
  83. if [ "$high" = "tall" ]
  84.     then
  85.     echo
  86. fi
  87. echo $width $high $style $font $pitch $italic $emphasis
  88.  
  89. if [ "$high" = "tall" ]
  90.     then
  91.     echo
  92. fi
  93. echo "ABCDEFGHIJ klmnopqrs 12345 ()#-+[]/"
  94.  
  95. done
  96. done
  97. done
  98. done
  99. done
  100. done
  101. done
  102.  
  103. epfont -z
  104. echo
  105.  
  106. ------------------------------- end of epdemo ---------------------------------
  107.  
  108. ---------------------------------- epfont -------------------------------------
  109.  
  110.  
  111. # epfont
  112. # echoes escape codes for various fonts, styles and sizes for an
  113. # Epson LQ-510 printer.  Designed to be incorporated into shell
  114. # scripts piped to printer.
  115.  
  116. USAGE="epfont
  117.     -d doublestrike -e emphasized -f font -h height -i italic
  118.     -j justification -p pitch -q quality -s style -u underline
  119.     -w width -x sub/superscript -z resets
  120.  
  121.     -d normal|strike
  122.     -e normal|emphasized
  123.     -f roman|sans|courier|prestige|script|ocra|ocrb|orator|orators
  124.     -h normal|tall
  125.     -i normal|italic
  126.     -j left|center|right|full
  127.     -p 10|12|15|condensed|proportional|cancel
  128.     -q draft|lq
  129.     -s normal|shadow|outline|shadline
  130.     -u on|off
  131.     -w normal|wide
  132.     -x subscript|superscript|normal
  133.     -z resets
  134.     
  135.     most arguments require first 2 letters only, case ignored
  136.     "
  137.  
  138. myerror()
  139. {
  140. echo $0 option -$d bad argument: $OPTARG
  141. echo "$USAGE"
  142. exit 2
  143. }
  144.  
  145. while getopts d:e:f:h:i:j:p:q:s:u:w:x:z d
  146. do
  147.     case $d in
  148.         d | D )
  149.             case $OPTARG in
  150.                 [Nn][Oo]*)
  151.                     echo "\033H\c"
  152.                     ;;
  153.                 [Ss][Tt]*)
  154.                     echo "\033G\c"
  155.                     ;;
  156.                 *)
  157.                     myerror
  158.                     ;;
  159.             esac
  160.             ;;
  161.         e | E )
  162.             case $OPTARG in
  163.                 [Nn][Oo]*)
  164.                     echo "\033F\c"
  165.                     ;;
  166.                 [Ee][Mm]*)
  167.                     echo "\033E\c"
  168.                     ;;
  169.                 *)
  170.                     myerror
  171.                     ;;
  172.             esac
  173.             ;;
  174.         f | F )
  175.         # fonts
  176.             case $OPTARG in
  177.                 [Rr]*)
  178.                     echo "\033k\000\c"
  179.                     ;;
  180.                 [Ss][Aa]*)
  181.                     echo "\033k\001\c"
  182.                     ;;
  183.                 [Cc][Oo]*)
  184.                     echo "\033k\002\c"
  185.                     ;;
  186.                 [Pp][Rr]*)
  187.                     echo "\033k\003\c"
  188.                     ;;
  189.                 [Ss][Cc]*)
  190.                     echo "\033k\004\c"
  191.                     ;;
  192.                 [Oo][Cc][Rr][Bb])
  193.                     echo "\033k\005\c"
  194.                     ;;
  195.                 [Oo][Cc][Rr][Aa])
  196.                     echo "\033k\006\c"
  197.                     ;;
  198.                 [Oo][Rr][Aa][Tt][Oo][Rr][Ss])
  199.                     echo "\033k\010\c"
  200.                     ;;
  201.                 [Oo][Rr][Aa][Tt][Oo][Rr])
  202.                     echo "\033k\007\c"
  203.                     ;;
  204.                 *)
  205.                     myerror
  206.                     ;;
  207.             esac
  208.             ;;
  209.         h | H )
  210.             case $OPTARG in
  211.                 [Nn][Oo]*)
  212.                     echo "\033w\000\c"
  213.                     ;;
  214.                 [Tt][Aa]* | [Hh][Ii]*)
  215.                     echo "\033w\001\c"
  216.                     ;;
  217.                 *)
  218.                     myerror
  219.                     ;;
  220.             esac
  221.             ;;
  222.         i | I )
  223.             case $OPTARG in
  224.                 [Nn][Oo]*)
  225.                     echo "\033\065\c"
  226.                     ;;
  227.                 [Ii][Tt]*)
  228.                     echo "\033\064\c"
  229.                     ;;
  230.                 *)
  231.                     myerror
  232.                     ;;
  233.             esac
  234.             ;;
  235.         j | J )
  236.             case $OPTARG in
  237.                 [Ll][Ee]*)
  238.                     echo "\033a\000\c"
  239.                     ;;
  240.             [Cc][Ee]*)    
  241.                     echo "\033a\001\c"
  242.                     ;;
  243.             [Rr][Ii]*)    
  244.                     echo "\033a\002\c"
  245.                     ;;
  246.             [Ff][Uu]*)    
  247.                     echo "\033a\003\c"
  248.                     ;;
  249.                 *)
  250.                     myerror
  251.                     ;;
  252.             esac
  253.             ;;
  254.         p | P )
  255.             case $OPTARG in
  256.                 10)
  257.                     echo "\033p\c"
  258.                     ;;
  259.                 12)
  260.                     echo "\033M\c"
  261.                     ;;
  262.                 15)
  263.                     echo "\033g\c"
  264.                     ;;
  265.                 [Cc][Oo]*)
  266.                     echo "\017\c"
  267.                     ;;
  268.                 [Pp][Rr]*)
  269.                     echo "\033p1\c"
  270.                     ;;
  271.                 [Cc][Aa]*)
  272.                 # note -p cancel cancels both condensed and proportional
  273.                     echo "\022\033p0\c"
  274.                     ;;
  275.                 *)
  276.                     myerror
  277.                     ;;
  278.             esac
  279.             ;;
  280.         q | Q )
  281.             case $OPTARG in
  282.                 [Dd][Rr]*)
  283.                     echo "\033x\000\c"
  284.                     ;;
  285.                 [Ll][Qq])
  286.                     echo "\033x\001\c"
  287.                     ;;
  288.                 *)
  289.                     myerror
  290.                     ;;
  291.             esac
  292.             ;;
  293.         s | S )
  294.             case $OPTARG in
  295.                 [Nn][Oo]*)
  296.                     echo "\033q\000\c"
  297.                     ;;
  298.             [Oo][Uu]*)    
  299.                     echo "\033q\001\c"
  300.                     ;;
  301.             [Ss][Hh][Aa][Dd][Oo]*)    
  302.                     echo "\033q\002\c"
  303.                     ;;
  304.             [Ss][Hh][Aa][Dd][Ll]*)    
  305.                     echo "\033q\003\c"
  306.                     ;;
  307.                 *)
  308.                     myerror
  309.                     ;;
  310.             esac
  311.             ;;
  312.         u | U )
  313.             case $OPTARG in
  314.                 [Oo][Nn]*)
  315.                     echo "\033-1\c"
  316.                     ;;
  317.                 [Oo][Ff]*)
  318.                     echo "\033-0\c"
  319.                     ;;
  320.                 *)
  321.                     myerror
  322.                     ;;
  323.             esac
  324.             ;;
  325.         w | W )
  326.             case $OPTARG in
  327.                 [Nn][Oo]*)
  328.                     echo "\033W\000\c"
  329.                     ;;
  330.                 [Ww][Ii]*)
  331.                     echo "\033W\001\c"
  332.                     ;;
  333.                 *)
  334.                     myerror
  335.                     ;;
  336.             esac
  337.             ;;
  338.         x | X )
  339.             case $OPTARG in
  340.                 [Ss][Uu][Bb]*)
  341.                     echo "\033S1\c"
  342.                     ;;
  343.                 [Ss][Uu][Pp]*)
  344.                     echo "\033S0\c"
  345.                     ;;
  346.                 [Nn][Oo]*)
  347.                     echo "\033T\c"
  348.                     ;;
  349.                 *)
  350.                     myerror
  351.                     ;;
  352.             esac
  353.             ;;
  354.         z | Z )
  355.             echo "\033@\c"
  356.             ;;
  357.         \?)
  358.             echo "$USAGE"
  359.             exit 2
  360.             ;;
  361.     esac
  362. done
  363. shift `expr $OPTIND - 1`
  364.  
  365. ---------------------------- end of epfont -------------------------------------
  366.