home *** CD-ROM | disk | FTP | other *** search
- N,"Hex Font G";
- t:cn="(c) Copyright 1988,1989 Bruce J. Patin 12/28/88, 01/23/89";
- { Format for each character is "@ cc ch cw df yd pw hexdata",
- where @ starts the character, and cc, ch, cw, df, yd, p are decimal:
- cc = character code,
- ch = character height,
- cw = character width,
- df = 1, 2 or 3, to select format:
- 1 if data is in CRT format,
- 2 if in Wire Matrix format,
- 3 if in Wire Matrix, separated by passes,
- yd = number of passes,
- pw = number of wires used for multi-pass printing,
- hexdata = the character bit data in hexadecimal characters.
-
- The above items may be separated by spaces, commas,
- or carriage return/line feeds, as desired.
-
- It is important to make sure there are enough bytes
- of hexdata for the selected values of height, width, etc.
- If some other method than BitFont is used to generate
- the data, it would be wise to add extra 00's to the
- end of the data just in case.
- }
- { following are default assignments:}
- x: df=1; {init data format to 1}
- x: xd=1; {double horizontal density. Does not affect character
- data, merely the displayed density of dots.}
- x: yd=1; {one pass, normal vertical density}
- x: pw=8; {number of print wires used if multi-pass printing}
- x: to=15; {offset of character top to baseline.
- This does not affect character data in this configuration, merely display of baseline.
- unless, perhaps, you use the Normalize function.}
- x: lo=0; {left offset, ignore it}
- x: cw=16; {default character width}
- x: ch=16; {default character height}
- a: aa=1; {allow adjacent dots}
- a: fw=cw; {maximum font cell width, for Normalize function}
- a: fh=ch; {max font cell height, for Normalize}
- a: bl=to; {position of baseline relative to top of font cell.}
-
- E; {end initialization section.}
-
- Ki1,"Load font"; {start input font.}
- #:**,"Using Hex Font G to load font";
- z 12:fs-fp; {will cause jump to L12 if end of file is reached}
- L 88;
- #:**,"Searching for @ character";
- L 8; {start of loop to get each character}
- u: zz; {read a byte}
- j 8: zz,ne,64; {look for @ sign (decimal 64) to start character}
- d: cc; {character code in decimal}
- L 1; {label 1 to indicate start of character.}
- # : cc,"Loading code (decimal) ";
- d: ch; {character height, in decimal}
- d: cw; {character width, in decimal}
- d: df; {1, 2 or 3, to select format}
- d: yd; {number of passes}
- d: pw; {number of wires used for multi-pass printing}
- gh; {character data, represented in hex}
- ESL; {end character search, character loaded.}
- # : cc,"Loaded code (decimal) ";
- j 88; {go get next char}
- L 12; {end of file reached}
- # : **,"Loaded.";
-
- Ei1,2,0; {end load font.}
-
- KS; {start search for an input character.}
- j 12:fp,ge,fs; {L12 is end of file reached}
- L 9; {start loop to search}
- u: zz; {read a byte}
- j 9: zz,ne,64; {look for @ sign to start character}
- d: zc; {character code in decimal}
- #: zc,"Encountered code (decimal): ";
- #: fp,"At file position: ";
- j 9: zc,ne,cc; {check to see if it's the one you want}
- # : cc,"Found code (dec)";
- j 1; {found, go get it}
- L 10; {char not found}
- ESU; {end character search program (unsuccessful search)}
-
- ko1,"Save font."; {start output font }
- {following lines select characters to output}
- a:cc=0; {start with first possible code, zero}
- c; {select first valid code}
- j 57; {bypass first check to see if cc is back to zero}
- L 55; {jumped here to get next code}
- c; {select first valid code}
- j 59:cc,eq,0; {go to 59 if no more valid codes (cc is back to zero)}
- L 57; {valid code selected}
-
- KC; {start output character.}
- # : cc,"Sending code (decimal): ";
- y:"@ "; {indicate start of a character}
- d: cc,4; {decimal code of character, followed by a space}
- d: ch,4; {decimal value of height}
- d: cw,4; {decimal value of width}
- d: df,4; {decimal value of format}
- d: yd,4; {decimal value of number of passes}
- d: pw,4; {decimal value of number of wires}
- w: $0d0a; {output a carriage return, line feed}
-
- {***********}
- {the following loop to output data could be replaced, and
- greatly sped up, by simply coding:
- gh;
- however, the data bytes would not be separated for easy reading.}
- a: zz=0; {using zz to count data bytes}
- L 77; {start of loop to output a byte}
- j 78:zz+32,gt,dl; {check to see that at least 32 bytes are left}
- gh:zz,32; {output 32 data bytes in hex characters}
- a: zz=zz+32; {increment count}
- j 79; {jump around next gh}
- L 78;
- gh:zz,dl-zz; {output remainder of data if less than 32 bytes}
- a: zz=dl; {now have output dl bytes}
- L 79;
- w: $0d0a; {output a carriage return, line feed}
- j 77:zz,lt,dl; {go output another byte, if count is less than data length}
- {***********}
- w: $0d0a; {output a carriage return, line feed}
-
-
- EC; {end output character.}
- a:cc=cc+1; {increment to next code}
- j 55; {jump to select it, or next higher valid code}
- L 59; {all characters have been written}
-
- Eo1; {end save font.}
-
- KP; {start download}
- # :**,"This font can not be downloaded in its present form.";
- EP; {end download}
- .