home *** CD-ROM | disk | FTP | other *** search
- n,"IBM ProPrinter"; {for BitFont 5.1 and up}
- t:cn="(c) Copyright 1988,1989 Bruce J. Patin 12-21-88, 02-01-89";
- {IBM and ProPrinter are trademarks of the
- International Business Machines Corporation}
-
- {To create valid ProPrinter characters with BitFont, note the following:
- - Character height and width must always be: CH=8, CW=11.
- - An 8-dot high character normally uses the top 8 wires of the
- print head. A character may be shifted down to use the bottom 8
- wires of the print head. The downshift is indicated in BitFont
- by changing the "TO.Top Offset" parameter from 7 to 6.
- This will result in sending an "attribute" of 1 to the printer.
- When you change the top offset, the location of the baseline
- will change on the design screen. This is for reference only.
- - Don't use the N-Normalize function on the design screen,
- unless you want to fix up every downshifted character again
- and change CH back to 8 for every character.
- - Don't worry about the character count. BitFont will count them. Also,
- any gaps in character codes will be filled in with blank characters.
- }
- {initialize BitFont specific variables}
- a: aa=1; {allow adjacent dots. Only necessary to disallow for certain wire matrix printers.}
- x: df=2; {init data format to 2, Wire Matrix}
- x: xd=2; {double horizontal density}
- x: yd=1; {single vertical density}
- x: pw=8; {8 print wires used in data}
- x: cw=11; {max character width}
- x: ch=8; {max character height}
- x: lo=0; {always 0}
- x: to=7; {7=normal, 6=downshifted character}
- a: fw=11; {max character width for whole font}
- a: fh=9; {this is the actual font height, including downshifting}
- a: bl=7; {marks bottom line of un-down-shifted character}
- x: or=0; {always 0}
- {you could also initialize the color variables in here, if desired}
-
- a: d8=0; {d8=0 during font save to file, d8=1 for downloading}
- e; {end initialization section.}
- a: zt=0; {will get no font trailer message if not loading entire font}
-
- KI; {start input font header.}
-
- {a little re-initialization first}
- a: aa=1; {allow adjacent dots. Only necessary to disallow for certain wire matrix printers.}
- x: df=2; {init data format to 2, Wire Matrix}
- x: xd=2; {single horizontal density}
- x: yd=1; {single vertical density}
- x: pw=8; {8 print wires used in data}
- x: cw=11; {max character width}
- x: ch=8; {max character height}
- x: lo=0; {always 0}
- x: to=7; {7=normal, 6=downshifted character}
- a: fw=11; {max character width for whole font}
- a: fh=9; {this is the actual font height, including downshifting}
- a: bl=7; {marks bottom line of un-down-shifted character}
- x: or=0; {always 0}
-
- a: zt=1; {used to suppress no font trailer message}
- #:**, "Loading Font Header ";
- L 2;
- u: za;
- j 2: za,ne,$1b; {look for esc}
- u: zb;
- j 2: zb,ne,$3d; {look for = }
- ws: ct; {count, number of bytes in font}
- z 3:ct; {start length limit for count, end load when done}
- u: zz; {throw away byte decimal 20}
- u: fc; {first character code}
- a: lc=ct-2/13+fc-1; {calculate last character code}
- $:fc,"First Character code is (hex): ";
- $:lc,"Last Character code is (hex): ";
- #:**,"Hit return to continue";
- EI; {end input font header.}
- a:cc=fc; {start with first code}
- j 1; {first time, jump around code increment}
- L 2; {start of code increment}
- j 3:cc,eq,lc; {end load when code is last code}
- a:cc=cc+1; {increment code}
- L1; {label 1 to indicate start of character.}
- $ : cc,"Loading code (hex) ";
- u: sa; {load the shift attribute}
- a: to=7-sa; {translate shift attribute into top offset}
- u: zz; {throw away the null byte}
- g; {get the character bit data}
- ESL; {end character search, character loaded.}
- j 2; {go get next char}
- L 3;
- r; {reset length limit}
- #:**,"Font loaded.";
- ET; {end input font.}
- KS; {start search for an input character.}
- L 12;
- u: za;
- j 12: za,ne,$1b; {look for esc}
- u: zb;
- j 12: zb,ne,$3d; {look for = }
- ws: ct; {count, number of bytes in font}
- u: zz; {throw away space}
- u: fc; {first character code}
- a: lc=ct-2/13+fc-1; {calculate last character code}
- j 10:cc,lt,fc; {if code is less than first code, not found}
- j 10:cc,gt,lc; {if code is greater than last code, not found}
- # : cc,"Loading code: ";
- j 1; {found, go get it}
- L 10; {char not found}
- ESU; {end character search program (unsuccessful search)}
- KO; {start output font header.}
- L 88; {for download}
- #:**, "Finding first and last codes for font header information.";
- {starting to find first and last character codes}
- a:cc=32; {start with one less than ProPrinter first valid code}
- c; {select first valid code}
- a:fc=cc; {save first code in fc}
- j 22:fc,eq,0; {error if no valid code}
- j 23:fc,gt,126; {error if first code value too high}
- L 21; {loop to find last code}
- a:lc=cc; {set lc to last valid code selected}
- a:cc=cc+1; {increment to next possible code}
- c; {select next code}
- j 24:cc,gt,126; {stop if higher than decimal 126}
- j 21:cc,ne,0; {loop if haven't reached last valid code}
- L 24;
- a:ct=lc-fc+1*13+2; {calculate count}
- u:$1b; {escape}
- u:$3d; {=}
- ws:ct; {count, bytes swapped}
- u:20; {decimal code 20, per ProPrinter specs}
- u:fc; {first code}
- j 25;
- L 22; #:**,"ERROR: No valid code of value 21 (hex) or greater.";
- j 99;
- L 23; #:**,"ERROR: No valid code less than or equal to 126 (hex).";
- j 99;
- L 25; {end font descriptor output}
- EO; {end output font header.}
- a:kk=fc; {start with first code}
- KC; {start output character}
- L 31;
- $ :kk,"Sending code (hex): ";
- a:cc=kk; {set code for selection}
- c; {select the code}
- j 32:cc,eq,kk; {if valid, go output it, otherwise output blank character}
- u:$00; {attribute}
- u:$00,12; {blank character}
- j 33;
- L 32; {start output a valid character}
- {make sure character data is decimal 13 bytes}
- a:df=2;
- a:yd=1;
- a:cw=11;
- a:ch=8;
- x:pw=8;
- {start to make sure top offset is 7 or 6}
- j 34:to,gt,7;
- j 34:to,lt,6;
- j 35;
- L 34;
- a:to=7;
- L 35;
- u:to-7; {convert top offset into attribute}
- u:$00; {send a null byte}
- g; {character data}
- L 33;
- EC; {end output character.}
- a:kk=kk+1;
- j 31:kk,le,lc; {loop until sent last code}
- j 89:d8,eq,1; {go finish download if downloading}
- EZ; {end output font.}
- KP; {start download}
- a:d8=1; {downloading indicator}
- j 88; {go save font to the printer}
- L 89; {now select the downloaded font}
- a:d8=0; {turn off download indicator}
- L 81;
- #A:nn,"Enter 4 for normal quality, or 6 for NLQ: ";
- j 81:nn,eq,5;
- j 81:nn,lt,4;
- j 81:nn,gt,6;
- u:27;
- u:73;
- u:nn;
- #:**," Font loaded and selected.";
- EP; {end download}
- L 99; {error exit}
- .