Graphics; Programming - Brother HL-Series Technical Reference Manual

Hide thumbs Also See for HL-Series:
Table of Contents

Advertisement

G
RAPHICS
HP-GL/2 or HP-GL mode offers many powerful graphic features that enable you to draw and print
detailed images quickly and easily. Many commercial graphic packages, notably computer-aided
design applications programs, produce HP-GL/2 or HP-GL output. LaserJet mode also has several
graphics features. You can either write your own programs to generate images or use existing
graphics software.
P
ROGRAMMING
If you are writing software, for example in BASIC or C, to drive the printer, the description and
formal specification of each command will enable you to transcribe them straight into your
programs. Below is a simple example of a program to draw and print a three inch black square. The
program is given in both C and BASIC.
C language program
#include <stdio.h>
main()
{
FILE *prn; /* initialization section */
prn = fopen("PRN","wb");
fprintf(prn,"\33E"); /* Esc E - Reset the printer */
fprintf(prn,"\33%0B"); /* Esc%0B - Enter HP-GL/2 */
fprintf(prn,"IN"); /* Initialize */
fprintf(prn,"SP1PA1024,1024"); /* Select pen 1 & move to 0,0
*/
fprintf(prn,"PDFT1RA4096,4096"); /* Draw 3" solid square */
fprintf(prn,"\33%0A"); /* Quit HP-GL/2 & restore original
cursor position */
fprintf(prn,"\33E /* Reset and eject page */
}
BASIC language program
10 LPRINT CHR$(27);"E"; :REM Esc E - Reset the printer
20 LPRINT CHR$(27);"%0B"; :REM Esc%0B - Enter HP-GL/2
30 LPRINT "IN"; :REM Initialize
40 LPRINT "SP1PA1024,1024"; :REM Select pen 1 & move to 0,0
50 LPRINT "PDFT1RA4096,4096"; :REM Draw 3" solid square
60 LPRINT CHR$(27);"%0A"; :REM Quit HP-GL/2 & restore
original cursor position
70 LPRINT CHR$(27);"E"; :REM Reset and eject page
FONT DEVELOPMENT
In LaserJet 4 mode you can send your own character designs to the HL Series laserprinter and print
text using them. To do this you need first to design your characters on paper. Having done this you
can then either input and download your characters using a commercial software package, or encode
your designs numerically and write your own program to download them.
3

Advertisement

Table of Contents
loading

Table of Contents