On Tue, 30 Apr 2002, David Starner wrote:
> On Tue, Apr 30, 2002 at 11:09:55PM -0400, Jungshik Shin wrote:
> > However, to me overiding the default at the command line is a perfectly
> > good solution.
>
> Everytime you use a program?
> Stuff like that gets real tiring, real fast
> to me.
What are shell scripts/aliases for ;-) ? What if your site has
multiple printers with different sizes of paper loaded by default?
How about printers with multiple trays? Whichever method you use to
set the default, you have to use a command line option or other means
to overide the default. However, I have to admit that you clearly have
a point. It's not most desirable for programs to derive the default paper
size from the locale *name* assigned to LC_PAPER. It's certainly true that
if programs rely on /etc/papersize instead of mapping the locale *name*
to the default papersize, it's easier to change the default paper size.
What has to be done is to use the actual *value* stored in LC_PAPER
instead of 'guessing' the default paper size from the locale *name*
provided that LC_PAPER is a standard locale category. It's not, yet.
I was wrong to say that LC_PAPER is defined in ISO 14652
(draft). It's not there. SUS V3 doesn't have it, either. So,
it's not a standard locale category but at least it's available
where glibc 2.2.x is used (i.e. all Linux distributions
including Debian) Even there, nl_langinfo(PAPER_HEIGHT) and
nl_langinfo(PAPER_WIDTH) don't work yet. langinfo.h in glibc 2.2.x has
_NL_PAPER_HEIGHT and _NL_PAPER_WIDTH. Therefore, programmers might
use nl_langinfo(_NL_PAPER_WIDTH) and nl_langinfo(_NL_PAPER_HEIGHT).
However, it's not very portable (both across platforms and over the
time) because I believe '_' at the beg. of _NL_PAPER_* indicates their
non-standard nature. Now what follows is based on not what it's widely
available (or standard) but what it may be in the future.
<hypothetic situation>
How often do you (think people) use papersize other than US letter
(or A4 outside the US)? If the answer is most of time, you can
build your own locale with LC_PAPER defined for the most frequently used
papersize at your site (say, en_US.UTF-8@legal)? Then, you can have
LC_PAPER=en_US.UTF-8@legal
LANG=en_US.UTF-8
And a French living in the US may have
LC_PAPER=en_US.UTF-8@legal
LANG=fr_FR.UTF-8
What difference is there between setting /etc/papersize and building
and installing a new locale for your favorite size? Sure, editing one-line
is easier than building a new locale. However, it's not so flexible as
you think. With en_US.UTF-8@legal built and installed, different users
with different choices of the default paper size (because their offices
have different printers with the primary tray for different papersize)
can happily *share* a *single* system. They don't have to fight over
which paper size goes into /etc/papersize. Those who mainly use US letter
can just set LANG to en_US.UTF-8 and leave LC_PAPER alone (or they can
specify that to en_US.UTF-8 if they want to). Others who mainly use legal
paper can set LC_PAPER to en_US.UTF-8@legal with LANG set to en_US.UTF-8.
</hypothetic situation>
Jungshik Shin
(1) LC_PAPER definition for US letter goes like this (the unit is mm.)
LC_PAPER
height 279
width 216
END LC_PAPER
You can change height and width to whatever value you want.
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/