delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/16/11:29:13

Date: Wed, 16 Jun 1999 10:40:13 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Vince McCarthy <vmccar AT juno DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Need help with printer
In-Reply-To: <19990615.105120.10271.0.vmccar@juno.com>
Message-ID: <Pine.SUN.3.91.990616103948.16595G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019