Vai al contenuto principale
Ricetta numero 202

Ricettario · Capitolo 2 · Caratteri e testo

Omero in greco politonico, a fronte della traduzione

L’inizio dell’Odissea sulle pagine pari e la versione in greco moderno di Eftaliotis sulle dispari, sillabati con gli schemi grc e numerati ogni cinque versi.

In questa pagina
Genere
Poesia
Output
Canvas
Livello
Intermedio
Postext
Provata con Postext 1.99.1
Richiede ≥ 1.99.1
Licenza
Aggiornata il 29 nov 2026
Codice MIT · Testo CC BY 4.0

pp. 2–3 di 6

  • Esempio in inglese: non c’è ancora un’edizione italiana
  • Formato 140 × 215 mm
  • 1 colonna
  • GFS Didot 10,2/15
  • 6 pagine
  • Livello
  • Postext 1.99.1
  • Impaginato in 43 ms
  • 150 righe di codice

In breve

I primi versi dell’Odissea di Omero in greco antico, con tutti gli accenti e gli spiriti, sulle pagine di sinistra, e una traduzione in versi in greco moderno a destra, ogni verso all’altezza di quello che traduce.

Che cosa comporrai

Un piccolo classico di 14 × 21,5 cm in GFS Didot, il carattere politonico della Greek Font Society. Si apre con una pagina della Vita di Omero bizantina che la Suda tramanda sotto il nome di Esichio di Mileto, con l’epitaffio di Omero a Io. Seguono due doppie pagine: i versi da 1 a 27 del primo libro dell’Odissea sulle pari e la versione in quindecasillabi di Argyris Eftaliotis sulle dispari, verso per verso, numerati ogni cinque nel margine esterno. I tre testi sono di pubblico dominio e vengono dalla Wikisource greca. Testatine e aperture mettono i titoli in maiuscolo, che perde ogni spirito e accento.

Questa ricetta risponde a

  • Come compongo una poesia e la sua traduzione su pagine affiancate, con l’originale sempre sul recto?
  • Come numero un verso ogni cinque nel margine di una poesia e collego le note a quei numeri di verso?
  • Come compongo poesia: una riga per verso, spazi tra le strofe, rientri sporgenti per i versi che vanno a capo, niente sillabazione?
  • Come ottengo una buona giustificazione e sillabazione per testi in spagnolo, francese o tedesco?

La risposta breve

script.js · righe 31–51nel codice completo
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());
  }));
  await Promise.all(jobs);
}

Ingredienti

Tipo
GFS Didot (SIL OFL 1.1)
Risorse
Nessuna: ogni immagine è disegnata nel codice

Preparazione

#1 · Etichetta il testo come grc e carica le sue lettere accentate

Il codice è la risposta breve qui sopra. locale: 'grc' prende gli schemi politonici (sillabazione), che leggono uno spirito, un circonflesso, uno iota sottoscritto o una dieresi come parte della lettera su cui stanno. La pagina 1 divide Βατρα-χομυομαχία, ἐπι-δειξάμενος e τυράν-νου. Fontsource divide ogni famiglia per sistema di scrittura, e loadFonts aggiunge solo i file latin e greek. Le lettere politoniche precomposte, U+1F00–1FFF, stanno in un terzo file, greek-ext, che loadGreekExtended aggiunge a ogni famiglia prima della composizione. Chiamala dopo loadFonts, o il motore dà la famiglia per caricata e salta il file greek.

#2 · Numera ogni cinque versi nel margine esterno

script.js · righe 67–73nel codice completo
// Each page of verse is its own :::verse block. The Greek and the translation of a spread
// both open with {lineStart=11}, so the numbers on the two pages agree: restart 'poem'
// counts each block from its own start, and the epitaph, {numbered=false}, is not counted.
const lineNumbers = {
  enabled: true, count: 'verse', interval: 5, restart: 'poem', position: 'outer',
  gap: mm(6), fontFamily: DIDOT, fontSize: em(0.8), color: col('rubric'),
};

count: 'verse' numera solo i versi, e restart: 'poem' conta ogni blocco :::verse dal suo inizio. Ogni pagina di versi è un blocco. Il greco e la traduzione della seconda doppia pagina si aprono entrambi con {lineStart=11}, così i numeri delle pagine affrontate coincidono. position: 'outer' li porta nel margine sinistro di una pari e in quello destro di una dispari (numeri di riga). L’epitaffio ha {numbered=false} e non prende numero.

#3 · Aperture e testatine in maiuscolo

script.js · righe 83–124nel codice completo
// textTransform 'uppercase' turns Ὀδύσσεια into ΟΔΥΣΣΕΙΑ and Ῥαψῳδία into ΡΑΨΩΔΙΑ: Greek
// capitals take no breathing, no accent and no iota subscript (a dialytika stays, Ϊ Ϋ).
const caps = (size, tracking, color = 'muted') => ({ fontFamily: DIDOT, fontSize: pt(size),
  letterSpacing: pt(tracking), textTransform: 'uppercase', color: col(color) });
const opener = (title) => ({ enabled: true, minHeight: pt(5 * LEAD), slot: { elements: [
  { kind: 'text', id: 'kicker', content: '{attr.kicker}', align: 'center', ...caps(8, 2, 'rubric'),
    placement: { ...at('container', 'top', 0, LINE), size: { width: 'fill' } } },
  { kind: 'text', id: 'title', content: title, align: 'center', ...caps(17, 3.5, 'ink'),
    placement: { ...at('container', 'top', 0, 2.2 * LINE), size: { width: 'fill' } } },
] } });
// # Ὀδύσσεια {style="original"} opens a verso, {style="translation"} the recto facing it;
// a style sets its own break side (gotcha: style-inherits-break).
const headingStyles = [
  { id: 'original', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'translation', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: opener('{titleText}') },
  { id: 'life', breakBefore: { enabled: true, parity: 'odd' }, marginBottom: pt(0),
    advancedDesign: { enabled: true, minHeight: pt(6 * LEAD), slot: { elements: [
      { kind: 'text', id: 'title', content: '{titleText}', align: 'center', ...caps(15, 3, 'ink'),
        placement: { ...at('container', 'top', 0, 1.6 * LINE), size: { width: 'fill' } } },
      { kind: 'text', id: 'source', content: '{attr.source}', align: 'center', fontFamily: DIDOT,
        fontSize: pt(10), color: col('muted'),
        placement: { ...at('container', 'top', 0, 3.2 * LINE), size: { width: 'fill' } } },
    ] } } },
  { id: 'note-page', breakBefore: { enabled: true, parity: 'even' }, marginBottom: pt(LEAD),
    header: { elements: [] }, advancedDesign: { enabled: true, minHeight: pt(3 * LEAD),
      slot: { elements: [{ kind: 'text', id: 'label', content: '{titleText}', align: 'center',
        ...caps(7.5, 1.6, 'rubric'), placement: { ...at('container', 'top', 0, LINE),
          size: { width: 'fill' } } }] } } },
];
// The author and the title over the versos, the translator over the rectos; folios outside.
const head = (id, content, parity, edge, x, extra = {}) => ({ kind: 'text', id, content, parity,
  pages: 'body', ...caps(7.5, 1.5), ...extra, placement: at('page', edge, x, 12) });
const folio = { textTransform: 'none', letterSpacing: pt(0), fontSize: pt(9), color: col('ink') };
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
const header = { elements: [
  head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
  head('verso-head', '{author} · {title}', 'even', 'top', -SHIFT),
  head('recto-head', '{subtitle}', 'odd', 'top', SHIFT),
  head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };

textTransform: 'uppercase' trasforma Ὀδύσσεια in ΟΔΥΣΣΕΙΑ e Ῥαψῳδία in ΡΑΨΩΔΙΑ: le maiuscole greche non portano spirito, accento né iota sottoscritto, e il motore li toglie componendo. Lo stile original apre il greco su una pari e translation la versione sulla dispari di fronte. :::pagebreak{parity="even"} e {parity="odd"} fanno lo stesso nella seconda doppia pagina. Il testo del titolo e quello del PDF restano come sono scritti, con tutti i segni.

La ricetta completa

Sandbox
// ═══ Postext Cookbook · Nº 202 · Homer in polytonic Greek, facing its translation ═══════
// https://postext.dev/en/cookbook/homer-polytonic-facing-translation
// Code: MIT · Texts: Homer, Hesychius, A. Eftaliotis (PD, el.wikisource) · Pictures: none
// Fonts: GFS Didot (SIL OFL 1.1) · Needs postext ≥ 1.99.1
// The opening of the Odyssey on the versos, Eftaliotis's line-for-line modern Greek on the
// rectos, both numbered every fifth line, after a page of the Byzantine Life of Homer.
import { buildDocumentWithFonts, renderPageToCanvas } from 'https://esm.sh/postext';

const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'el')
const RECIPE = 'homer-polytonic-facing-translation';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// Black text on a warm white, and the dull red of a classical text's rubrics.
const palette = {
  ink: '#1c1a18', // the texts
  rubric: '#8c2f23', // line numbers, headings, rules
  muted: '#6b6359', // running heads, the note on the text, the colophon
  paper: '#fcfaf5',
};
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: 'rubric (defaults)', value: { hex: palette.rubric, model: 'hex' } },
];
const DIDOT = 'GFS Didot'; // the Greek Font Society's Didot: polytonic, with its own Latin
const [BODY, LEAD] = [10.2, 15]; // pt
const LINE = (LEAD * 25.4) / 72; // mm: one line, 5.29
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });

// #region answer: Ancient Greek is 'grc', with the polytonic accents written in the text
// locale 'grc' takes the polytonic patterns, which read breathings, circumflexes, the iota
// subscript and the diaeresis as the letters they sit on (Πει-σι-στρά-του, ὀφ-θαλ-μῶν,
// ἀ-ναμ-φί-λε-κτα). Eftaliotis's modern Greek is written polytonic too; under 'el' a
// polytonic word would be divided by the same patterns, so the two pages hyphenate alike.
// The labels are the modern Greek ones (Εικόνα, Πίνακας), as for 'el'.
const LOCALE = 'grc';
// Fontsource cuts each face into files by script, and loadFonts adds latin and greek. The
// accented letters of polytonic Greek (ἀ ὃ ῷ, U+1F00–1FFF) are in a third file, greek-ext:
// each face takes it too before the build, so no letter falls to a system font.
async function loadGreekExtended(faces) {
  const jobs = Object.entries(faces).flatMap(([family, specs]) => specs.map(async (spec) => {
    const id = fontsourceId(family);
    const style = spec.endsWith('i') ? 'italic' : 'normal';
    const file = `${id}-greek-ext-${parseInt(spec, 10)}-${style}.woff2`;
    const url = `${await fontsourceAt(id)}files/${file}`;
    const face = new FontFace(family, `url(${url}) format('woff2')`,
      { weight: String(parseInt(spec, 10)), style, unicodeRange: 'U+1F00-1FFF' });
    document.fonts.add(await face.load());

Lo script.js composto funziona così com’è: incollalo nello script modulo di qualsiasi pagina, oppure apri la ricetta su CodePen. Cartella della ricetta su GitHub ↗ (si apre in una nuova scheda)

Errori frequenti

Errore frequente

Uno stile di titolo eredita l’interruzione di pagina del suo livello

Una voce di headingStyles prende dal suo livello di titolo ogni campo che omette, breakBefore compreso. Un indice o un colophon con lo stile di un H1 dopo un :::pagebreak eredita parity 'odd' e finisce dietro una pagina bianca. Dai a uno stile del genere breakBefore: { enabled: false }. Stili di titolo →

  • Senza il file greek-ext, ogni vocale accentata ricade su un font di sistema che raramente si accorda. La cattura confronta ogni glifo con i file caricati (C36) e respinge una pagina così.
  • GFS Didot ha un solo peso e nessun corsivo: un’enfasi verrebbe inclinata dal renderer. Per questo la nota sul testo è in tondo.
  • Il fornitore di font PDF del kit carica solo latin e greek, perciò questa ricetta mostra il canvas e non offre il PDF.
  • Nessun verso della traduzione deve superare la giustezza. Un verso che va a capo spinge in giù di una riga il resto della pagina, e le due pagine smettono di corrispondersi verso per verso; 103 mm a 10,2 pt contengono il verso più lungo di Eftaliotis, 59 lettere.

Crediti

Testo
  • Odyssey, Book I, lines 1–27, in the polytonic text of el.wikisource (revision 165777) · Homer · pubblico dominio
  • The modern Greek translation of the same lines, line for line, from el.wikisource (revision 166701), with one accent corrected · Argyris Eftaliotis · pubblico dominio
  • Life of Homer, §§ 6–7 and the epitaph, from the Suda (ed. A. Westermann, 1845), via el.wikisource (revision 152483), with four slips corrected · Hesychius of Miletus · pubblico dominio
  • The note on the text and the colophon · Postext Cookbook · originale
Font
GFS Didot (SIL OFL 1.1)
Sandbox