Mail Archives: djgpp/1999/06/16/11:29:13
On Tue, 15 Jun 1999, Vince McCarthy wrote:
> The result is the font changes to Courier from draft but will not
> change to script. It stays in the Courier font. The only way to clear
> the printer is to cycle the power.
So evidently some of the commands do work, while others don't, right?
If so, this is not some fundamental problem with DJGPP's stdprn
stream, it is most probably some mistake in the commands you issue or
the way you issue them. I would suggest reading the printer manual
carefully for any tidbits that you might have missed.
Anyway, your code seems okay by inspection (I don't have access to a
machine with a Panasonic printer, so I cannot actually run it), except
for several comments:
- This fragment:
> TypeFace(int Font) {
> if (Font == 1) { /*--- Sanserif ---*/
> fprintf(stdprn,"\x1B \x1b\x6B \x1B\x01"); }
> return 0;
> }
indicates that the `TypeFace' function is a no-op for any value of
Font except 1. Can it be that this is the reason that some of the
commands don't work?
- Why are you sending blanks to the printer? They are not part of
the control sequences, maybe they confuse the printer?
- It is usually a bad idea to use arbitrary strings as the second
argument to `fprintf', because if the string includes a `%'
character, `fprintf' will interpret it. If you want literal
strings to be output, say something like this:
fprintf (stdprn, "%s", "\x1B \x1b\x6B \x1B\x01");
- If nothing else helps, try sending the Reset command to the
printer when you want to go back to the draft mode.
- Raw text -