kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #26621
Re: Default paper size and locale
On Tue, Oct 11, 2016 at 02:36:09PM -0400, Wayne Stambaugh wrote:
> I'm OK with changing this to the current locale. It has to default to
> something when the object is created. A PAGE_INFO object ctor could be
> created to do this.
There is a couple of problems with that. Mostly that paper sizes are
hardcoded in kicad and not necessarily the locale paper is known (for
example JIS A4 is theorically different even if it's *exactly* A4). The
second is that AFAIK there is no way to access the locale paper size in
a portable way (at least not in POSIX/XOpen/SuS libc, neither localeconv
nor nl_langinfo give access to it AFAIK. In theory it could be set
through LC_PAPER (to override LANG) but I've never seen how is it
accessed...in fact the Debian people invented libpaper exactly to solve
this problem (BTW it has its own config file). As in wx the only thing I
found is the wxPaperSize enum and the paper database, wxLocale doesn't
handle it. IIRC in Windows you can get the default paper of the default
printer but not the default paper of the current locale.
So the first problem to solve is *how* to retrieve the locale paper
size! If anybody know I'm curious...
BTW many programs have their own ad-hoc solutions, (La)TeX has a
configure tool, LibreOffice get it from the CUPS default printer (sad
thing: LibreOffice 5 *requires* CUPS!) other have an A4/Letter default
build time option. And then there is libpaper which AFAIK is Debian
specific.
> > A slightly less interesting question is why this appears not to be
> > something the user can configure.
The 'default' paper size is not so interesting after all, when you
compile the title block you simply pick your paper. For me a default of
A3 landscape would cover 99% of the usage but it's so little time lost
that I didn't even patched the source:P
--
Lorenzo Marcantonio
References