# Κατακόρυφη σελίδα εφημερίδας σε ζώνες

> Δύο φύλλα κινεζικής εφημερίδας του 1912, κατακόρυφα: το κείμενο σε δύο ζώνες με γραμμή ανάμεσα, τα τηλεγραφήματα σε τρεις, ο κύριος τίτλος πιάνει και τις δύο.

- Έκδοση HTML: https://postext.dev/el/cookbook/vertical-newspaper-tiers
- Συνταγή Αρ. 084 · Σελίδα και πλέγμα · Επίπεδο 2 (Μεσαίο) · Έξοδοι: Canvas, PDF
- Είδη: Εφημερίδες και ενημερωτικά δελτία
- Απαιτεί postext ≥ 1.46.2, postext-pdf ≥ 1.46.2 · δοκιμασμένη με 1.65.0, postext-pdf 1.65.0 στις 2026-10-31
- Σελίδες: [一](https://postext.dev/cookbook/vertical-newspaper-tiers/en/p01.webp?v=dfa69cb7), [二](https://postext.dev/cookbook/vertical-newspaper-tiers/en/p02.webp?v=dfa69cb7)
- PDF: https://postext.dev/cookbook/vertical-newspaper-tiers/en/vertical-newspaper-tiers.pdf?v=dfa69cb7
- Άνοιγμα στο Sandbox: https://postext.dev/el/sandbox#recipe=vertical-newspaper-tiers&lang=en (.postext: https://postext.dev/cookbook/vertical-newspaper-tiers/en/vertical-newspaper-tiers.postext)
- Τελευταία ενημέρωση: 2026-10-10
- Άλλες γλώσσες: [en](https://postext.dev/en/cookbook/vertical-newspaper-tiers.md), [es](https://postext.dev/es/cookbook/vertical-newspaper-tiers.md), [ca](https://postext.dev/ca/cookbook/vertical-newspaper-tiers.md), [de](https://postext.dev/de/cookbook/vertical-newspaper-tiers.md), [fr](https://postext.dev/fr/cookbook/vertical-newspaper-tiers.md), [it](https://postext.dev/it/cookbook/vertical-newspaper-tiers.md), [pt](https://postext.dev/pt/cookbook/vertical-newspaper-tiers.md), [zh](https://postext.dev/zh/cookbook/vertical-newspaper-tiers.md), [ja](https://postext.dev/ja/cookbook/vertical-newspaper-tiers.md), [ar](https://postext.dev/ar/cookbook/vertical-newspaper-tiers.md)

## Με λίγα λόγια

Δύο σελίδες μιας κινεζικής εφημερίδας του 1912, τυπωμένες σε στήλες που διαβάζονται από πάνω προς τα κάτω. Η σελίδα χωρίζεται σε ζώνες τη μία κάτω από την άλλη, με μια γραμμή ανάμεσά τους, όπως έκαναν οι παλιές εφημερίδες.

## Τι θα στοιχειοθετήσετε

Δύο φύλλα μιας κινεζικής εφημερίδας όπως ήταν το 1912, το πρώτο έτος της Δημοκρατίας, όταν οι εφημερίδες στοιχειοθετούνταν ακόμη από πάνω προς τα κάτω. Το κείμενο προέρχεται από τη *Shenbao* της Σαγκάης: ο Σουν Γιατ-σεν σε ένα συμπόσιο στη Δυτική Λίμνη, όπου ο Τσεν Τσιμέι σηκώθηκε να αντιταχθεί σε μια ομιλία και σηκώθηκε ξανά για να ζητήσει συγγνώμη· το μνημόσυνο για τους στρατιώτες του Τζετζιάνγκ που σκοτώθηκαν στην κατάληψη της Ναντζίνγκ· το μνημείο της νίκης που ύψωσε το Χανγκτζόου για τον στρατό που επέστρεφε. Τέσσερα τηλεγραφήματα από το πρώτο φύλλο της επίσημης εφημερίδας της Προσωρινής Κυβέρνησης γεμίζουν ένα πλαίσιο. Το κυρίως κείμενο τρέχει σε δύο ζώνες (欄) των 25 χαρακτήρων με μια γραμμή ανάμεσά τους, τα τηλεγραφήματα σε τρεις. Μια κιννάβαρι μετόπη και ο πρωτοσέλιδος τίτλος, στοιχειοθετημένος σε όλο το ύψος της σελίδας, ανοίγουν το πρώτο φύλλο. Η συνταγή [Πρωτοσέλιδο εφημερίδας](https://postext.dev/el/cookbook/newspaper-front-page.md) φτιάχνει την ίδια σελίδα οριζόντια.

**Αυτή η συνταγή απαντά:**

- Πώς στοιχειοθετώ μια κινεζική σελίδα εφημερίδας κατακόρυφα, σε ζώνες με γραμμές ανάμεσά τους;
- Πώς στοιχειοθετώ έναν τίτλο κεφαλαίου σε όλο το πλάτος της σελίδας ενώ το σώμα ρέει σε δύο στήλες από κάτω;
- Μπορεί το Postext να στοιχειοθετήσει τρεις ή περισσότερες στήλες κειμένου, ή να τυλίξει το κείμενο γύρω από μια εικόνα;
- Πώς ορίζω την επιφάνεια στοιχειοθεσίας σε χαρακτήρες, τόσους ανά γραμμή και τόσες γραμμές ανά σελίδα;

## Η σύντομη απάντηση

```js
// script.js, γραμμές 40–58
// On a vertical page two columns are two tiers (欄), stacked and filled from the upper right:
// the gutter is the gap between them, the column rule a rule across the page.
const layout = {
  layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
  gutterWidth: pt(2 * BODY),
  columnRule: { enabled: true, color: col('ink'), lineWidth: pt(0.75) },
};
// The grid counts characters down a tier and lines across the page: 25 × 29.
const cjk = { grid: { enabled: true, charsPerLine: CHARS, linesPerPage: 29 } };
// The body stays in two tiers. The telegrams take three inside a page-span box floated to
// the foot of the flow, the left of the sheet, with the fences
//   :::callout{type="wires" span="page" placement="bottom" title="電報"} and :::columns{count=3}
const wires = { id: 'wires', backgroundEnabled: false,
  stripe: { enabled: true, side: 'top', width: pt(1.5), color: col('ink') }, // on its right
  padding: { top: pt(6), right: pt(0), bottom: pt(0), left: pt(0) },
  columnGap: pt((HEIGHT - 3 * 18 * 9) / 2), // three tiers of 18 characters of 9 pt
  titleStyle: { fontFamily: HEI, fontSize: pt(12), fontWeight: 700, color: col('accent') },
  body: { fontFamily: SONG, fontSize: pt(9), lineHeight: pt(13.5), textAlign: 'justify',
    firstLineIndent: pt(0), boldFontWeight: 700 } };
```

## Υλικά

**Διδάσκει**

- [Μία ή δύο στήλες](https://postext.dev/el/docs/configuration-page-layout.md#τύποι-διάταξης): Μία μόνο στήλη ή δύο ίσες στήλες με το διάκενό τους· οι δύο στήλες είναι η προεπιλογή, οπότε ένα μυθιστόρημα πρέπει να ζητήσει μία.
- [Γραμμή στηλών](https://postext.dev/el/docs/configuration-page-layout.md#γραμμή-ανάμεσα-στις-στήλες): Μια λεπτή κατακόρυφη γραμμή στο διάκενο, που διακόπτεται γύρω από ταινίες πλήρους πλάτους, στον καμβά και στο PDF.
- [Σχεδιασμένες εναρκτήριες σελίδες](https://postext.dev/el/docs/configuration-headings.md#πλάτος-και-προηγμένη-σχεδίαση): Μια επικεφαλίδα σχεδιασμένη ως ελεύθερη σύνθεση από κείμενο, γραμμές, πλαίσια και εικόνες, που δεσμεύει το ύψος που χρειάζεται πάνω από το κυρίως κείμενο.

**Χρησιμοποιεί επίσης**

- [Κατακόρυφο κείμενο](https://postext.dev/el/docs/configuration-page-layout.md#κατακόρυφη-γραφή)
- [Βιβλία με δέσιμο στα δεξιά](https://postext.dev/el/docs/configuration-page-layout.md#βιβλιοδεσία)
- [Πλέγμα χαρακτήρων](https://postext.dev/el/docs/configuration-east-asian.md#πλέγμα-χαρακτήρων)
- [Στήλες σε πλαίσιο ή στο κείμενο](https://postext.dev/el/docs/document-format-directives.md#columns)
- [Πλαίσια σε όλο το πλάτος της σελίδας](https://postext.dev/el/docs/configuration-callouts.md#ο-περιέκτης-callout)
- [Κινητά πλαίσια](https://postext.dev/el/docs/configuration-callouts.md#ο-περιέκτης-callout)
- [Στιλ επικεφαλίδων](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων)
- [Ιδιότητες επικεφαλίδων](https://postext.dev/el/docs/document-format.md#χαρακτηριστικά-επικεφαλίδων)
- [Κείμενο, γραμμές και πλαίσια στις σχεδιάσεις σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα)
- [Τρέχουσες κεφαλίδες και αριθμοί σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα)
- [Κεφαλίδες ανά ρόλο σελίδας](https://postext.dev/el/docs/configuration-headers-footers.md#στοιχεία-κειμένου)
- [Στιλ παραγράφων](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων)
- [Κινεζικές, ιαπωνικές και κορεατικές γραμματοσειρές](https://postext.dev/el/docs/configuration-pdf-output.md#γραμματοσειρές-για-κινεζικά-ιαπωνικά-και-κορεατικά)
- [Πλάτη κινεζικής στίξης](https://postext.dev/el/docs/configuration-east-asian.md#πλάτη-στίξης)
- [Σημασιολογική χρωματική παλέτα](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων)
- [Εξαγωγή PDF](https://postext.dev/el/docs/configuration-pdf-output.md#παραγωγή-pdf)
- [Γραμματοσειρές ενσωματωμένες στο PDF](https://postext.dev/el/docs/configuration-pdf-output.md#γιατί-πάροχος-γραμματοσειρών)
- [Πλαίσια σημειώσεων](https://postext.dev/el/docs/configuration-callouts.md#στιλ-πλαισίων)
- [Αλλαγή γραμμής στα κινεζικά](https://postext.dev/el/docs/configuration-east-asian.md#τυπογραφία-ανατολικής-ασίας)
- [Ταινία κεφαλαίου πλήρους πλάτους](https://postext.dev/el/docs/configuration-headings.md#πλάτος-και-προηγμένη-σχεδίαση)
- [Χρώμα χαρτιού](https://postext.dev/el/docs/configuration-page-layout.md#σελίδα)
- [Προκαταρκτικά με λατινική αρίθμηση](https://postext.dev/el/docs/document-format-directives.md#numbering)

**Η διαμόρφωση με μια ματιά**

- [`bodyText`](https://postext.dev/el/docs/configuration-text.md#κυρίως-κείμενο), [`calloutStyles`](https://postext.dev/el/docs/configuration-callouts.md#στιλ-πλαισίων), [`cjk`](https://postext.dev/el/docs/configuration-east-asian.md#τυπογραφία-ανατολικής-ασίας), [`colorPalette`](https://postext.dev/el/docs/configuration-fonts-colors-viewers.md#παλέτα-χρωμάτων), [`footer`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`header`](https://postext.dev/el/docs/configuration-headers-footers.md#κεφαλίδες-και-υποσέλιδα), [`headingStyles`](https://postext.dev/el/docs/configuration-styles.md#στιλ-επικεφαλίδων), [`headings`](https://postext.dev/el/docs/configuration-headings.md#επικεφαλίδες), [`layout`](https://postext.dev/el/docs/configuration-page-layout.md#διάταξη), [`locale`](https://postext.dev/el/docs/configuration-language.md#συλλαβισμός), [`page`](https://postext.dev/el/docs/configuration-page-layout.md#σελίδα), [`paragraphStyles`](https://postext.dev/el/docs/configuration-styles.md#στιλ-παραγράφων)

**API**

- [`buildDocument`](https://postext.dev/el/docs/configuration-programmatic-usage.md#κατασκευή-εγγράφου), [`decompressWoff2`](https://postext.dev/el/docs/configuration-pdf-output.md#πάροχος-γραμματοσειρών-για-τον-browser-fontsource--woff2), `loadVerticalAlternates`, [`renderPageToCanvas`](https://postext.dev/el/docs/configuration-programmatic-usage.md#απόδοση-σελίδας-σε-bitmap), [`renderToPdf`](https://postext.dev/el/docs/configuration-pdf-output.md#παραγωγή-pdf), [`withLoadedFonts`](https://postext.dev/el/docs/configuration-programmatic-usage.md#φόρτωση-γραμματοσειρών-πριν-από-τη-σελιδοποίηση)

**Γραμματοσειρές**

- Noto Serif TC (OFL-1.1), Noto Sans TC (OFL-1.1), LXGW WenKai TC (OFL-1.1)

## Προετοιμασία

### 1 · Μετατρέψτε δύο στήλες σε δύο ζώνες

Ο κώδικας είναι η [σύντομη απάντηση](https://postext.dev/el/cookbook/vertical-newspaper-tiers.md#η-σύντομη-απάντηση) παραπάνω. Με `writingMode: 'vertical-rl'` η σελίδα είναι μια οριζόντια σελίδα στραμμένη κατά ένα τέταρτο της στροφής, οπότε το `layoutType: 'double'` στοιβάζει δύο ζώνες, με την πάνω να διαβάζεται πρώτη, και η γραμμή ανάμεσα στις στήλες γίνεται μια γραμμή κατά πλάτος της σελίδας ανάμεσά τους ([κατακόρυφη γραφή](https://postext.dev/el/docs/configuration-page-layout.md#κατακόρυφη-γραφή)). Το πλέγμα χαρακτήρων δίνει σε κάθε ζώνη 25 χαρακτήρες του 五號 (10,5 pt), το μακρύ άκρο μιας στήλης εφημερίδας, και στη σελίδα 29 γραμμές· στρογγυλεύει το διάκενο στηλών σε δύο em και μεγαλώνει τα περιθώρια ώστε οι ζώνες να κάθονται στη μέση τους ([πλέγμα χαρακτήρων](https://postext.dev/el/docs/configuration-east-asian.md#πλέγμα-χαρακτήρων)).

Το κυρίως κείμενο μένει σε δύο ζώνες και μόνο τα τηλεγραφήματα χρειάζονται τρεις, οπότε μπαίνουν σε ένα πλαίσιο: το `span="page"` το κάνει τόσο ψηλό όσο η επιφάνεια στοιχειοθεσίας, το `placement="bottom"` το μετακινεί στο τέλος της ροής, που σε κατακόρυφη σελίδα είναι η αριστερή άκρη, και το `:::columns{count=3}` το κόβει σε ζώνες. Το `columnGap` είναι ό,τι αφήνουν τρεις ζώνες των 18 χαρακτήρων των 9 pt από τα 546 pt της επιφάνειας στοιχειοθεσίας, ώστε κάθε ζώνη να χωρά ακέραιους χαρακτήρες.

![Page 二: 湯蟄仙之紀功碑.](https://postext.dev/cookbook/vertical-newspaper-tiers/en/p02.webp?v=dfa69cb7)

*Σελίδα 2: τα τηλεγραφήματα σε τρεις ζώνες· η λωρίδα στο πάνω άκρο του πλαισίου σχεδιάζεται ως γραμμή στη δεξιά του πλευρά.*

### 2 · Βάλτε τη μετόπη και τον πρωτοσέλιδο τίτλο σε μία σχεδίαση

```js
// script.js, γραμμές 72–99
// A page-span heading always opens a page (gotcha: page-span-heading-new-page), so the lead
// story's H1 carries the masthead in its own design, above its headline.
const MAST = 6.5 * LEAD; // the masthead's block, across the page
const block = (id, inset, style) => ({ kind: 'box', id, style,
  placement: at(inset, inset, { size: { width: pt(HEIGHT - 2 * inset),
    height: pt(MAST - 2 * inset) } }) });
const BAND = 13 * LEAD; // the whole design: masthead, headline, deck
const front = { enabled: true, minHeight: pt(BAND), slot: { elements: [
    block('field', 0, { backgroundColor: col('accent') }), // the name reversed out of it
    block('frame', 3.5, { borderColor: col('paper'), borderWidth: pt(0.75) }),
    text('name', '{title}', KAI, 700, 64, 'paper', { lineHeight: 1, letterSpacing: pt(6),
      placement: at(22, 13) }),
    text('kicker', '{subtitle}', HEI, 700, 12, 'paper', { placement: at(24, 82) }),
    text('sources', '錄{author}', HEI, 400, 8.5, 'paper', { placement: at(150, 84) }),
    text('issue', '{attr.issue}', HEI, 700, 12, 'paper', { placement: at(330, 33) }), // the year
    text('edition', '{attr.edition}', HEI, 400, 8.5, 'paper', { placement: at(330, 84) }),
    text('sheet', '第{pageNumber}張', HEI, 700, 10, 'accent', { placement: at(HEIGHT - 58, 80),
      box: { backgroundColor: col('paper'), padding: { top: pt(3), right: pt(3),
        bottom: pt(3), left: pt(3) } } }),
    // The headline down both tiers, centred; the dateline heads the deck's line.
    text('head', '{titleText}', SONG, 900, 44, 'ink', { align: 'center', lineHeight: 1.1,
      placement: at(0, MAST + 12, fill) }),
    text('deck', '{attr.deck}', KAI, 400, 15, 'ink', { align: 'center',
      placement: below('head', 6, fill) }),
    text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('head', 10) }),
    { kind: 'rule', id: 'foot', direction: 'horizontal', thickness: pt(0.75),
      color: col('ink'), placement: at(0, BAND - 3, fill) },
] } };
```

Ο τίτλος της κύριας είδησης έπρεπε να διασχίζει και τις δύο ζώνες κάτω από τη μετόπη. Μια επικεφαλίδα με `span: 'page'` σελιδοποιείται ως εναρκτήρια στην κορυφή μιας σελίδας, οπότε μια δεύτερη μετά τη μετόπη θα άρχιζε δική της σελίδα. Η H1 της σελίδας είναι λοιπόν η κύρια είδηση, και το στιλ της επικεφαλίδας της σχεδιάζει τη μετόπη πάνω από τον τίτλο: ένα κιννάβαρι μπλοκ βάθους 6,5 γραμμών με το όνομα της εφημερίδας σε αρνητικό και, από κάτω, τη γραμμή του φύλλου: το έτος της Δημοκρατίας και του κύκλου, και το 今日出紙兩張, «δύο φύλλα σήμερα»· έπειτα τον τίτλο σε Noto Serif TC 900 στα 44 pt. Μέσα στη ροή το πλάτος της σχεδίασης είναι το ύψος της επιφάνειας στοιχειοθεσίας στο φύλλο, οπότε το `size: { width: 'fill' }` με `align: 'center'` κεντράρει τον τίτλο και στις δύο ζώνες. Η σχεδίαση έχει βάθος 13 γραμμών, ακέραιο αριθμό γραμμών του πλέγματος, έτσι το κείμενο που ακολουθεί αρχίζει σε γραμμή του πλέγματος.

![Opening page 一: 西湖公宴孫中山紀事.](https://postext.dev/cookbook/vertical-newspaper-tiers/en/p01.webp?v=dfa69cb7)

*Σελίδα 1: το μπλοκ της μετόπης, ο τίτλος κεντραρισμένος κατά μήκος και των δύο ζωνών, ο υπότιτλος δίπλα του και η γραμμή τόπου και ημερομηνίας στην αρχή της γραμμής της.*

### 3 · Ανοίξτε κάθε είδηση με μια σχεδίαση επικεφαλίδας

```js
// script.js, γραμμές 103–110
const storyHead = { enabled: true, minHeight: pt(4 * LEAD), slot: { elements: [ // 4 lines
  { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.5), color: col('rule'),
    placement: at(0, 0, fill) },
  text('head', '{titleText}', SONG, 900, 20, 'ink', { placement: at(0, 6) }),
  text('deck', '{attr.deck}', KAI, 400, 11, 'ink', { // two characters down the tier
    placement: below('head', 4, { offset: { x: pt(2 * BODY), y: pt(4) } }) }),
  text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('deck', 4) }),
] } };
```

Μια σχεδίαση επικεφαλίδας μέσα στη στήλη ζει μέσα στη ζώνη της. Η γραμμή της είναι `direction: 'horizontal'` στη ροή, οπότε στο φύλλο τρέχει κατά μήκος της ζώνης, μια λεπτή γραμμή ανάμεσα σε δύο ειδήσεις. Ο τίτλος αρχίζει στην κορυφή της ζώνης, ο υπότιτλος δύο χαρακτήρες χαμηλότερα, και η γραμμή τόπου και ημερομηνίας δίνει τον τόπο, την εφημερίδα και την ημέρα που δημοσιεύτηκε το ρεπορτάζ. Το `minHeight` κρατά κάθε κεφαλή σε βάθος τεσσάρων γραμμών, ώστε το κείμενο κάτω από κάθε κεφαλή να αρχίζει στο πλέγμα.

### 4 · Βάλτε κεφαλίδα στο δεύτερο φύλλο και υπογραφή στο κάτω μέρος

```js
// script.js, γραμμές 114–123
// The header's frame is the margin above the tiers; the footer's, the margin below them.
const above = (y, extra = {}) => ({ anchor: { to: 'container', edge: 'top-left' },
  offset: { x: pt(0), y: mm(HEAD - y) }, ...extra });
const header = { elements: [
  text('title', '{title}', KAI, 700, 14, 'ink', { align: 'right', placement: above(13, fill) }),
  text('sheet', '第{pageNumber}張', HEI, 700, 9, 'ink', { placement: above(10.8) }),
  { kind: 'rule', id: 'rule', thickness: pt(1.5), color: col('ink'), placement: above(6, fill) },
].map((element) => ({ ...element, pages: 'body' })) }; // page 1 has the masthead instead
const footer = { elements: [text('colophon', '{attr.colophon}', HEI, 400, 7, 'muted', {
  pages: 'body', placement: at(0, 17, fill) })] }; // 6 mm under the tiers
```

Οι τρέχουσες κεφαλίδες μένουν οριζόντιες σε κατακόρυφη σελίδα, όπως περιγράφει το clreq. Το πλαίσιο της κεφαλίδας είναι το περιθώριο πάνω από τις ζώνες· το πλέγμα μεγαλώνει αυτό το περιθώριο, και το `HEAD` επαναλαμβάνει το άθροισμα του πλέγματος ώστε η γραμμή να κάθεται 6 mm πάνω από τον πρώτο χαρακτήρα. Το `pages: 'body'` αφήνει τη σελίδα 1 στη μετόπη. Ο κολοφώνας είναι ιδιότητα της H1, έτσι η αγγλική και η ισπανική έκδοση τυπώνουν η καθεμία τη δική της γραμμή κάτω από τις ίδιες κινεζικές σελίδες.

### 5 · Φορτώστε κάθε φωνή με το κείμενο που στοιχειοθετεί

```js
// script.js, γραμμές 221–230
const pick = (pattern) => (markdown.match(pattern) ?? []).join('');
const attrs = (...keys) => pick(new RegExp(`[{ ](?:${keys.join('|')})="[^"]*"`, 'g'));
const voices = [ // family, weights, the text it sets, and whether it runs down a column
  [SONG, ['400'], markdown, true], // the text
  [SONG, ['700', '900'], pick(/^#+ [^{\n]*|\*\*[^*]+\*\*/gm), false], // heads, labels
  [HEI, ['400', '700'], pick(/^(?:subtitle|author): .*$|style="source"\}[^:]*/gm) // masthead,
    + attrs('dateline', 'issue', 'edition', 'title', 'colophon') + '錄第一二張', true], // datelines
  [KAI, ['400'], attrs('deck') + pick(/style="inscription"\}[^:]*/g), true], // decks, the stele
  [KAI, ['700'], pick(/^title: .*$/m), false], // the paper's name
];
```

Το Fontsource σερβίρει κάθε βάρος αυτών των γραμματοσειρών σε περίπου εκατό αρχεία, και το `loadCjkFonts` κατεβάζει όσα αγγίζει ένα κείμενο. Η Noto Serif TC 400 παίρνει ολόκληρο το δείγμα· τα 700 και 900 της παίρνουν μόνο τους τίτλους και τις ετικέτες των τηλεγραφημάτων, η Noto Sans TC τις γραμμές της μετόπης, τις γραμμές τόπου και ημερομηνίας και τον κολοφώνα, και η LXGW WenKai TC τους υποτίτλους, την επιγραφή και το όνομα της εφημερίδας. Μια γραμματοσειρά που παίρνει πολύ λίγο κείμενο αποτυγχάνει στη λήψη (C12) και κατονομάζει τους χαρακτήρες που δανείστηκε από άλλη γραμματοσειρά.

## Η πλήρης συνταγή

Ένα αρχείο, συντεθειμένο από τον φάκελο της συνταγής με το δείγμα κειμένου και το κοινό κιτ του Συνταγολογίου ενσωματωμένα· φτιάχνει τη δική του σελίδα. Για να το εκτελέσετε, βάλτε το σε ένα `<script type="module">` σε μια κενή σελίδα, ή επικολλήστε το στο πάνελ JS ενός νέου CodePen (ως module). Εισάγει το postext από το esm.sh, οπότε δεν χρειάζεται εγκατάσταση ούτε build.

- Φάκελος πηγής: https://github.com/drnachio/postext/tree/main/cookbook/vertical-newspaper-tiers

### script.js

```js
// ═══ Postext Cookbook · Nº 084 · A vertical newspaper page in tiers ═══════════════
// https://postext.dev/en/cookbook/vertical-newspaper-tiers
// Code: MIT · Text: Shenbao, 1912 (PD); gazette, stele report: zh.wikisource (CC BY-SA 4.0)
// Fonts: Noto Serif TC, Noto Sans TC, LXGW WenKai TC (SIL OFL 1.1) · Needs postext ≥ 1.46.2
import {
  buildDocument, withLoadedFonts, renderPageToCanvas, loadVerticalAlternates,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';

const LANG = 'en'; // @lang: the language of the colophon; the news is Chinese in both editions
const RECIPE = 'vertical-newspaper-tiers';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: newsprint, ink and the vermilion of the masthead
const palette = {
  ink: '#1c1a17', // text, the rules between tiers
  accent: '#b0281c', // the one accent: the masthead block, the telegrams' flag
  rule: '#8f887c', // the hairline before each story
  muted: '#5e574e', // datelines, sources, the colophon
  paper: '#f7f2e6', // newsprint, and the masthead's type reversed out of the vermilion
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
  ...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
  { id: 'main-color', name: 'ink (defaults)', value: { hex: palette.ink, model: 'hex' } },
];
// #endregion

const [SONG, HEI, KAI] = ['Noto Serif TC', 'Noto Sans TC', 'LXGW WenKai TC']; // 宋, 黑, 楷
const BODY = 10.5; // pt: 五號, the body size of the papers of 1912
const LEAD = 15.75; // pt: the line pitch across the page, 1.5 em
const CHARS = 25; // characters down a tier: a newspaper column, 17 to 25
const HEIGHT = 2 * CHARS * BODY + 2 * BODY; // pt: two tiers and a gutter of two ems
const TRIM = { w: 184, h: 260 }; // mm, 16開
const MARGIN = { top: 30, bottom: 22, side: 11 }; // mm, minimums: the grid centres the tiers
// The grid grows the margins evenly, so the tiers start HEAD mm below the top edge.
const HEAD = MARGIN.top + (TRIM.h - MARGIN.top - MARGIN.bottom - (HEIGHT * 25.4) / 72) / 2;

// #region answer: two tiers down the page with a rule between them, three inside a box
// On a vertical page two columns are two tiers (欄), stacked and filled from the upper right:
// the gutter is the gap between them, the column rule a rule across the page.
const layout = {
  layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
  gutterWidth: pt(2 * BODY),
  columnRule: { enabled: true, color: col('ink'), lineWidth: pt(0.75) },
};
// The grid counts characters down a tier and lines across the page: 25 × 29.
const cjk = { grid: { enabled: true, charsPerLine: CHARS, linesPerPage: 29 } };
// The body stays in two tiers. The telegrams take three inside a page-span box floated to
// the foot of the flow, the left of the sheet, with the fences
//   :::callout{type="wires" span="page" placement="bottom" title="電報"} and :::columns{count=3}
const wires = { id: 'wires', backgroundEnabled: false,
  stripe: { enabled: true, side: 'top', width: pt(1.5), color: col('ink') }, // on its right
  padding: { top: pt(6), right: pt(0), bottom: pt(0), left: pt(0) },
  columnGap: pt((HEIGHT - 3 * 18 * 9) / 2), // three tiers of 18 characters of 9 pt
  titleStyle: { fontFamily: HEI, fontSize: pt(12), fontWeight: 700, color: col('accent') },
  body: { fontFamily: SONG, fontSize: pt(9), lineHeight: pt(13.5), textAlign: 'justify',
    firstLineIndent: pt(0), boldFontWeight: 700 } };
// #endregion

// In the flow of a vertical page x runs down the sheet and y leftward from its right edge.
const at = (x, y, extra = {}) => ({ anchor: { to: 'container', edge: 'top-left' },
  offset: { x: pt(x), y: pt(y) }, ...extra });
const text = (id, content, family, weight, size, colour, extra = {}) => ({ kind: 'text', id,
  content, fontFamily: family, fontWeight: weight, fontSize: pt(size), lineHeight: 1.2,
  color: col(colour), align: 'left', overflow: 'wrap', ...extra });
const below = (id, y, extra = {}) => ({ anchor: { to: `#${id}`, edge: 'below' },
  offset: { y: pt(y) }, ...extra }); // y more points across the page, leftward
const fill = { size: { width: 'fill' } };

// #region front: the masthead and the lead headline, one design down the right of page 1
// A page-span heading always opens a page (gotcha: page-span-heading-new-page), so the lead
// story's H1 carries the masthead in its own design, above its headline.
const MAST = 6.5 * LEAD; // the masthead's block, across the page
const block = (id, inset, style) => ({ kind: 'box', id, style,
  placement: at(inset, inset, { size: { width: pt(HEIGHT - 2 * inset),
    height: pt(MAST - 2 * inset) } }) });
const BAND = 13 * LEAD; // the whole design: masthead, headline, deck
const front = { enabled: true, minHeight: pt(BAND), slot: { elements: [
    block('field', 0, { backgroundColor: col('accent') }), // the name reversed out of it
    block('frame', 3.5, { borderColor: col('paper'), borderWidth: pt(0.75) }),
    text('name', '{title}', KAI, 700, 64, 'paper', { lineHeight: 1, letterSpacing: pt(6),
      placement: at(22, 13) }),
    text('kicker', '{subtitle}', HEI, 700, 12, 'paper', { placement: at(24, 82) }),
    text('sources', '錄{author}', HEI, 400, 8.5, 'paper', { placement: at(150, 84) }),
    text('issue', '{attr.issue}', HEI, 700, 12, 'paper', { placement: at(330, 33) }), // the year
    text('edition', '{attr.edition}', HEI, 400, 8.5, 'paper', { placement: at(330, 84) }),
    text('sheet', '第{pageNumber}張', HEI, 700, 10, 'accent', { placement: at(HEIGHT - 58, 80),
      box: { backgroundColor: col('paper'), padding: { top: pt(3), right: pt(3),
        bottom: pt(3), left: pt(3) } } }),
    // The headline down both tiers, centred; the dateline heads the deck's line.
    text('head', '{titleText}', SONG, 900, 44, 'ink', { align: 'center', lineHeight: 1.1,
      placement: at(0, MAST + 12, fill) }),
    text('deck', '{attr.deck}', KAI, 400, 15, 'ink', { align: 'center',
      placement: below('head', 6, fill) }),
    text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('head', 10) }),
    { kind: 'rule', id: 'foot', direction: 'horizontal', thickness: pt(0.75),
      color: col('ink'), placement: at(0, BAND - 3, fill) },
] } };
// #endregion

// #region heads: each story opens with a hairline, the headline, a deck and a dateline
const storyHead = { enabled: true, minHeight: pt(4 * LEAD), slot: { elements: [ // 4 lines
  { kind: 'rule', id: 'rule', direction: 'horizontal', thickness: pt(0.5), color: col('rule'),
    placement: at(0, 0, fill) },
  text('head', '{titleText}', SONG, 900, 20, 'ink', { placement: at(0, 6) }),
  text('deck', '{attr.deck}', KAI, 400, 11, 'ink', { // two characters down the tier
    placement: below('head', 4, { offset: { x: pt(2 * BODY), y: pt(4) } }) }),
  text('dateline', '{attr.dateline}', HEI, 700, 9, 'muted', { placement: below('deck', 4) }),
] } };
// #endregion

// #region pagehead: the second sheet's head and the colophon, horizontal on the sheet
// The header's frame is the margin above the tiers; the footer's, the margin below them.
const above = (y, extra = {}) => ({ anchor: { to: 'container', edge: 'top-left' },
  offset: { x: pt(0), y: mm(HEAD - y) }, ...extra });
const header = { elements: [
  text('title', '{title}', KAI, 700, 14, 'ink', { align: 'right', placement: above(13, fill) }),
  text('sheet', '第{pageNumber}張', HEI, 700, 9, 'ink', { placement: above(10.8) }),
  { kind: 'rule', id: 'rule', thickness: pt(1.5), color: col('ink'), placement: above(6, fill) },
].map((element) => ({ ...element, pages: 'body' })) }; // page 1 has the masthead instead
const footer = { elements: [text('colophon', '{attr.colophon}', HEI, 400, 7, 'muted', {
  pages: 'body', placement: at(0, 17, fill) })] }; // 6 mm under the tiers
// #endregion

const config = () => ({
  locale: 'zh-Hant', // Taiwan conventions: centred punctuation (gotcha: cjk-locale-tag)
  colorPalette,
  page: {
    sizePreset: 'custom', width: mm(TRIM.w), height: mm(TRIM.h), dpi: 150,
    backgroundColor: col('paper'),
    margins: { top: mm(MARGIN.top), bottom: mm(MARGIN.bottom), left: mm(MARGIN.side),
      right: mm(MARGIN.side), mirror: true },
    pageNumbering: { format: 'trad-chinese-informal' }, // 第一張, 第二張
  },
  layout,
  cjk,
  bodyText: {
    fontFamily: SONG, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
    boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('ink'),
    textAlign: 'justify', firstLineIndent: em(2), indentAfterHeading: true,
  },
  headings: {
    fontFamily: SONG, fontWeight: 900, color: col('ink'),
    levels: [
      // parity 'any': a level-1 heading opens the next page, whichever side it falls on.
      { level: 1, span: 'page', breakBefore: { enabled: true, parity: 'any' },
        marginBottom: pt(0) },
      { level: 2, fontSize: pt(20), lineHeight: pt(2 * LEAD), marginTop: pt(LEAD / 2),
        marginBottom: pt(0), advancedDesign: storyHead },
    ],
  },
  headingStyles: [{ id: 'front', advancedDesign: front }],
  calloutStyles: [wires],
  paragraphStyles: [
    { id: 'source', fontFamily: HEI, fontSize: pt(8.5), color: col('muted'), textAlign: 'right',
      firstLineIndent: pt(0) }, // the telegrams' source, at the foot of its line
    { id: 'inscription', fontFamily: KAI, indent: em(2), firstLineIndent: em(2) }, // 低二格
  ],
  header,
  footer,
});

// ─── 2 · Content ────────────────────────────────────────────────────────────
const markdown = String.raw`---
title: "民元舊聞"
subtitle: "民國元年報章選錄"
author: "上海《申報》及《臨時政府公報》"
---

# 西湖公宴孫中山紀事 {style="front" deck="孫君演說錢幣革命　陳其美誤會起立質問" dateline="杭州　《申報》十二月十一日" issue="中華民國元年　歲次壬子" edition="今日出紙兩張" colophon="Set in Noto Serif TC, Noto Sans TC and LXGW WenKai TC (SIL OFL) · Text: zh.wikisource, rev. 9458640 and 2490036 (CC BY-SA 4.0)"}

孫中山先生於本月八號蒞杭情形，已紀昨報。茲悉九號上午九時，孫先生命駕出城，致祭光復諸先烈，順道游覽三潭印月諸名勝。十句半鐘蒞公園，當由朱都督陪侍招待，並介紹軍政各界領袖行相見禮。十一句四十分，入席公宴。

入席後，經孫君首先演說，其宗旨注重整理財政，發達工商，而以錢幣革命為入手辦法。演畢，復經隨員前滬軍都督陳其美引申其辭；次朱都督表明贊同孫君政策；次第六師長呂公望演說，合國民全力扶持中央，群策群力，以固疆隅。詎陳其美誤會為一人布政，必令全國人民服從，起立質問。經講武堂長童伯吹諸君說明呂師長立言大意，以資駁復，陳即起立道歉而罷。

讌畢，由都督陪侍孫君合攝一影，並參觀藏書樓各機關。至五句鐘，排隊入城，赴國民公所團體宴會。並定十號晨赴江干察看路線，即在之江大學午餐；午後乘江墅車赴拱埠參觀商場；十一號出遊天竺、靈隱諸名勝；十三號專車回滬云。

## 浙都督追祭攻寧陣亡將士 {deck="斷橋沿堤盡懸五色旗　湖中船隻均懸白旗" dateline="杭州　《申報》十二月四日"}

浙江朱都督於十二月二號在西湖新公園追祭攻寧陣亡將士。天甫黎明，各軍隊已紛紛排隊前往錢塘門外，沿途均懸五色旗；至斷橋，則五色大旗及十八星白旛沿堤皆是。傾城人士絡繹於途，湖中船隻均懸追祭白旗一面。

十一時祭台招魂開祭，由楊雪門君贊禮啟幕。朱都督就主祭位，呂師長、屈民政司、張財政司、沈教育司、朱提法司（請孫君代表）以及旅長、團長、杭縣汪知事、省會警察局張雨蕉等均就陪祭位。旋由呂師長公望出席演說：「今日追祭諸先烈的榮耀，都是從去年戰死中來的。現在俄庫密約，正是我們國兒立功的時候。」勸勵現在將士一番，隨宣布浙軍攻寧戰況情形，並報告陣亡將士姓名、籍貫、人數。即上香、獻酌、獻帛，由魏在田諸君次第讀都督暨呂師長等祭文，全場行禮，奏樂退位。

午後各學校、各團體、各軍隊致祭。禮畢，由都督領首，全場追祭人員均至孤山忠墳行禮，將所佩之花均散於墳上而回。西賓亦有數人在場觀禮。馨香俎豆，諸烈為不朽矣。

:::callout{type="wires" span="page" placement="bottom" title="電報"}
:::columns{count=3}
**南京去電**　津浦路站電局速送廣東北伐軍司令姚雨平、協統林震鑒：聞我軍昨夜得勝，追敵數十里，足見士卒用命。深堪嘉許。總統孫文。勘。

**南京去電**　四川資州軍政府署鑒：劉光漢被拘，希派人護送來寧，勿苛待。總統府。宥。

**南京去電**　上海陳都督其美鑒：趙珊林為吾黨舊同志，去歲新軍反正之役，頗為出力。今聞因事繫獄，請念前功，即予省釋。孫文。宥。

**武昌來電**　南京孫大總統、上海伍外交總長鑒：停戰期限將滿，和議尚未告成。聞滿清已簡放張勳為南京總督，揆此情形，顯係滿清不願意共和，徒廢時期，以疲我軍士。此停戰期滿，彼方若不決定退位，共同組織共和民國，再議展期，決不承認。曲實在彼，即前次所提待遇從優之條件，一律取銷。鄂中全體軍士均已預備作戰，誓不願與滿清共和，再不可聽其狡展，致遏我軍義勇之氣。請大總統、外交總長將種種情形通告各國是幸。元洪。廿六號。
:::

:::paragraphs{style="source"}
錄《臨時政府公報》第一號，一月二十九日
:::
:::

## 湯蟄仙之紀功碑 {deck="仿法國凱旋門例　西湖公園之麓建凱旋碑" dateline="杭州　《申報》七月十七日"}

浙軍光復南京，功勳卓著，天保城一役戰績尤多。此次凱旋回杭，浙中父老除開會歡迎外，復仿法國凱旋門例，在西湖公園之麓建築凱旋碑，以誌不朽。適前都督湯蟄仙氏歸自海外，撰作序銘，刊於碑陰。豐功大文，誠足並垂百世也。原文錄下：

:::paragraphs{style="inscription"}
當武漢首義，江寧未附，浙與蘇、鎮、滬諸軍約從會攻，始收其地，建臨時政府。其後乃有媾和之議。方是時，緣江諸鎮新復，漢陽復陷，金陵扼塞東南，危所繫，一不舉則亂猶未撥。故共和之業，基於武昌，成於江寧，卒乃定於統一。數月之間，易號改朔，伊古以來未有也。而論者以謂江寧之役，蓋浙軍勞尤多云。

時壽潛承乏於浙，以今之第五軍軍長朱君瑞率師與諸軍會。朱君果立功，名顯榮於時。中華民國元年五月，悉所部八千人還。今浙江都督蔣君尊簋命參謀副長夏君超度地為壇，大集諸將，飲至獻捷，勞軍行賞。有司、羣僚、耆老、諸生、商賈、百工，各以其屬齎牛酒致頌，來觀禮者至萬人，歌呼駿奔，闐衢溢巷，號曰歡迎凱旋，斯不亦盛哉！因伐石刊辭，將耀來葉，而以文請。壽潛既退在閭里，謹述邦人之意，為銘曰：

昭洪捷兮奠南疆，一禹域兮除穢荒。矯多士兮莫不揚，思禦侮兮在四方。樹隆碣兮示弗忘。
:::
`; // content.<lang>.md: the same Chinese text in both

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
// Every face the pages paint; the Chinese ones by files (gotcha: cjk-fonts-slices).
const FONTS = { 'Noto Serif TC': ['400', '700', '900'], 'Noto Sans TC': ['400', '700'],
  'LXGW WenKai TC': ['400', '700'] };
// #region voices: each face loads the files of the text it sets
const pick = (pattern) => (markdown.match(pattern) ?? []).join('');
const attrs = (...keys) => pick(new RegExp(`[{ ](?:${keys.join('|')})="[^"]*"`, 'g'));
const voices = [ // family, weights, the text it sets, and whether it runs down a column
  [SONG, ['400'], markdown, true], // the text
  [SONG, ['700', '900'], pick(/^#+ [^{\n]*|\*\*[^*]+\*\*/gm), false], // heads, labels
  [HEI, ['400', '700'], pick(/^(?:subtitle|author): .*$|style="source"\}[^:]*/gm) // masthead,
    + attrs('dateline', 'issue', 'edition', 'title', 'colophon') + '錄第一二張', true], // datelines
  [KAI, ['400'], attrs('deck') + pick(/style="inscription"\}[^:]*/g), true], // decks, the stele
  [KAI, ['700'], pick(/^title: .*$/m), false], // the paper's name
];
// #endregion

// ─── 4 · Build & show ───────────────────────────────────────────────────────
await loadFonts(FONTS, markdown);
for (const [family, weights, text, vertical] of voices) {
  await loadCjkFonts({ [family]: weights }, text, { vertical });
}
const doc = await withLoadedFonts(() => buildDocument({ markdown }, config()),
  { ...kitFonts(FONTS), text: markdown });
showBook(doc, { title: t({ en: 'A vertical newspaper page in tiers',
  es: 'Una página de periódico vertical, en pisos' }) });
offerPdf(() => renderToPdf(doc, { fontProvider: cjkPdfProvider }), `${RECIPE}.pdf`);

// ─── Kit ── helpers shared by every Cookbook recipe · postext.dev/cookbook ─────

// ─── Kit · core v1 ── the same in every recipe · postext.dev/cookbook
function mm(value) { return { value, unit: 'mm' }; }
function pt(value) { return { value, unit: 'pt' }; }
function em(value) { return { value, unit: 'em' }; }
/** The sample language's string: t({ en: 'Figure', es: 'Figura' }). */
function t(strings) { return strings[LANG] ?? Object.values(strings)[0]; }
/** A file in this recipe's assets folder, served from the Postext repo by jsDelivr. */
function asset(file) { return `https://cdn.jsdelivr.net/gh/drnachio/postext@main/cookbook/${RECIPE}/assets/${file}`; }

// ─── Kit · fonts v3 ── the same in every recipe · postext.dev/cookbook
// Postext loads the faces a config asks for before layout and asks the kit
// for Fontsource's files, the ones the PDF embeds too.

/** buildDocumentWithFonts' options: the resolver, and FONTS' faces loaded
 *  with the config's. FONTS = { 'Family Name': ['400', '400i', '700'] }. */
function kitFonts(FONTS = {}) {
  const faces = Object.entries(FONTS).flatMap(([family, specs]) => specs.map((spec) =>
    ({ family, weight: parseInt(spec, 10), style: spec.endsWith('i') ? 'italic' : 'normal' })));
  return { resolve: fontsourceResolver, faces };
}

/** A face's files with their ranges: latin, then latin-ext and greek when
 *  `text` needs them (kitSubsetsFor). Null for a face Fontsource lacks. */
async function fontsourceResolver(family, weight, style, { text = '' } = {}) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  if (meta && !(await fontsourceWeights(family, style)).includes(weight)) return null;
  kitStatus('Loading fonts…');
  const at = await fontsourceAt(id);
  return ['latin', ...kitSubsetsFor(text, meta)].map((subset) => ({
    source: `${at}files/${id}-${subset}-${weight}-${style}.woff2`,
    unicodeRange: kitRanges()[subset],
  }));
}

/** Each file's unicode-range (a function: the kit runs after the pen's code). */
function kitRanges() {
  return {
    latin: 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,'
      + 'U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
    'latin-ext': 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,'
      + 'U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
    greek: 'U+0370-03FF',
  };
}

/** For the cjk, arabic and comics blocks: loads `faces` (as FONTS) for the
 *  sample `text`; `optional` skips a face Fontsource lacks. Files are added in
 *  the order asked, the last winning a shared character. Resolves to the count. */
async function loadFonts(faces, text = '', { optional = false } = {}) {
  kitStatus('Loading fonts…');
  const ranges = kitRanges();
  const jobs = [];
  for (const [family, specs] of Object.entries(faces)) {
    const id = fontsourceId(family);
    const todo = [...new Set(specs)].map((spec) => [parseInt(spec, 10), spec.endsWith('i') ? 'italic' : 'normal'])
      .filter(([weight, style]) => !hasFace(family, weight, style)); // before any await
    const at = fontsourceAt(id);
    const meta = optional || /[^\0-ÿ]/u.test(text) ? await fontsourceMeta(family) : null;
    const subsets = ['latin', ...kitSubsetsFor(text, meta)];
    for (const [weight, style] of todo) {
      if (optional && !(meta && (await fontsourceWeights(family, style)).includes(weight))) continue;
      for (const subset of subsets) {
        const url = `${await at}files/${id}-${subset}-${weight}-${style}.woff2`;
        const face = new FontFace(family, `url(${url}) format('woff2')`,
          { weight: String(weight), style, unicodeRange: ranges[subset] });
        jobs.push(face.load().catch(() => {
          if (subset === 'latin' && !optional) throw new Error(`Fontsource has no ${family} ${weight} ${style}`);
        }));
      }
    }
  }
  const ready = await Promise.all(jobs).catch((error) => { kitFail(error); throw error; });
  return ready.filter((face) => face && document.fonts.add(face)).length;
}

/** A loaded FontFace covers this face (fonts.check() says yes to any family). */
function hasFace(family, weight, style) {
  for (const face of document.fonts) {
    if (face.status !== 'loaded' || face.style !== style) continue;
    if (face.family.replace(/^["']|["']$/g, '') !== family) continue;
    const [low, high = low] = face.weight.split(' ').map(Number);
    if (weight >= low && weight <= high) return true;
  }
  return false;
}

/** The files beyond latin `text` needs that `meta`'s family ships. */
function kitSubsetsFor(text, meta) {
  return [[/[Ā-˿ᴀ-ᶿḀ-ỿ†ℓⱠ-Ɀ꜠-ꟿ]/u, 'latin-ext'], [/[Ͱ-Ͽ]/u, 'greek']]
    .filter(([re, x]) => re.test(text) && meta?.subsets?.includes(x)).map(([, x]) => x);
}

/** Fontsource's id for a family: 'Source Serif 4' → 'source-serif-4'. */
function fontsourceId(family) { return family.toLowerCase().replace(/\s+/g, '-'); }

/** A package's folder at the one version @5 names now (#766). */
function fontsourceAt(id, u = `https://cdn.jsdelivr.net/npm/@fontsource/${id}@`) {
  return (fontsourceAt.c ??= {})[id] ??= fetch(u + '5/package.json').then((r) => r.json())
    .then((p) => p.version || 5, () => 5).then((v) => `${u}${v}/`);
}

/** The family's Fontsource metadata (weights, styles, subsets), or null. */
function fontsourceMeta(family, id = fontsourceId(family)) {
  return (fontsourceMeta.c ??= {})[id] ??= fetch(`https://api.fontsource.org/v1/fonts/${id}`)
    .then((res) => (res.ok ? res.json() : null), () => null);
}

/** The weights the package ships in `style`: the API pairs none (no Libre
 *  Caslon 700 italic file), so italics are read from latin-italic.css. */
function fontsourceWeights(family, style, id = fontsourceId(family)) {
  return (fontsourceWeights.c ??= {})[id + style] ??= fontsourceMeta(family).then(async (m) => {
    if (!m?.styles.includes(style)) return m ? [] : [400, 700];
    const css = style === 'italic' ? await fetch(`${await fontsourceAt(id)}latin-italic.css`).then((r) => (r.ok ? r.text() : ''), () => '') : '';
    const w = [...css.matchAll(/weight: (\d+)/g)].map((x) => +x[1]);
    return w.length ? w : m.weights;
  });
}

// ─── Kit · viewer v2 ── the same in every recipe · postext.dev/cookbook
/** The pages as spreads on a dark desk, page 1 alone, then verso | recto,
 *  each painted when it scrolls near. Other options go to renderPageToCanvas. */
function showPages(docs, { title, width = 460, ...render } = {}) {
  const root = viewer(title);
  const pages = [docs].flat().flatMap((doc) =>
    doc.pages.map((page) => ({ doc, page, n: (doc.pageIndexOffset ?? 0) + page.index })));
  const spreads = [];
  let verso = null;
  for (const p of pages) {
    if (p.n % 2 === 1) { if (verso) spreads.push([verso, null]); verso = p; }
    else { spreads.push([verso, p]); verso = null; }
  }
  if (verso) spreads.push([verso, null]);
  const density = Math.min(window.devicePixelRatio || 1, 2);
  showPages.painter?.disconnect();
  const painter = new IntersectionObserver((entries) => {
    for (const { isIntersecting, target } of entries) {
      if (!isIntersecting) continue;
      painter.unobserve(target);
      const { doc, page } = target.postext;
      renderPageToCanvas(page, doc, target, { ...render, scale: (width * density) / page.width });
    }
  }, { rootMargin: '800px' });
  showPages.painter = painter;
  root.replaceChildren(...spreads.map((pair) => {
    const spread = document.createElement('div');
    spread.className = 'pt-spread';
    for (const p of pair) {
      const figure = document.createElement('figure');
      if (p) {
        const label = p.page.pageLabel || String(p.n + 1);
        const canvas = document.createElement('canvas');
        canvas.postext = p;
        canvas.style.aspectRatio = `${p.page.width} / ${p.page.height}`;
        canvas.setAttribute('role', 'img');
        canvas.setAttribute('aria-label', `Page ${label}`);
        const folio = document.createElement('figcaption');
        folio.textContent = label;
        figure.append(canvas, folio);
        painter.observe(canvas);
      } else figure.className = 'pt-blank';
      spread.append(figure);
    }
    return spread;
  }));
  kitStatus(`${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`);
  document.documentElement.dataset.postext = 'ready';
  return pages.length;
}

/** The desk, the bar and the error reporting, created once. */
function viewer(title) {
  if (!document.getElementById('pt-kit')) {
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit">
      :root { color-scheme: dark; }
      body { margin: 0; background: #0e1014; color: #b9bcc4; font: 13px/1.45 system-ui, sans-serif; }
      #pt-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
        gap: 6px 16px; padding: 10px 16px; background: rgb(14 16 20 / .92); backdrop-filter: blur(6px);
        border-bottom: 1px solid #23262d; }
      #pt-bar strong { color: #f4f1ea; font-weight: 600; }
      #pt-actions { display: flex; gap: 12px; margin-left: auto; }
      #pt-actions a, #pt-actions button { color: #d8a21a; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
      #pages { display: grid; justify-items: center; gap: 48px; padding: 32px 16px 72px; }
      .pt-spread { display: flex; }
      .pt-spread figure { margin: 0; width: min(460px, 44vw); }
      .pt-spread canvas { display: block; width: 100%; background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figure:first-child canvas { box-shadow: inset -14px 0 14px -14px rgb(0 0 0 / .18), 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figcaption { margin-top: 10px; text-align: center; font: 600 10px/1 system-ui, sans-serif;
        letter-spacing: .18em; text-transform: uppercase; color: #6c7079; }
      .pt-blank { visibility: hidden; }
      @media (max-width: 760px) {
        .pt-spread { flex-direction: column; gap: 32px; }
        .pt-spread figure { width: min(460px, 92vw); }
        .pt-blank { display: none; }
      }
    </style>`);
    document.body.insertAdjacentHTML('afterbegin',
      '<header id="pt-bar"><strong id="pt-title"></strong><span id="pt-status" role="status"></span><span id="pt-actions"></span></header>');
    document.getElementById('pt-title').textContent = document.title || 'Postext';
    addEventListener('error', (event) => kitFail(event.error ?? event.message));
    addEventListener('unhandledrejection', (event) => kitFail(event.reason));
  }
  if (title) document.getElementById('pt-title').textContent = title;
  return document.getElementById('pages')
    ?? document.body.appendChild(Object.assign(document.createElement('main'), { id: 'pages' }));
}

function kitStatus(text) {
  viewer();
  document.getElementById('pt-status').textContent = text;
}

function kitFail(error) {
  document.documentElement.dataset.postext = 'error';
  kitStatus(`Error: ${error?.message ?? error}`);
}

// ─── Kit · pdf v3 ── the same in every recipe that exports a PDF
/** The Fontsource files the screen used, as TrueType, with their range and
 *  place: the nearest weight the family ships in that style, upright with no italic;
 *  latin, then what its letters need (kitSubsetsFor). */
async function fontsourceProvider(family, weight, style, request) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  const s = style === 'italic' && meta && !meta.styles.includes('italic') ? 'normal' : style;
  const shipped = meta ? await fontsourceWeights(family, s) : [];
  const weights = shipped.length ? shipped : [400, 700];
  const w = weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a));
  const text = String.fromCodePoint(...(request?.codePoints ?? []));
  const files = await Promise.all(['latin', ...kitSubsetsFor(text, meta)].map(async (subset, order) => {
    const res = await fetch(`${await fontsourceAt(id)}files/${id}-${subset}-${w}-${s}.woff2`);
    if (!res.ok) throw new Error(`Fontsource has no ${family} ${w} ${s} ${subset}`);
    return Object.assign(await decompressWoff2(new Uint8Array(await res.arrayBuffer())),
      { unicodeRange: kitRanges()[subset], order });
  }));
  return files.length === 1 ? files[0] : files;
}

/** A "Build the PDF" button; then "Open the PDF" (a new tab: CodePen's frame
 *  shows no PDFs) and a download link. */
function offerPdf(makePdf, filename) {
  viewer();
  const button = Object.assign(document.createElement('button'), { type: 'button', textContent: 'Build the PDF' });
  button.dataset.postextPdf = filename;
  button.addEventListener('click', async () => {
    button.disabled = true;
    button.textContent = 'Building the PDF…';
    try {
      const bytes = await makePdf();
      const url = URL.createObjectURL(new Blob([bytes], { type: 'application/pdf' }));
      const size = `${Math.max(1, Math.round(bytes.length / 1024))} KB`;
      button.replaceWith(
        Object.assign(document.createElement('a'), { href: url, target: '_blank', rel: 'noopener', textContent: 'Open the PDF ↗' }),
        Object.assign(document.createElement('a'), { href: url, download: filename, textContent: `Download ${filename} · ${size}` }));
    } catch (error) {
      button.disabled = false;
      button.textContent = 'Build the PDF';
      kitFail(error);
    }
  });
  document.getElementById('pt-actions').append(button);
}

// ─── Kit · cjk v2 ── Chinese, Japanese and Korean books · postext.dev/cookbook
// Fontsource ships a CJK family as about a hundred files per weight, each
// declared in its stylesheet with the unicode-range it covers. The screen
// loads the files the sample touches; the PDF gets the same files for the
// characters its pages set in each face, and embeds each as a subset.
// A book bound on the right (vertical text) is shown with its spreads
// mirrored: page 1 alone on the left of the spine, then [3 | 2].

/** The files of a Fontsource face, read from its stylesheet: { url, range,
 *  ranges }, the last declared first (the order the browser tries them in). */
function cjkSlices(family, weight, style) {
  cjkSlices.cache ??= new Map();
  const id = fontsourceId(family);
  const css = `${id}/${weight}${style === 'italic' ? '-italic' : ''}.css`;
  if (!cjkSlices.cache.has(css)) {
    let at;
    cjkSlices.cache.set(css, fontsourceAt(id).then((a) => fetch(at = a + css.slice(id.length + 1)))
      .then((res) => {
        if (!res.ok) throw new Error(`Fontsource has no ${family} ${weight} ${style} (${res.status})`);
        return res.text();
      })
      .then((text) => [...text.matchAll(/@font-face\s*{([^}]*)}/g)].map(([, rule]) => {
        const range = /unicode-range:\s*([^;]+);/.exec(rule)?.[1].trim() ?? 'U+0-10FFFF';
        const ranges = range.split(',').map((part) => {
          const [lo, hi = lo] = part.trim().slice(2).split('-');
          return [parseInt(lo, 16), parseInt(hi, 16)];
        });
        return { url: new URL(/url\(([^)]+?\.woff2)\)/.exec(rule)[1], at).href, range, ranges };
      }).reverse()));
  }
  return cjkSlices.cache.get(css);
}

/** The file of `slices` the screen sets code point `cp` in, if any: the
 *  last one loadCjkFonts adds whose range holds it. A numbered file that
 *  repeats a letter of latin is added after latin, and wins it. */
function cjkSliceFor(slices, cp) {
  const holds = (slice) => slice.ranges.some(([lo, hi]) => cp >= lo && cp <= hi);
  return slices.reduce((last, slice) => (holds(slice) ? slice : last), undefined);
}

/** Whether Fontsource serves `family` as a Chinese, Japanese or Korean
 *  family (its subsets name the script). Fails when the API does not
 *  answer: a CJK face taken for a Latin one would paint in a system face. */
async function isCjkFamily(family) {
  const meta = await fontsourceMeta(family);
  if (!meta) throw new Error(`api.fontsource.org did not describe ${family}: reload to try again`);
  return !!meta.subsets?.some((subset) => /^(chinese|japanese|korean)/.test(subset));
}

/** faces = { 'Noto Serif TC': ['400', '700'] }, as for loadFonts: the
 *  whole FONTS object may be passed, its other families are left to
 *  loadFonts. Adds one FontFace per file of each CJK face with its
 *  unicodeRange, then loads the files `text` touches. `text` is what the
 *  faces set: the sample for the text face; a book in several voices calls
 *  it once per voice (loadCjkFonts({ 'LXGW WenKai TC': ['400'] }, quotes)),
 *  so the heading and quotation faces fetch and check only their own
 *  characters. Fails when a character of `text` is in no file of a face.
 *  List every weight the pages use: a weight left to the engine's later round
 *  gets the latin file only. With { vertical: true } it also loads each
 *  family's vertical forms (brackets, quotes, pause marks) for the canvas,
 *  which needs loadVerticalAlternates imported from postext. Resolves to
 *  the number of files loaded. */
async function loadCjkFonts(faces, text, { vertical = false } = {}) {
  kitStatus('Loading fonts…');
  let loaded = 0;
  try {
    if (vertical && typeof loadVerticalAlternates !== 'function') {
      throw new Error('loadCjkFonts(…, { vertical: true }) needs loadVerticalAlternates imported from postext');
    }
    for (const [family, specs] of Object.entries(faces)) {
      if (!(await isCjkFamily(family))) continue;
      const twin = [];
      for (const spec of new Set(specs)) {
        const weight = parseInt(spec, 10);
        const style = spec.endsWith('i') ? 'italic' : 'normal';
        const slices = await cjkSlices(family, weight, style);
        const missing = [...new Set(text)].filter((ch) => /\S/.test(ch) && !cjkSliceFor(slices, ch.codePointAt(0)));
        if (missing.length) {
          throw new Error(`${family} ${spec} has no file for ${missing.slice(0, 12).join(' ')}: `
            + `give each face the text it sets (loadCjkFonts({ '${family}': ['${spec}'] }, text))`);
        }
        for (const slice of slices) {
          document.fonts.add(new FontFace(family, `url(${slice.url}) format('woff2')`,
            { weight: String(weight), style, unicodeRange: slice.range }));
          twin.push({ source: slice.url, weight: String(weight), style, unicodeRange: slice.range });
        }
        const font = `${style === 'italic' ? 'italic ' : ''}${weight} 16px "${family}"`;
        loaded += (await document.fonts.load(font, text)).length;
        if (!document.fonts.check(font, text)) throw new Error(`${family} ${spec} did not load for the sample`);
      }
      // The same files under a twin name with the `vert` feature on: the
      // canvas paints the punctuation of vertical lines with it.
      if (vertical && twin.length) await loadVerticalAlternates(family, twin);
    }
  } catch (error) {
    kitFail(error);
    throw error;
  }
  return loaded;
}

/** The PDF font provider for recipes with CJK faces: a family whose
 *  Fontsource subsets are Chinese, Japanese or Korean gets the files the
 *  screen set its pages' characters in (`request.codePoints`), each marked
 *  with its unicode-range and its place in the order loadCjkFonts added
 *  them: postext-pdf sets a character two files hold in the one added
 *  last, as the browser does. Any other family gets the latin file
 *  fontsourceProvider fetches (the "pdf" block) and, when the face sets
 *  letters only latin-ext has, that file too. */
async function cjkPdfProvider(family, weight, style, request) {
  if (!(await isCjkFamily(family))) return cjkLatinPdfFiles(family, weight, style, request);
  const meta = await fontsourceMeta(family);
  const weights = meta.weights?.length ? meta.weights : [400, 700];
  const w = weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a));
  const s = style === 'italic' && !meta.styles.includes('italic') ? 'normal' : style;
  const slices = await cjkSlices(family, w, s);
  const picked = new Set();
  for (const cp of request?.codePoints ?? []) {
    const slice = cjkSliceFor(slices, cp);
    if (slice) picked.add(slice);
  }
  if (!picked.size) picked.add(slices[0]);
  return Promise.all(slices.map(async (slice, order) => {
    if (!picked.has(slice)) return null;
    const res = await fetch(slice.url);
    if (!res.ok) throw new Error(`Fontsource file ${slice.url} (${res.status})`);
    const bytes = await decompressWoff2(new Uint8Array(await res.arrayBuffer()));
    return Object.assign(bytes, { unicodeRange: slice.range, order });
  })).then((files) => files.filter(Boolean));
}

/** A Latin family set next to the CJK faces: its latin file, then its
 *  latin-ext file when the face sets letters only latin-ext has (ō ū in
 *  Hepburn rōmaji, ǎ in pinyin), the file loadFonts adds on screen for
 *  them, each marked with its unicode-range and its place in that order:
 *  the PDF sets a character in the file the browser took it from. A face
 *  Fontsource ships without latin-ext, or whose file does not come, gets
 *  latin alone, and the PDF names the letters it lacks. */
async function cjkLatinPdfFiles(family, weight, style, request) {
  const meta = await fontsourceMeta(family);
  const beyond = [...(request?.codePoints ?? [])].some(cjkLatinExtOnly);
  if (!beyond || !meta?.subsets?.includes('latin-ext')) return fontsourceProvider(family, weight, style);
  const weights = meta.weights?.length ? meta.weights : [400, 700];
  const w = weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a));
  const s = style === 'italic' && !meta.styles.includes('italic') ? 'normal' : style;
  const id = fontsourceId(family);
  const url = `${await fontsourceAt(id)}files/${id}-latin-ext-${w}-${s}.woff2`;
  const [latin, ext] = await Promise.all([fontsourceProvider(family, weight, style), fetch(url)
    .then(async (res) => (res.ok ? decompressWoff2(new Uint8Array(await res.arrayBuffer())) : null), () => null)]);
  const ranges = kitRanges();
  return ext ? [Object.assign(latin, { unicodeRange: ranges.latin, order: 0 }),
    Object.assign(ext, { unicodeRange: ranges['latin-ext'], order: 1 })] : latin;
}

/** Whether code point `cp` is in Fontsource's latin-ext file and not in
 *  its latin file: Latin Extended-A and -B, IPA, the spacing modifiers and
 *  Latin Extended Additional (loadFonts's test for latin-ext), less the
 *  few latin holds too (ı Œ œ ʻ ʼ ˆ ˚ ˜). */
function cjkLatinExtOnly(cp) {
  if (!((cp >= 0x100 && cp <= 0x2ff) || (cp >= 0x1e00 && cp <= 0x1eff))) return false;
  return ![0x131, 0x152, 0x153, 0x2bb, 0x2bc, 0x2c6, 0x2da, 0x2dc].includes(cp);
}

/** showPages for a book bound on either edge. A right-bound book (the
 *  document says so: doc.binding is 'right' for page.binding 'right' and
 *  for vertical text) lies on the desk as it opens: page 1 alone on the
 *  left of the spine, then [3 | 2], the spine shade on each page's inner
 *  edge. `binding` ('left' | 'right') overrides the document's. */
function showBook(docs, { binding, ...options } = {}) {
  const count = showPages(docs, options);
  const right = (binding ?? [docs].flat()[0]?.binding) === 'right';
  if (!document.getElementById('pt-kit-cjk')) {
    // The pages keep direction ltr: a canvas draws text in the direction its
    // element inherits, and under rtl each run would end where the engine
    // starts it, its brackets mirrored.
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit-cjk">
      .pt-spread[dir="rtl"] canvas { direction: ltr; }
      .pt-spread[dir="rtl"] figure:first-child canvas { box-shadow: inset 14px 0 14px -14px rgb(0 0 0 / .18),
        0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
    </style>`);
  }
  // Each pair stays [verso, recto] in the page; right to left, the verso
  // sits on the right. Phones stack the pages in reading order either way.
  for (const spread of document.querySelectorAll('#pages > .pt-spread')) spread.dir = right ? 'rtl' : 'ltr';
  document.getElementById('pages').dataset.binding = right ? 'right' : 'left';
  return count;
}

// ─── /Kit ───────────────────────────────────────────────────────────────────────
```

## Παραλλαγές

### Δώστε στα τηλεγραφήματα τέσσερις ζώνες

Τέσσερις ζώνες των 14 χαρακτήρων χωρούν στο ίδιο ύψος, και το πλαίσιο στενεύει στις γραμμές που χρειάζονται.

```diff
-  columnGap: pt((HEIGHT - 3 * 18 * 9) / 2), // three tiers of 18 characters of 9 pt
+  columnGap: pt((HEIGHT - 4 * 14 * 9) / 3), // four tiers of 14 characters of 9 pt
```

Στο Markdown, `:::columns{count=4}`.

### Στοιχειοθετήστε τις ειδήσεις σε μία ζώνη

Μία ζώνη των 52 χαρακτήρων καλύπτει το ύψος της επιφάνειας στοιχειοθεσίας, 193 mm κατά μήκος του φύλλου για κάθε γραμμή. Κάθε κεφαλή είδησης παίρνει τώρα τέσσερις γραμμές ολόκληρης της σελίδας, και τα δύο φύλλα γίνονται τρία.

```diff
-  layoutType: 'double', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
+  layoutType: 'single', writingMode: 'vertical-rl', // binding 'auto' becomes 'right'
```

Με `charsPerLine: 2 * CHARS + 2` στο πλέγμα.

## Συνήθη λάθη

- **Μια επικεφαλίδα πλάτους σελίδας ανοίγει πάντα νέα σελίδα.** Μια επικεφαλίδα της οποίας το επίπεδο ή το στιλ ορίζει span: 'page' σελιδοποιείται ως εναρκτήρια σχεδίαση στην κορυφή μιας σελίδας, είτε έχει breakBefore είτε όχι. Αν μπει μετά από άλλο κείμενο, ή μετά από άλλη εναρκτήρια σχεδίαση στην ίδια σελίδα, μετακινείται στην επόμενη σελίδα και αφήνει κενό το υπόλοιπο της τρέχουσας. Ένας τίτλος-πανό σε όλες τις στήλες (ή και στις δύο ζώνες μιας κατακόρυφης σελίδας) κάτω από την κεφαλίδα της εφημερίδας μπαίνει στη δική του σχεδίαση της εναρκτήριας σελίδας, δίπλα στην κεφαλίδα της εφημερίδας, ή σε πλαίσιο :::callout{span="page"} ως επικεφαλίδα χωρίς span, όπως στοιχειοθετεί τα πανό της η newspaper-front-page.
- **Οι κινεζικές γραμματοσειρές φορτώνονται σε τμήματα, μέσω του μπλοκ cjk.** Το Fontsource σερβίρει μια κινεζική, ιαπωνική ή κορεατική οικογένεια σε περίπου εκατό αρχεία ανά βάρος, καθένα από τα οποία καλύπτει ένα εύρος χαρακτήρων. Το loadFonts κατεβάζει μόνο το latin αρχείο, οπότε στην οθόνη οι χαρακτήρες Han έρχονται από γραμματοσειρά του συστήματος και μετριούνται λάθος, και το fontsourceProvider δίνει στο PDF αυτό το latin αρχείο, που τους τυπώνει ως κενά κουτιά. Δηλώστε το μπλοκ cjk του κιτ, καλέστε το loadCjkFonts(FONTS, markdown) μετά το loadFonts (μία φορά ανά φωνή, με το κείμενο που στοιχειοθετεί, όταν το βιβλίο χρησιμοποιεί πολλές γραμματοσειρές CJK) και δώστε στο renderToPdf fontProvider: cjkPdfProvider: και τα δύο παίρνουν τα αρχεία που περιέχουν τους χαρακτήρες του κειμένου.
- **Δώστε στο έγγραφο ετικέτα zh-Hans ή zh-Hant, όχι LANG.** Οι εκδόσεις μιας συνταγής είναι en και es, αλλά ένα κινεζικό δείγμα είναι κινεζικό και στις δύο: το `locale: LANG` θα του έδινε ετικέτα αγγλικών ή ισπανικών, θα συλλάβιζε τις λατινικές του λέξεις, θα ονόμαζε τις εικόνες του Figure ή Figura και θα έδινε στο PDF λάθος γλώσσα. Από το postext 1.30 η ετικέτα είναι επίσης η γλώσσα με την οποία διαμορφώνεται το κείμενο (μετριέται, ζωγραφίζεται και ενσωματώνεται), οπότε με αγγλική ή ισπανική ετικέτα μια κινεζική γραμματοσειρά στοιχειοθετεί τα ψηφία της και τη στίξη που μοιράζεται με το λατινικό κείμενο σε άλλες μορφές, και οι γραμμές αλλάζουν αλλού. Γράψτε μόνοι σας την ετικέτα: 'zh-Hans' (συμβάσεις ηπειρωτικής Κίνας: αλλαγή γραμμής GB, στίξη Kaiming) ή 'zh-Hant' (Ταϊβάν: στίξη πλήρους πλάτους στο κέντρο)· 'zh-HK' για το Χονγκ Κονγκ. Ένα σκέτο 'zh' διαβάζεται ως απλοποιημένα, ηπειρωτικής Κίνας. Ένα ιαπωνικό δείγμα παίρνει 'ja' (gotcha ja-locale-tag).
- **Ένα βιβλίο δεμένο δεξιά δείχνει τα δισέλιδά του με το showBook.** Σε βιβλίο δεμένο δεξιά (αραβικό, εβραϊκό ή περσικό κείμενο, κατακόρυφα κινεζικά ή page.binding 'right') η σελίδα 1 είναι ακόμη η δεξιά (μονή), αλλά βρίσκεται αριστερά της ράχης, και τα ζεύγη διαβάζονται [3 | 2]. Το showPages σελιδοποιεί κάθε βιβλίο ως δεμένο αριστερά· το showBook από το μπλοκ book (το μπλοκ cjk έχει την ίδια συνάρτηση) διαβάζει το doc.binding και αντικατοπτρίζει τα ζεύγη. Το capture.hero εξακολουθεί να ονομάζει ένα δισέλιδο με σειρά ανάγνωσης, [αριστερή, δεξιά]: [2, 3].

- Η Noto Serif TC του Fontsource δηλώνει το 爲, τη μορφή που τύπωνε η *Shenbao*, στο εύρος ενός από τα αρχεία της, αλλά εκείνο το αρχείο δεν έχει γλύφο γι' αυτό: ο καμβάς το σχεδίασε σε μια γραμματοσειρά του συστήματος και το PDF δεν είχε καμία (C25). Τα ρεπορτάζ στοιχειοθετούν το 為.
- Οι μεταγραφές του Wikisource έχουν λάθη που η σελίδα διορθώνει: 己紀 αντί για 已紀 και, δύο φορές, 倍侍 αντί για 陪侍 στο ρεπορτάζ του συμποσίου· στο ρεπορτάζ του μνημόσυνου 勸勵一番現在將土, με 土 αντί για 士 και το αντικείμενο μετά το 一番, που στοιχειοθετείται εδώ ως 勸勵現在將士一番, «ενθάρρυνε τους παρόντες αξιωματικούς και στρατιώτες». Η σελίδα στοιχειοθετεί επίσης την κανονική μορφή τεσσάρων παραλλαγών: 寧 αντί για 寗, 總 αντί για 縂 (τρεις φορές) και 決 αντί για 决 (δύο φορές) στα τηλεγραφήματα, 刊 αντί για 刋 στην επιγραφή.
- Η LXGW WenKai TC, όπως τη σερβίρει το Fontsource, σχεδιάζει το 為 ως 爲, οπότε η επιγραφή, σε Kai, δείχνει την παλαιότερη μορφή που λείπει από το κείμενο σε Song.
- Οι τρεις ζώνες του πλαισίου είναι τρίτα της επιφάνειας στοιχειοθεσίας και δεν ευθυγραμμίζονται με τις δύο ζώνες του κυρίως κειμένου. Μια εφημερίδα στοιχειοθετεί ένα τέτοιο τμήμα στο δικό του πλέγμα· η γραμμή στη δεξιά άκρη του πλαισίου κρατά τα δύο πλέγματα χωριστά.

## Ευχαριστίες

- Συνταγή: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- Κείμενο: Shenbao (Shanghai), 11 December 1912: the banquet for Sun Yat-sen at West Lake, Hangzhou: Shenbao; transcription by Wikisource editors ([πηγή](https://zh.wikisource.org/w/index.php?title=%E8%A5%BF%E6%B9%96%E5%85%AC%E5%AE%B4%E5%AD%AB%E4%B8%AD%E5%B1%B1%E7%B4%80%E4%BA%8B&oldid=9458634)), κοινό κτήμα
- Κείμενο: Shenbao (Shanghai), 4 December 1912: the memorial for the Zhejiang soldiers killed at Nanjing: Shenbao; transcription by Wikisource editors ([πηγή](https://zh.wikisource.org/w/index.php?title=%E6%B5%99%E9%83%BD%E7%9D%A3%E8%BF%BD%E7%A5%AD%E6%94%BB%E5%AF%A7%E9%99%A3%E4%BA%A1%E5%B0%87%E5%A3%AB&oldid=9458637)), κοινό κτήμα
- Κείμενο: Shenbao (Shanghai), 17 July 1912: the victory monument at West Lake, with Tang Shouqian's inscription: Shenbao, Tang Shouqian; transcription and punctuation by Wikisource editors, revised for this recipe ([πηγή](https://zh.wikisource.org/w/index.php?title=%E6%B9%AF%E8%9F%84%E4%BB%99%E4%B9%8B%E7%B4%80%E5%8A%9F%E7%A2%91&oldid=9458640)), CC-BY-SA-4.0
- Κείμενο: Four telegrams from Linshi zhengfu gongbao (Provisional Government Gazette) no. 1, 29 January 1912: Provisional Government, Nanjing; transcription and punctuation by Wikisource editors ([πηγή](https://zh.wikisource.org/w/index.php?title=%E8%87%A8%E6%99%82%E6%94%BF%E5%BA%9C%E5%85%AC%E5%A0%B1_%28%E6%B0%91%E5%9C%8B%E5%85%83%E5%B9%B41%E6%9C%8829%E6%97%A5%29&oldid=2490036)), CC-BY-SA-4.0
- Κείμενο: Punctuation of the first two reports, the masthead, decks and datelines: Postext Cookbook, CC-BY-4.0
- Γραμματοσειρές: Noto Serif TC (OFL-1.1), Noto Sans TC (OFL-1.1), LXGW WenKai TC (OFL-1.1)
- Κώδικας: MIT · Δείγμα περιεχομένου: CC-BY-4.0

## Σχετικές συνταγές

- [Αρ. 027 · Πρωτοσέλιδο εφημερίδας](https://postext.dev/el/cookbook/newspaper-front-page.md): Πρωτοσέλιδο και σελίδα 2 τοπικής εβδομαδιαίας σε δύο στήλες με γραμμές: τίτλοι πλάτους σελίδας σε πλαίσια και σύντομες ειδήσεις σε τέσσερις στήλες κάτω. · Επίπεδο 3 (Προχωρημένο) · Εφημερίδες και ενημερωτικά δελτία
- [Αρ. 081 · Ημερομηνίες και ακρωνύμια όρθια σε κατακόρυφο κείμενο](https://postext.dev/el/cookbook/chinese-dates-upright.md): Δύο ιδρυτικά έγγραφα του 1912, κατακόρυφα και δεμένα δεξιά: οι διψήφιοι αριθμοί στέκονται όρθιοι σε ένα κελί αυτόματα· τα :tcy και :upright σημαδεύουν τα άλλα. · Επίπεδο 2 (Μεσαίο) · Σχολικά βιβλία, Μονόφυλλα και εφήμερα έντυπα
- [Αρ. 075 · Ένα κινεζικό μυθιστόρημα σε κατακόρυφη γραφή, δεμένο δεξιά](https://postext.dev/el/cookbook/vertical-novel-right-bound.md): Το κεφάλαιο 1 του 三國演義 σε σελίδα 25開 της Ταϊβάν: 40 χαρακτήρες σε 16 στήλες, άνοιγμα 回目 με γραμμές, κεφαλίδες στο άκρο, κινεζικοί αριθμοί, δισέλιδα από δεξιά. · Επίπεδο 3 (Προχωρημένο) · Πεζογραφία, θέατρο και λογοτεχνικός λόγος
