Keep in mind that Dot Matrix ROM chip fonts don't work like the
"installable" softfonts, nor like Windows .fon or .ttf font files.
However...
after digging through some of my "old skool" stuff, I found this EPSON
mode example thats in BASIC.
2 REM CONTROL COMMAND: ESC !n
5 REM OPEN PRINTER DEVICE
10 OPEN "LPT1:" FOR OUTPUT AS #1
15 REM DEFINE CONTROL CODES: SO, ESCAPE, AND LINEFEED
20 SO$=CHR$(14):ESC$=CHR$(27):LF$=CHR$(10)
2610 PRINT #1,SO$;"ESC ! n"
2630 FOR J=0 TO 7
2640 I=2^7
2650 IF I=1 THEN I=0:REM OFFSET 1
2660 IF I=2 THEN I=1:REM JUMP UNNECESSARY MODES
2670 PRINT #1,ESC$;"!";CHR$(I);"PRINTING MODE ";I:NEXT J
2680 PRINT #1,ESC$;"!";CHR$(O);LF$;LF$
The output from this program is as follows (as close as I can
represent it):
ESC ! n (about fontsize 30)
PRINTING MODE 0 (NORMAL DOTMATRIX SIZE = 10)
PRINTING MODE 1 (SMALLER THAN NORMAL, ABOUT FONTSIZE 7 OR 8)
PRINTING MODE 4 (ABOUT FONTSIZE 5 OR 6)
PRINTING MODE 8 (SLIGHTY SMALLER THAN NORMAL = 8)
PRINTING MODE 16 (FONT SIZE 8, BOLD)
PRINTING MODE 32 (VERY LARGE, 32 POINT FONT)
PRINTING MODE 64 (ITALICS, ABOUT FONTSIZE 8)
PRINTING MODE 128 (UNDERLINE, FONTSIZE 8)
So, You can readily tell that directly talking to the printer in
control codes is not a way that will provide you with a reliable way
of producing a consistant font size(this is also determined by
manufacturer implementations in DIFFERENT VERSIONS of the ROM chips).
So, The best thing you can do (since you said you are doing this from
MS Word, then you're using windows), is to...
Go to Start/Settings/Printers.
Add a Local Printer
Set the printer up with the "Epson Compatible 9 Pin" driver, the IBM
"Generic IBM Graphics 9 Pin" driver, or a simple "HP Deskjet" driver
(the HP driver won't interfer with any output you send to the
printer... we do that at my place of work all the time).
If none of those work, then as a last resort, try the "Mannesmann
Tally MT 150/9". I have a cranky epson with dual IBM and EPSON
emulation that got confused on lost of things, but the Mannesmann
Tally driver was able to keep it straight.
After the driver is installed, then besure to print a test page. If
you see the 9 pin printer accurately create the Windows Logo on the
paper... then it will work with anything you decide to do with MS Word
(then you can use reliable truetype fonts, and the printer won't care
at all, it will only see all of the data as an image in memory that's
called a Windows Metafile, or DIB).
Do a search on google for Metafile, DIB, and/or Dot Matrix
Compatibility.
As far as your program is concerned, you can use a little VBA (Visual
Basic for Applications) programming to store and modify the Font size
used for any text report. Search google for the Microsoft MSDN site,
and then search for VBA and/or MS Word Document Object Model.
Good Luck! |