[Top][All Lists]

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

Re: Setting paper-size

From: John Darrington
Subject: Re: Setting paper-size
Date: Thu, 20 Sep 2007 12:55:52 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Wed, Sep 19, 2007 at 09:29:47PM -0700, Ben Pfaff wrote:
     What's LC_PAPER?  This is the first I've heard of it.  I can't
     find anything about it in the glibc manual or SUSv3.  I'm happy
     to support it, though, if you've got a spec or a description.

Hmm.  It seems to be an undocumented feature, but it's there in 

Using the proglet below, I get the results:

address@hidden:~$ export LC_PAPER=en_AU
address@hidden:~$ ./a.out 
W: 210; H: 297
address@hidden:~$ export LC_PAPER=en_US
address@hidden:~$ ./a.out 
W: 216; H: 279

So it seems to be implemented in glibc at least.

#include <langinfo.h>
#include <stdio.h>
#include <locale.h>

main (int argc, char **argv)
 int w, h;
 setlocale (LC_PAPER, "");

 w = (int) nl_langinfo(_NL_PAPER_WIDTH);
 h = (int) nl_langinfo(_NL_PAPER_HEIGHT);
 printf ("W: %d; H: %d\n", w, h);

 return 0;

PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature

reply via email to

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