In breve
Un libro rilegato di una serie di dodici, con i suoi fogli per la tipografia: la copertina rigida nei colori della collana con il numero del volume e i due risguardi interni, che mostrano le copertine e i titoli di tutti e dodici i libri.
Che cosa comporrai
Il matrimonio ingannevole, l'undicesima delle dodici Novelle esemplari di Cervantes, come volume XI di una collana che pubblica una novella per ogni volume rilegato. Le 26 pagine sono in Crimson Pro 11/15,2 su una pagina di 120 × 185 mm. Da queste buildCover ricava tre fogli per il legatore: la copertina rigida stampata, nel rosso sangue di bue della collana, con una cornice dorata intorno al dipinto e il numero in un anello d'oro, e i risguardi anteriore e posteriore, che si dividono la collana: i volumi dal I al VI aprono il libro e quelli dal VII al XII lo chiudono, ogni metà in dipinti sulla controguardia e in elenco numerato sulla sguardia. Accanto al codice a barre, che porta l'ISBN del volume, la copertina stampa l'ISBN dell'opera completa.
Questa ricetta risponde a
- Come stampo un volume di una collana con l’ISBN dell’opera completa e gli altri titoli sui risguardi?
La risposta breve
// The collection is data of the book, beside its versions. The volume's barcode carries its
// own ISBN, and the collection's `isbn` prints as a line above the bars. `catalogue` lists
// the twelve titles with their cover pictures, and `volume` names the one this book is: the
// endpapers set the list and the pictures from it (section 4), this volume marked in both.
const collection = {
name: t({ en: 'Exemplary Novels', es: 'Novelas ejemplares' }),
isbn: '978-84-0000-200-8',
catalogue: [
work('The Little Gipsy Girl', 'La gitanilla', 'gitanilla'),
work('The Generous Lover', 'El amante liberal', 'amante'),
work('Rinconete and Cortadillo', 'Rinconete y Cortadillo', 'rinconete'),
work('The Spanish-English Lady', 'La española inglesa', 'espanola'),
work('The Licentiate Vidriera', 'El licenciado Vidriera', 'vidriera'),
work('The Force of Blood', 'La fuerza de la sangre', 'fuerza'),
work('The Jealous Estremaduran', 'El celoso extremeño', 'celoso'),
work('The Illustrious Scullery-Maid', 'La ilustre fregona', 'fregona'),
work('The Two Damsels', 'Las dos doncellas', 'doncellas'),
work('The Lady Cornelia', 'La señora Cornelia', 'cornelia'),
work('The Deceitful Marriage', 'El casamiento engañoso', 'casamiento'),
work('The Dialogue of the Dogs', 'El coloquio de los perros', 'coloquio'),
],
};
collection.volume = collection.catalogue[VOLUME - 1].id;
const production = {
collection,
// A printed case with a flat spine: the case sheet and two endpapers, no jacket.
versions: [{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Tapa dura' }),
binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000' }],
};
Ingredienti
- Funzionalità
- Versioni a stampa, ISBN e dorsoFoglio di copertinaCopertine, frontespizi e colophonStili di titoloAperture progettateTesto, filetti e riquadri nei progetti di paginaMetadati del documentoStili di paragrafoTestatine e folioFigure e tabelle come risorseTavolozza di colori semanticaEsportazione in PDFPagine su un canvas
- Usa anche
- Carta, rilegatura, scrivania e luce (Folio)Attributi dei titoliColore della cartaTestatine secondo il ruolo della paginaFont incorporati nel PDFTestatine per sezioneCapitoli non numerati
- Tipo
- Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1)
- Risorse
amante-320.jpgcasamiento-1000.jpgcasamiento-320.jpgceloso-320.jpgcoloquio-320.jpgcornelia-320.jpgdoncellas-320.jpgespanola-320.jpgfregona-320.jpgfuerza-320.jpggitanilla-320.jpgrinconete-320.jpgvidriera-320.jpg- The front cover: a pale ensign leaning on his sword at the gate of the hospital of Valladolid, in oils (Generated With Diffusion Models, originale)
- The cover painting of volume 1, The Little Gipsy Girl, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 2, The Generous Lover, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 3, Rinconete and Cortadillo, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 4, The Spanish-English Lady, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 5, The Licentiate Vidriera, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 6, The Force of Blood, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 7, The Jealous Estremaduran, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 8, The Illustrious Scullery-Maid, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 9, The Two Damsels, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 10, The Lady Cornelia, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 11, The Deceitful Marriage, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
- The cover painting of volume 12, The Dialogue of the Dogs, on the endpapers, painted to match the front cover (Generated With Diffusion Models, originale)
Preparazione
#1 · La collana è un dato del libro
Il codice è la risposta breve qui sopra. production.collection contiene la serie: il nome, l'ISBN, un catalogue con un identificativo, un titolo e un'immagine per ogni volume, e volume, l'identificativo della voce che è questo libro. L'isbn della collana è ciò che Postext stampa accanto al codice a barre: una riga nera da 6,5 pt sopra le barre, «ISBN opera completa», nella lingua del libro. Se la versione dichiara un proprio workIsbn, si stampa quello. I due ISBN sono numeri di esempio del blocco 978-84-0000, non assegnati ad alcun libro. I controlli della configurazione segnalano un volume che non è nel catalogo e un ISBN di collana con la cifra di controllo sbagliata.
#2 · Una veste per ogni volume
// Every position is in mm from the top-left corner of its zone (the case's front is
// 116 × 191 mm: the 120 × 185 trim, set back 7 mm at the joint, 3 mm square round it).
const box = (id, zone, x, y, width, height, color, extra) => ({ id, kind: 'box', zone, x, y,
width, height, color: col(color), ...extra });
const picture = (id, zone, x, y, width, height, resourceId, extra) => ({ id, kind: 'image', zone,
x, y, width, height, resourceId, fit: 'cover', ...extra });
// `basis`: the spine drawn on; a thicker book stretches the bands and keeps the badge centred.
const spine = { basis: { width: 10, height: 191 } };
const livery = [
box('frame', 'front', 11.2, 59.2, 93.6, 105.6, 'gold'),
picture('art', 'front', 12, 60, 92, 104, 'cover-art'),
picture('badge', 'front', 51.5, 169, 13, 13, 'badge', { fit: 'contain' }),
box('head-band', 'spine', 0, 13, 10, 0.8, 'gold', spine),
box('foot-band', 'spine', 0, 160, 10, 0.8, 'gold', spine),
picture('spine-badge', 'spine', 1, 167, 8, 8, 'badge', { fit: 'contain', ...spine }),
// A paper label for the barcode, whose caption is set in black.
box('label', 'back', 53, 147, 61, 40, 'bone'),
];
Il disegno della copertina è lo stesso oggetto in tutti i volumi della collana; cambiano solo VOLUME, il dipinto e i testi. Ogni elemento è collocato rispetto alla zona in cui si trova: se un altro volume ha più pagine e un dorso più spesso, il piatto anteriore si sposta con il suo pannello. Sul dorso, basis registra i 10 mm di dorso su cui sono state disegnate le fasce: con un dorso di 8,3 mm o di 14 mm le fasce si adattano alla larghezza e l'anello resta sull'asse. La riga sopra il codice a barre è in nero, perciò il codice poggia su un'etichetta chiara.
#3 · Ogni risguardo ha un disegno suo
// The case takes the livery; each endpaper names a design in `sheets`. At the front the
// pastedown is the left page, at the back the right one: volumes I–VI open the book,
// VII–XII close it, the pictures always on the pastedown, in the case's colour. A catalogue
// element grids the titles' pictures in its box; `stroke` outlines this volume's.
const shelf = (first, last) => ({ id: `shelf-${first}`, kind: 'catalogue', zone: 'pastedown',
x: 26.5, y: 18, width: 67, height: 149, columns: 2, gap: 7, first, last,
stroke: { color: col('gold'), width: 0.8 } });
const endpaper = (first, last) => ({ background: col('endpaper'),
zones: { pastedown: col('case') }, elements: [shelf(first, last)],
verticalAlign: { flyleaf: 'middle' } });
const cover = {
background: col('case'),
elements: livery,
verticalAlign: { back: 'top' },
sheets: { endpaperFront: endpaper(1, 6), endpaperBack: endpaper(7, 12) },
};
cover.sheets dà a un foglio un disegno che prende il posto di quello della copertina: qui endpaperFront e endpaperBack, ciascuno con il suo fondo, la controguardia nel colore della copertina, e un elemento catalogue. L'elemento è un riquadro in una zona che il motore riempie con le immagini dei titoli da first a last, su columns colonne distanziate di gap mm, ogni immagine a coprire la sua cella. Il titolo il cui identificativo è collection.volume viene contornato con lo stroke dell'elemento; su questi risguardi è la cornice dorata del volume XI. La veste della copertina non arriva ai risguardi, perché ogni foglio disegna solo il proprio. Aprendo il libro davanti la controguardia è la pagina sinistra, in fondo è quella destra, così i dipinti stanno sempre sul cartone.
I titoli vengono dal Markdown di copertina, che serve a tutti i fogli. Una cornice che nomina i suoi fogli va solo su quelli:
:::frame{slot="flyleaf" sheet="endpaperBack"}
:::paragraphs{style="ad-head"}
Exemplary Novels
:::
::catalogue{numbers="I" first=7 last=12}
:::::catalogue viene sostituito dai titoli del catalogo, un paragrafo ciascuno: il posto nello stile di numerazione indicato da numbers, uno spazio da mezzo quadratone e il titolo. Le righe prendono lo stile di paragrafo cover-catalogue, quella di questo volume cover-catalogue-current; il codice li ridefinisce entrambi, centrati in Crimson Pro, il corrente in rosso scuro. La cornice del retro nomina case jacket, quindi i risguardi la lasciano fuori.
#4 · Tre fogli da un solo libro
const sheet = async (kind) => {
const built = buildCover({ config, version: 'hardcover', pages: book.pages,
markdown: coverText, metadata: book.metadata, resources, sheet: kind });
if (!('config' in built)) throw new Error(built.issues.map((i) => i.kind).join(', '));
// The barcode's digits name OCR-B, which no font server has: the label face sets them.
for (const [id, bytes] of Object.entries(built.files)) {
await loadSvg(id, new TextDecoder().decode(bytes)
.replace(/font-family="[^"]*"/g, 'font-family="Josefin Sans"'));
}
return { built, doc: await buildDocumentWithFonts(built.content, built.config, kitFonts(FONTS)) };
};
const sheets = [await sheet('cover'), await sheet('endpaperFront'), await sheet('endpaperBack')];
La stessa chiamata con sheet: 'cover', 'endpaperFront' e 'endpaperBack' produce la copertina e i due risguardi, ciascuno un documento di una pagina nel proprio formato. Le 26 pagine si arrotondano a due segnature da 16, 16 carte da 240 µm; con 0,5 mm di tolleranza il blocco è spesso 4,3 mm e il dorso della copertina 8,3 mm, aggiunti due cartoni da 2 mm. La scritta sul dorso si controlla sul dorso della copertina, oltre il minimo di 6 mm. Il PDF contiene le 26 pagine, poi la copertina e i risguardi.
La ricetta completa
// ═══ Postext Cookbook · Nº 198 · A volume of a collection, its endpapers the series ═══
// https://postext.dev/en/cookbook/collection-volume-endpapers
// Code: MIT · Text: Cervantes, tr. W. K. Kelly (public domain) · Art: diffusion models
// Fonts: Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1) · Needs postext ≥ 1.92.0
//
// Volume XI of the twelve Exemplary Novels, one novella per hardcover: the series livery on
// the case, two ISBNs by the barcode, the twelve titles of the collection on the endpapers.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { buildCover, workIsbnCaption } from 'https://esm.sh/postext/production';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'collection-volume-endpapers';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
const palette = { ink: '#2a211c', accent: '#7a2a22', muted: '#6c6258', paper: '#fbf7ee',
case: '#5e1c1a', gold: '#d2ae6a', bone: '#f1e8d4', endpaper: '#ece0c6' };
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: 'accent (defaults)', value: { hex: palette.accent, model: 'hex' } },
];
const VOLUME = 11; // this book's place in the collection
const roman = (n) => 'I II III IV V VI VII VIII IX X XI XII'.split(' ')[n - 1];
const work = (en, es, id) => ({ id, title: t({ en, es }), resource: `cat-${id}` });
// #region answer: the volume and its collection: two ISBNs and the series' catalogue
// The collection is data of the book, beside its versions. The volume's barcode carries its
// own ISBN, and the collection's `isbn` prints as a line above the bars. `catalogue` lists
// the twelve titles with their cover pictures, and `volume` names the one this book is: the
// endpapers set the list and the pictures from it (section 4), this volume marked in both.
const collection = {
name: t({ en: 'Exemplary Novels', es: 'Novelas ejemplares' }),
isbn: '978-84-0000-200-8',
catalogue: [
work('The Little Gipsy Girl', 'La gitanilla', 'gitanilla'),
work('The Generous Lover', 'El amante liberal', 'amante'),
work('Rinconete and Cortadillo', 'Rinconete y Cortadillo', 'rinconete'),
work('The Spanish-English Lady', 'La española inglesa', 'espanola'),
work('The Licentiate Vidriera', 'El licenciado Vidriera', 'vidriera'),
work('The Force of Blood', 'La fuerza de la sangre', 'fuerza'),
work('The Jealous Estremaduran', 'El celoso extremeño', 'celoso'),
work('The Illustrious Scullery-Maid', 'La ilustre fregona', 'fregona'),
work('The Two Damsels', 'Las dos doncellas', 'doncellas'),
work('The Lady Cornelia', 'La señora Cornelia', 'cornelia'),
work('The Deceitful Marriage', 'El casamiento engañoso', 'casamiento'),
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)
Varianti
#Avvolgi la copertina in una sovraccoperta
Su una copertina rigida, flaps aggiunge una sovraccoperta, un quarto foglio con le sue alette. Il codice a barre e l'ISBN dell'opera completa passano sul suo retro, e con loro il testo di presentazione, la cui cornice nomina jacket.
versions: [{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Tapa dura' }),
- binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000' }],
+ binding: 'case-flat', isbn: '978-84-0000-198-8', isbnAddOn: '90000', flaps: true }],#Componi il volume successivo
Per il volume XII il disegno resta com'è: VOLUME indica la voce del catalogo in collection.volume, e l'anello, la cornice dorata sui risguardi e il titolo evidenziato la seguono. Il Markdown di copertina, il dipinto e l'ISBN sono quelli di quel volume.
-const VOLUME = 11; // this book's place in the collection
+const VOLUME = 12; // this book's place in the collectionErrori frequenti
- I fogli vengono dopo le pagine del libro nell'elenco catturato: la copertina è la pagina 27, il numero di pagine del libro più uno. Una modifica che aggiunge una pagina al libro li sposta.
- Il controllo
contentInConfigdel Ricettario scambia la riga chebuildCoverstampa sopra il codice a barre per testo conservato in un disegno. Il codice la dichiara inchecks.contentInConfig.allow, con la formulazione diworkIsbnCaption, la funzione usata dal motore. - Un elemento
cataloguedisegna solo le immagini. L'elenco dei titoli è il::cataloguedel Markdown, quindi un foglio senza quella riga mostra i dipinti senza nomi sotto. - Le cifre del codice a barre richiedono OCR-B, che nessun server di font fornisce. Carica il codice a barre con il
font-familydi un font che il codice carica già, altrimenti il PDF fallisce.
Crediti
- Ricetta
- Ignacio Ferro
- Testo
- The Deceitful Marriage, translated by Walter K. Kelly, from The Exemplary Novels of Cervantes (London, Bohn’s Standard Library, 1846; 1881 reprint), Project Gutenberg eBook #14420 · Miguel de Cervantes · pubblico dominio
- El casamiento engañoso, from the Novelas ejemplares in the 1825 edition as transcribed on Wikisource · Miguel de Cervantes · pubblico dominio
- Immagini
- The front cover: a pale ensign leaning on his sword at the gate of the hospital of Valladolid, in oils · Generated With Diffusion Models · originale
- The cover painting of volume 1, The Little Gipsy Girl, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 2, The Generous Lover, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 3, Rinconete and Cortadillo, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 4, The Spanish-English Lady, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 5, The Licentiate Vidriera, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 6, The Force of Blood, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 7, The Jealous Estremaduran, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 8, The Illustrious Scullery-Maid, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 9, The Two Damsels, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 10, The Lady Cornelia, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 11, The Deceitful Marriage, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- The cover painting of volume 12, The Dialogue of the Dogs, on the endpapers, painted to match the front cover · Generated With Diffusion Models · originale
- Font
- Crimson Pro (SIL OFL 1.1) · Cormorant Garamond (SIL OFL 1.1) · Josefin Sans (SIL OFL 1.1)
- Codice
- MIT, come Postext
Modifica questo testo ↗ (si apre in una nuova scheda)Cartella della ricetta su GitHub ↗ (si apre in una nuova scheda)


