[csswg-drafts] [css-page] Additional Standard Paper Keywords for (page-)size (#4722)

Crissov has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-page] Additional Standard Paper Keywords for (page-)size ==
This is a consolidated and updated revision of #328 from mid-2016. 
When @fantasai closed that issue by editor discretion, she said:

> I agree with [@frivoal] that unless there is specific demand for certain keywords, 
> we should not add them pre-emptively.

I shall show that there is specific demand for certain keywords, in the fist section below. 

Moreover, although not recorded explicitly and lacking a WG decision, there appears to have been somewhat of a consensus back then that keywords should be added to [CSS][css-page] for  
*commonly used sizes* with  
*standardized identifiers* and  
*hard to remember dimensions*.  
I shall document those as well, in the second section below.

Interoperability for International Sheet and Envelope Sizes
===========================================================

**TL;DR:** Add all missing keywords for standard paper sizes in the [ISO 216] A and B series, the [ISO 269] C series and the [JIS P 0138] B series: 

* `A0`, `A1`, `A2` and `A6`, `A7`, `A8`, `A9`, `A10`
* `B0`, `B1`, `B2`, `B3` and `B6`, `B7`, `B8`, `B9`, `B10`
* `JIS-B0`, `JIS-B1`, `JIS-B2`, `JIS-B3` and `JIS-B6`, `JIS-B7`, `JIS-B8`, `JIS-B9`, `JIS-B10`
* `C0`, `C1`, `C2`, `C3`, `C4`, `C5`, `C6`, `C7`, `C8`, `C9`, `C10`

While web browser developers may seem [less than keen to invest more resources](https://caniuse.com/#feat=mdn-css_at-rules_page_size) in [css-page] than absolutely necessary, there are several applications specializing in CSS-driven PDF creation which strongly rely on this particular Module and may wish to extend its capabilities. The W3C should care about harmonizing their use of CSS to ease interchange and thereby making manuscripts more universal. 

**[WeasyPrint]** and **[Vivliostyle]** support all currently standardized keywords for [`size`][css-page] (or [`page-size`](https://github.com/w3c/csswg-drafts/issues/820#issuecomment-542792268) in the future) than standardized by [CSS in level 3][css-page]: `A3`, `A4`, `A5`, `B4`, `B5`, `JIS-B4`, `JIS-B5` (and American `Letter`, `Legal`, `Ledger`). Their open source code shows that it would be ridiculously simple to add more named sizes.

Existing implementations from **[PDF Reactor]**, **[Prince]** and **[Antenna House]** support more than those specified keywords, but they use partially incompatible custom keywords for the same physical sizes. In one case, there are three different custom keywords for the same size: `ANSI-C`, `C` and `Broadsheet` for `17in 22in`. 
However, at least two existing implementations agree on keywords and definitions of all [ISO 216] formats.
Since ISO paper sizes result from an irrational aspect ratio of √2:1 and an integer base area, A(A0) = 1 m², their odd edge lengths are hard to remember exactly. 
Their popularity, stability, ease of implementation and the difficulty of using their numeric values, makes them ideal candidates to add.

In the following table, the custom keywords already supported by implementations are highlighted if they are identical to the proposed keyword. In particular, the `ISO-` prefix supported by [Antenna House] in aliases shall not be adopted.

| Proposal | Size | [CSS] | [Prince] | [PDF Reactor] | [Antenna House] |
| --- | --- | --- | --- | --- | --- |
| `A10` | `26mm 37mm` | — | **`A10`** |**`A10`**| — |
| `C10` | `28mm 40mm` | — | **`C10`** |**`C10`**| — |
| `B10` | `31mm 44mm` | — | **`B10`** |**`B10`**| — |
| `A9` | `37mm 52mm` | — | **`A9`** |**`A9`**| — |
| `C9` | `40mm 57mm` | — | **`C9`** |**`C9`**| — |
| `B9` | `44mm 62mm` | — | **`B9`** |**`B9`**| — |
| `A8` | `52mm 74mm` | — | **`A8`** |**`A8`**| — |
| `C8` | `57mm 81mm` | — | **`C8`** |**`C8`**| — |
| `B8` | `62mm 88mm` | — | **`B8`** |**`B8`**| — |
| `A7` | `74mm 105mm` | — | **`A7`** |**`A7`**| — |
| `C7` | `81mm 114mm` | — | **`C7`** |**`C7`**| — |
| `B7` | `88mm 125mm` | — | **`B7`** |**`B7`**| — |
| `A6` | `105mm 148mm` | — | **`A6`** |**`A6`**| **`A6`** |
| `C6` | `114mm 162mm` | — | **`C6`** |**`C6`**| `ISO-C6` |
| `B6` | `125mm 176mm` | — | **`B6`** |**`B6`**| `ISO-B6`, **`B6`** |
| `A5` | `148mm 210mm` | **`A5`** | **`A5`** |**`A5`**| **`A5`** |
| `C5` | `162mm 229mm` | — | **`C5`** |**`C5`**| `ISO-C5` |
| `B5` | `176mm 250mm` | **`B5`** | **`B5`** |**`B5`**| `ISO-B5`, **`B5`** |
| `A4` | `210mm 297mm` | **`A4`** | **`A4`** |**`A4`**| **`A4`** |
| `C4` | `229mm 324mm` | — | **`C4`** |**`C4`**| `ISO-C4` |
| `B4` | `250mm 353mm` | **`B4`** | **`B4`** |**`B4`**| `ISO-B4`, **`B4`** |
| `A3` | `297mm 420mm` | **`A3`** | **`A3`** |**`A3`**| **`A3`** |
| `C3` | `324mm 458mm` | — | **`C3`** |**`C3`**| `ISO-C3` |
| `B3` | `353mm 500mm` | — | **`B3`** |**`B3`**| — |
| `A2` | `420mm 594mm` | — | **`A2`** |**`A2`**| — |
| `C2` | `458mm 648mm` | — | **`C2`** |**`C2`**| — |
| `B2` | `500mm 707mm` | — | **`B2`** |**`B2`**| — |
| `A1` | `594mm 841mm` | — | **`A1`** |**`A1`**| — |
| `C1` | `648mm 917mm` | — | **`C1`** |**`C1`**| — |
| `B1` | `707mm 1000mm` | — | **`B1`** |**`B1`**| — |
| `A0` | `841mm 1189mm` | — | **`A0`** |**`A0`**| — |
| `C0` | `917mm 1297mm` | — | **`C0`** |**`C0`**| — |
| `B0` | `1000mm 1414mm` | — | **`B0`** |**`B0`**| — |

Usability for *common*, *standardized*, *odd-valued* Page Sizes
===============================================================

**TL;DR:** Optionally, add keywords for the standard paper sizes in [ISO 217] (raw oversizes) and [ISO 5457] (untrimmed drawing paper sizes).

If the interoperability argument in the first section above was not convincing enough to add keywords for the missing sizes from [ISO 216] and all of [ISO 269], they should also qualify due to having standardized identifiers and odd length values, and even if some were not commonly used, it would be beneficial to add the complete series nevertheless, for consistency, so authors do not have to remember which sizes do not have a keyword in CSS.

The international standard paper sizes – series `A` and `B` defined in [ISO 216] and series `C` in [ISO 269], which has been withdrawn in 2009 but still exists in local norms like [DIN 276-2] – have been adopted by many national standardization bodies. 
Some have extended definitions for special purposes, e.g. the `RA` and `SRA` series from [ISO 217], German `2A0` from [DIN 476] or the now-withdrawn Swedish `D`–`G` series from [SIS 014711] and, of course, the Japanese `B` series from [JIS P 0138] that is already recognized partially by CSS. 
For envelopes in particular, there are also some sizes with an 2:1 aspect ratio that combine the non-common edges of two adjacent sizes, e.g. C5/C4. 
The respective [Wikipedia article for *paper size*](https://en.wikipedia.org/wiki/Paper_size) is quite comprehensive.

However, most of these sizes are of limited interest to most CSS authors, at least with consumer printers, but those who need any of them would certainly welcome their addition to the standard. 

Since CSS introduced the `JIS-` prefix to distinguish Japanese B sizes from international ones defined by ISO, it is not surprising that `ISO-`, `US-` and `ANSI-` also appear as prefixes for short size codes in existing implementations.

**Proposed side rule:**  

> All (new) page size keywords that use an alphanumeric code instead of a proper name, shall employ a prefix for the (original) issuing standardization body, e.g. `JIS-`, `DIN-`, `SIS-`, `GOST-`, `BS-`, `ANSI-`, `ASME-`, *unless* the code has been adopted by ISO (even if it has been deprecated since). 
<!--Non-standardized sizes should bear a prefix that identifies the applicable area of use, i.e. a country code or a moniker for the respective discipline of technology.-->

I do not propose any of those local sizes here, although some are apparently used frequently.
However, I do propose to add all sizes from two international standards, which are not covered by the interoperability argument (as of early 2020).

[ISO 217] specifies two A-based series for raw, uncut, untrimmed sheets, adding an `R` (for _primary range_) and `SR` (_supplementary range_) prefix, respectively. [PDF Reactor] does support systematic keywords for all of them. 
The actual standard seems to only require the recognition of (S)RA0, (S)RA1 and (S)RA2, but othe oversizes to the sizes of the ISO 216 A series are encountered in practice. I think it makes sense to support at least as many sizes as the following standard for drawing paper.

[ISO 5457] specifies drawing paper sizes, where the trimmed sizes with a `T` suffix are identical to the respective `A` series sizes, whereas the sides of untrimmed `U` sizes are 3 to 4 centimeters larger. The standard also specifies a fixed area for the drawing space resulting from `20mm` and `30mm` page margins, but does not assign monikers.

| Proposal | Size | [PDF Reactor] |
| --- | --- | --- |
| `SRA0` | `900mm 1280mm` | **`SRA0`** |
| `A0U` | `880mm 1230mm` | — |
| `RA0` | `860mm 1220mm` | **`RA0`** |
| `SRA1` | `640mm 900mm` | **`SRA1`** |
| `A1U` | `625mm 880mm` | — |
| `RA1` | `610mm 860mm` | **`RA1`** |
| `SRA2` | `450mm 900mm` | **`SRA2`** |
| `A2U` | `450mm 625mm` | — |
| `RA2` | `430mm 610mm` | **`RA2`** |
| `A3U` | `330mm 450mm` | — |
| (`SRA3`) | `320mm 450mm` | **`SRA3`** |
| (`RA3`) | `305mm 430mm` | **`RA3`** |
| `A4U` | `240mm 330mm` | — |
| (`SRA4`) | `225mm 320mm` | **`SRA4`** |
| (`RA4`) | `215mm 305mm` | **`RA4`** |
| — | `160mm 225mm` | `SRA5` |
| — | `152mm 215mm` | `RA5` |
| — | `112mm 160mm` | `SRA6` |
| — | `107mm 152mm` | `RA6` |
| — | `80mm 112mm` | `SRA7` |
| — | `76mm 107mm` | `RA7` |
| — | `56mm 80mm` | `SRA8` |
| — | `53mm 76mm` | `RA8` |

All American sizes, which have not already been specified in [CSS][css-page], fail at least one of the three stated criteria, because their edges measure a simple number of half inches and are even often known only *by* those numbers (which are generally assumed to be exact). 

The only popular *metric* sizes that are known by integer numbers are photographic prints (i.e. traditionally 9&times;13, 10&times;15, 11&times;17, 13&times;18, 20&times;30), which, apparently, are rather approximate in fact, because they are really based on rounded inch-based specifications. 

[ISO 216]:  <https://www.iso.org/obp/ui#iso:std:iso:216:ed-2:v1:en> "ISO 216:2007 Writing paper and certain classes of printed matter — Trimmed sizes — A and B series, and indication of machine direction"
[ISO 217]:  <https://www.iso.org/obp/ui#iso:std:iso:217:ed-4:v1:en> "ISO 217:2013 Paper — Untrimmed sizes — Designation and tolerances for primary and supplementary ranges, and indication of machine direction"
[ISO 269]:  <https://www.iso.org/standard/4178.html> "ISO 269:1985 Correspondence envelopes — Designation and sizes"
[DIN 476]:  <https://www.beuth.de/de/norm/din-476-2/102801943> "DIN 476-2:2008-02 Trimmed sizes of paper — C series"
[JIS P 0138]:  <https://infostore.saiglobal.com/en-us/Standards/JIS-P-0138-1998-627954_SAIG_JSA_JSA_1441348/> "JIS P 0202:1998 Writing paper and certain classes of printed matter — Trimmed sizes — A and B series"
[ISO/IEC 7810]:  <https://www.iso.org/obp/ui#iso:std:iso-iec:7810:ed-4:v1:en> "ISO/IEC 7810:2019 Identification cards — Physical characteristics"
[SIS 014711]: <https://www.sis.se/en/produkter/standardization/information-sciences-publishing/documents-in-administration-commerce-and-industry/ss14711/> "SS 14711 Paper — Series of sizes A-G"
[OST 5115]: <>
[SAC GB/T 148]: <> "SAC GB/T 148-97 Writing paper and certain classes printed matter — Trimmed sizes — A and B series"
[ISO 6716]: <> "ISO 6716:1983 Graphic technology — Text-books and periodicals — Sizes of untrimmed sheets and trimmed pages"

[PWG]: <http://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn20-20130328-5101.1.pdf> "IEEE-ISTO PWG 5101.1-2013 PWG Media Standardized Names 2.0"
[PWG 5101.1]: <http://ftp.pwg.org/pub/pwg/ipp/registrations/>
[IANA]: <https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xhtml>

[css-page]: <https://drafts.csswg.org/css-page/#page-size-prop> "CSS Paged Media ED"
[Prince]: <http://www.princexml.com/doc/page-size-keywords/>
[Antenna House]: <https://www.antennahouse.com/product/ahf66/ahf-ext.html#axf.size>
[PDF Reactor]: <https://www.pdfreactor.com/product/doc_html/index.html#SupportedPageSizes>
[Vivliostyle]: <https://github.com/vivliostyle/vivliostyle/blob/master/packages/core/src/vivliostyle/css-page.ts#L52> "@uetchy"
[WeasyPrint]: <http://github.com/Kozea/WeasyPrint/blob/master/weasyprint/css/computed_values.py#L82>
[Speedata]: <http://github.com/speedata/publisher/> "Speedata Publisher apparently uses Prince XML under the hood"

[F4]: https://en.wikipedia.org/wiki/F4_%28paper%29
[PA4]: https://en.wikipedia.org/wiki/Paper_size#PA_series


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4722 using your GitHub account

Received on Friday, 31 January 2020 13:03:55 UTC