Closed tillkamppeter closed 2 years ago
@tillkamppeter I will consider this, however there are many environments where this defaulting is insufficient. I'd also want to support libpaper on platforms that have it...
es_CL default is Letter. Legal is another format used for, well, legal documents here. [An] formats are foraneous here.
[master c08ee0f] Add papplLocGetDefaultMediaSizeName API (Issue #167)
OK, thanks, but Brazil has A4 as default paper size. This is my personal experience from being there. I know it at least from the states of Minas Gerais and Espirito Santo, but I assume that it is A4 in the whole country.
I would even say that the whole South America uses A4, except es_CL
as reported above ...
@tillkamppeter Thanks, I was able to find a more authoritative source than OOo and Windows: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html
[master ef6f1f8] Update list of US Letter countries.
In the PostScript Printer Application I have added the following function to determine by the system's locale environment variables whether the standard page size at the user's location is A4 or Letter:
It returns "A4" or "Letter" if it can determine suitable locale information and NULL otherwise.
I use it when creating a new print queue and the default page size for the printer is A4 or Letter and the printer supports both A4 and Letter page sizes to get the actually more suitable size as the default. I use following code for that (Note that the PostScript Printer Application gets the printer capabilities from the printer's PPD file):
choice
is the default to be used for the "PageSize" option (and so also for the size inmedia_default
). If we can determine a standard size from the locale and if the default of the "PageSize" option in the PPD is A4 or Letterwe switch to A4 or Letter according to the locale, otherwise we stay with whatever is the default in the PPD.My feature request here is to add a function like
ps_default_paper_size()
to the public API of PAPPL (call it something likepapplDefaultPaperSize()
then) and perhaps also another function which does something similar to my example code but more generally usable (applying to apappl_media_col_t
record or tomedia_default
in apappl_pr_driver_data_t
data structure). It would be great when an A4/Letter default gets auto-adjusted when creating a new queue,