groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] groescp update


From: Roger Leigh
Subject: Re: [Groff] groescp update
Date: Fri, 02 Jan 2004 10:10:25 +0000
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Werner LEMBERG <address@hidden> writes:

>> > If the user selects font `R', the font really used is `latin1R'.
>> > Consequently, you have to set up the ESCP fonts like that:
>> >
>> >   ascii: asciiR, asciiB, asciiI, asciiBI
>> >   latin1: latin1R, latin1B, latin1I, latin1BI
>> >   ...
>> >
>> > To activate this mechanism it is only necessary to add the line
>> >
>> >   family ascii
>> >
>> > to the escp's DESC file, providing `ascii' as the default.
>> 
>> This does look very interesting.  I won't do this for the first
>> version though!
>> 
>> Presumably if I abuse .fam in this way, I won't be able to support
>> selectable fonts (though the low end printers don't tend to support
>> more than one typeface).
>
> Please give more information on available fonts.

It's a bit baroque:

Early printers have a few selectable typefaces.  For example "EPSON
FX" or "IBM #1" or "IBM #2".  Both are US-ASCII plus some extra chars
(the FX charset is extended, possibly CP 437, the IBM set is italic if
the high bit is set IIRC, or it may be a proprinter charset--it's not
documented, unfortunately).  As a complication, various national
characters (£, ¤, ë, é, ø, etc.) are selectable too.  These /replace/
various US-ASCII characters (e.g. '#' -> '£' if the UK is selected)
which is horrible--you could easily want to use both at once.

More modern (ESC/P2) printers have "proper" character set selection,
where you can actually specify an encoding e.g. CP437, CP850,
ISO-8859-1 etc.  However, this is a minority of printers, and no one
encoding is supported by all printers.  CP437 is most common, however.
ISO-8859-1 is very rare, and UTF-8/UCS is unheard of.

Because it's so nasty, I generally leave them set as "US", simply
because I need to print '#'!!

IMHO, it will be tricky to support.  I only currently have 3 models of
dot matrix printer to test with, so it will be very difficult to do in
a general way, not just geared towards the few models I have access
to.  Given that it seems both non-standard and rather complex, I think
I'll pass on implementing it for now.

>> I've attached the current version of the patch.  It's nearly
>> suitable for inclusion, I believe.  My only real issue is page
>> breaks: the page length (nlines) is set to 60, but I get >60 (65)
>> lines in the output.
>
> You have to make a distinction between the paper length GNU troff uses
> (as set with the .pl request) and the physical paper length provided
> by the output device.  The function xxx_printer::end_page gets the
> troff paper length as a parameter; it is up to the device to decide
> what to do with that value.  grotty, for example, takes the troff
> paper length directly as the `physical' paper length.  grops, on the
> other hand, ignores the parameter since the paper dimensions have been
> set with the `-p' option.  I assume that ESC/P printers have the
> ability to set the physical paper length, so you should add support
> for a `-p' command line option.

I see.  I was wondering what was going on--the DESC file set it to 66
(physical) lines, but not all of these are printable.

To clear up my confusion:

I've set the physical paper dimensions with "res", "hor" and "vert" in
the DESC file.  But, these are not paper dimensions but the printable
area?  If I adjust these to specify an 8i by 10i area, that should do
the trick?

[Not strictly needed now, but what if the printable area is a function
of the physical size e.g. paperlength - 1.5i and paperwidth - 1i?]  On
EPSON printers, they typically can't print on the top or bottom 0.5",
but don't have a limit on the width--they will print right up to the
edge of the paper.  With some printers, this is dependent on the paper
feed mechanism used (e.g. single sheet means the bottom 1i is
unusable).

The printer has a command to specify the physical paperlength, so I
should use -p (or paperheight in DESC) to set this value, and set it
at the start of the job.


I'll take a look at the code you sent me when I get a chance--I
thought it would be quiet at work this week, but it's been more manic
than ever!


Happy New Year!

Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]