In breve
Le stesse due leggende di Bécquer in un libro rilegato: la tela che riveste i piatti, la sovraccoperta di carta che la avvolge e i fogli dipinti incollati all’interno. Le pagine non cambiano; ogni versione ha i suoi fogli e il suo ISBN.
Che cosa comporrai
Le due leggende di Bécquer della brossura con alette, rilegate una seconda volta in un cartonato di 120 × 190 mm. Le 37 pagine restano come sono. Il libro ha ora due versioni, ciascuna con la sua legatura e il suo ISBN, e il cartonato dà al legatore quattro fogli. La coperta è rivestita di tela verde scuro, con titolo e autore impressi in oro sul piatto anteriore e sul dorso. La sovraccoperta porta il dipinto, il testo di presentazione, il codice a barre e le due alette. Dentro i piatti ci sono due risguardi dipinti: Soria sopra il Duero davanti, la fonte della seconda leggenda dietro.
Questa ricetta risponde a
- Come faccio la copertina rigida, la sovraccoperta e i risguardi del cartonato dello stesso libro della brossura?
La risposta breve
// The paperback is Nº 196's, on the printer's own profile. The hardcover takes the built-in
// flat-spine case; `flaps` on a case means a dust jacket, and `caseMaterial: 'cloth'` a case
// covered in cloth and stamped, under the jacket. Spines, boards and turn-ins come from the
// laid-out pages on the paper of `folio.paper`.
const production = {
bindings: [{ id: 'pur-flaps', name: 'PUR perfect binding, 60 mm flaps', style: 'perfect',
signature: 16, measures: { flapWidth: 60, bleed: 3, spineAllowance: 0.5 } }],
versions: [
{ id: 'paperback', name: t({ en: 'Paperback', es: 'Rústica' }), binding: 'pur-flaps',
flaps: true, isbn: '978-84-0000-196-4', isbnAddOn: '90000' },
{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
flaps: true, caseMaterial: 'cloth', isbn: '978-84-0000-197-1', isbnAddOn: '90000' },
],
};
// 100 g/m² bulky cream wove at a bulk of 2.4: each leaf is 100 × 2.4 = 240 µm thick.
const folio = { paper: { type: 'bookWove', grammage: 100, bulk: 2.4, shade: '#f7f1e3' } };
// The book's cover design (the paperback's, the jacket's): a night ground and the painting
// on the front panel, into the bleed, whatever the panel's width. `sheets` gives the
// hardcover's other sheets a design of their own: the case its cloth, each endpaper its
// painting across both leaves.
const cover = { background: col('night'), verticalAlign: { back: 'middle' },
image: { resourceId: 'moncayo', area: 'front', focus: { x: 0.5, y: 0.4 } },
sheets: {
case: { background: col('cloth') },
endpaperFront: { image: { resourceId: 'soria' } },
endpaperBack: { image: { resourceId: 'fuente' } },
} };
Ingredienti
- Funzionalità
- Foglio di copertinaVersioni a stampa, ISBN e dorsoCopertine, frontespizi e colophonStili di titoloAperture progettateTesto, filetti e riquadri nei progetti di paginaMetadati del documentoStili di paragrafoIndiceTestatine 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
fuente-1300.jpgmoncayo-1100.jpgsoria-1300.jpg- The dust jacket: a ruined chapel under the Moncayo on All Souls’ Night, in oils (Generated With Diffusion Models, originale)
- The front endpaper: Soria above the Duero at dusk, with the Mountain of the Spirits (Generated With Diffusion Models, originale)
- The back endpaper: a spring among poplars on the slopes of the Moncayo by moonlight (Generated With Diffusion Models, originale)
Preparazione
#1 · Un solo blocco di pagine, due versioni
Il codice è la risposta breve qui sopra. Le due versioni leggono lo stesso folio.paper e le stesse pagine impaginate: 37 pagine, arrotondate a tre segnature da 16, cioè 24 carte da 240 µm. La brossura aggiunge il margine per la colla e ha un dorso di 6,3 mm. Il cartonato aggiunge anche i due cartoni da 2 mm, e il suo dorso misura 10,3 mm. Ogni versione ha il suo ISBN, entrambi numeri d’esempio di un blocco editoriale non assegnato a nessun libro. Il dorso è piatto perché un blocco sotto i 6 mm è troppo sottile per arrotondarlo; case-round aggiungerebbe 3 mm e lo arrotonderebbe. La coperta è in tela (cloth) perché la sovraccoperta porta già il dipinto, i testi e il codice a barre, e sotto basta un titolo impresso.
#2 · La coperta: rimbocco, cerniere e unghiature
// One call per sheet, with the same config and the same cover text: each sheet takes its
// design from `cover.sheets` (the jacket, the book's) and the frames meant for it. The
// barcode goes on the jacket alone, the sheet a till scans.
const built = {};
for (const sheet of ['cover', 'jacket', 'endpaperFront', 'endpaperBack']) {
const made = buildCover({ config, sheet, pages: book.pages, version: 'hardcover',
markdown: coverText, metadata: book.metadata, resources });
if (!('config' in made)) throw new Error(made.issues.map((i) => i.kind).join(', '));
// The barcode's digits name OCR-B, which no font server has: set in the label face.
for (const [id, bytes] of Object.entries(made.files)) {
await loadSvg(id, new TextDecoder().decode(bytes)
.replace(/font-family="[^"]*"/g, 'font-family="Josefin Sans"'));
}
built[sheet] = made;
}
const sheetDoc = (b) => buildDocumentWithFonts(b.content, b.config, kitFonts(FONTS));
const caseDoc = await sheetDoc(built.cover);
const jacketDoc = await sheetDoc(built.jacket);
La copertina di una brossura si taglia al formato del libro e le alette si piegano sul taglio davanti. La coperta di un cartonato è un rivestimento che avvolge due cartoni. Ogni cartone è tagliato 7 mm più stretto della pagina dal lato del dorso e sporge 3 mm dalle pagine in testa, al piede e sul taglio davanti (le unghiature), quindi misura 116 × 196 mm. Tra ogni cartone e il dorso corre una cerniera di 7 mm, dove la coperta si piega. Tutto intorno, un rimbocco di 15 mm si ripiega sui bordi dei cartoni, ed è per questo che il fondo di tela arriva a un foglio di 286,3 × 226 mm.
Tutti i fogli si fanno con la stessa config e lo stesso testo di copertina. La coperta prende il progetto da cover.sheets.case, un fondo di tela e nient’altro, e le righe dai riquadri segnati sheet="case": titolo, sottotitolo e autore sul piatto anteriore e sul dorso, con stili case- che sono quelli della sovraccoperta in oro, e un riquadro vuoto sul piatto posteriore, che tiene la tela libera dal testo di presentazione. Il codice a barre si stampa solo sulla sovraccoperta, il foglio che la cassa legge.
#3 · La sovraccoperta riprende progetto e testo della copertina
const style = (id, fontFamily, size, lead, color, extra) => ({ id, fontFamily, fontSize: pt(size),
lineHeight: pt(lead), color, italicColor: color, firstLineIndent: mm(0), textAlign: 'left',
hyphenation: false, ...extra });
const caps = (tracking) => ({ fontWeight: 600, textTransform: 'uppercase',
letterSpacing: pt(tracking) });
const coverStyles = [
style('cover-title', 'Cormorant Garamond', 40, 40, col('bone'), { fontWeight: 600,
textAlign: 'center', marginTop: mm(12) }),
style('cover-subtitle', 'Cormorant Garamond', 15, 19, col('bone'), { italic: true,
textAlign: 'center' }),
style('cover-author', 'Josefin Sans', 8.5, 11, col('gold'), { ...caps(1.8),
textAlign: 'center', marginTop: pt(16) }),
style('cover-spine', 'Josefin Sans', 7.5, 9, col('bone'), { ...caps(1.2), textAlign: 'center' }),
style('cover-blurb', 'Crimson Pro', 10.5, 14.5, col('bone'), { marginBottom: pt(7) }),
style('cover-note', 'Crimson Pro', 10.5, 14.5, col('gold'), { italic: true }),
style('flap-head', 'Josefin Sans', 7.5, 10, col('gold'), caps(1.4)),
style('flap-text', 'Crimson Pro', 9.6, 13.2, col('bone'), { marginTop: pt(5) }),
];
// The case's frames (`sheet="case"` in the cover text) set the jacket's lines in gold, the
// colour the cloth is stamped in.
const stamped = coverStyles.filter((s) => /title|subtitle|author|spine/.test(s.id))
.map((s) => ({ ...s, id: s.id.replace('cover-', 'case-'), color: col('gold'),
italicColor: col('gold') }));
La sovraccoperta non ha una voce in cover.sheets, quindi prende il cover del libro e i riquadri senza sheet, con gli stili di paragrafo e il Markdown di copertina della brossura; il pannello anteriore e il dorso si riempiono con i metadati, perché lì i riquadri della coperta restano fuori. I suoi pannelli sono più larghi: ciascuno copre un cartone, la cerniera e 3 mm in più per ripiegarsi sul bordo, 126 mm in tutto. Le alette passano a 80 mm, due terzi della larghezza di pagina, la misura predefinita di una sovraccoperta. Il dipinto riempie il pannello anteriore fino alla piega, e il codice a barre sta sul pannello posteriore, dove il libraio lo legge.
#4 · I due risguardi in un documento
// Both endpapers are the size of two pages: one document holds them, a page each, the
// back's template renamed so the two templates do not share an id.
const [ef, eb] = [built.endpaperFront, built.endpaperBack];
const back = { ...eb.config.pageTemplates.at(-1), id: 'endpaper-back' };
const endpapers = await buildDocumentWithFonts({ ...ef.content, markdown: `${ef.content.markdown}`
+ `\n\n${eb.content.markdown.replace('postext-cover', back.id)}` },
{ ...ef.config, pageTemplates: [...ef.config.pageTemplates, back] }, kitFonts(FONTS));
Un risguardo è largo due pagine: la controguardia è incollata al cartone e la carta di guardia si gira come una pagina. Davanti la controguardia sta a sinistra, dietro a destra. Ogni foglio misura 246 × 196 mm, con 3 mm di abbondanza in testa, al piede e sui bordi esterni e nessuna alla piega, dove una striscia di colla di 5 mm lo fissa al blocco. I due dipinti lasciano tranquillo il centro, perché la piega lo attraversa. I due fogli hanno lo stesso formato, quindi un solo documento li raccoglie, uno per pagina. Ogni dipinto è il progetto del suo risguardo in cover.sheets, steso su entrambe le carte.
La ricetta completa
// ═══ Postext Cookbook · Nº 197 · A hardcover's case, dust jacket and endpapers ═══
// https://postext.dev/en/cookbook/hardcover-jacket-and-endpapers
// Code: MIT · Text: Bécquer, tr. C. F. & K. L. Bates (public domain) · Art: diffusion models
// Fonts: Crimson Pro, Cormorant Garamond, Josefin Sans (SIL OFL 1.1) · Needs postext ≥ 1.92.0
//
// The pages of Nº 196 bound two ways: the paperback with flaps, and a cloth hardcover in a
// dust jacket with painted endpapers. Each version has its binding and its ISBN; buildCover
// makes each sheet of the hardcover from the same laid-out pages.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, inlineSvgFonts,
} from 'https://esm.sh/postext';
import { buildCover } 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 = 'hardcover-jacket-and-endpapers';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// The last four colours are the covers': the jacket's night, gold and bone, the case's cloth.
const palette = { ink: '#25221e', accent: '#86472a', muted: '#6b645a', paper: '#fbf7ee',
night: '#16242a', gold: '#c99b4e', bone: '#eee5d1', cloth: '#22362f' };
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' } },
];
// #region answer: two versions over the same pages, each with its binding and its ISBN
// The paperback is Nº 196's, on the printer's own profile. The hardcover takes the built-in
// flat-spine case; `flaps` on a case means a dust jacket, and `caseMaterial: 'cloth'` a case
// covered in cloth and stamped, under the jacket. Spines, boards and turn-ins come from the
// laid-out pages on the paper of `folio.paper`.
const production = {
bindings: [{ id: 'pur-flaps', name: 'PUR perfect binding, 60 mm flaps', style: 'perfect',
signature: 16, measures: { flapWidth: 60, bleed: 3, spineAllowance: 0.5 } }],
versions: [
{ id: 'paperback', name: t({ en: 'Paperback', es: 'Rústica' }), binding: 'pur-flaps',
flaps: true, isbn: '978-84-0000-196-4', isbnAddOn: '90000' },
{ id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
flaps: true, caseMaterial: 'cloth', isbn: '978-84-0000-197-1', isbnAddOn: '90000' },
],
};
// 100 g/m² bulky cream wove at a bulk of 2.4: each leaf is 100 × 2.4 = 240 µm thick.
const folio = { paper: { type: 'bookWove', grammage: 100, bulk: 2.4, shade: '#f7f1e3' } };
// The book's cover design (the paperback's, the jacket's): a night ground and the painting
// on the front panel, into the bleed, whatever the panel's width. `sheets` gives the
// hardcover's other sheets a design of their own: the case its cloth, each endpaper its
// painting across both leaves.
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
#Stampa la coperta invece di rivestirla di tela
Togli case da cover.sheets e la coperta prende il progetto del libro: il fondo notturno e il dipinto sul piatto anteriore. I suoi riquadri continuano a mettere il titolo in oro.
sheets: {
- case: { background: col('cloth') },
endpaperFront: { image: { resourceId: 'soria' } },#Arrotonda il dorso
Su un libro più spesso, case-round aggiunge 3 mm al dorso della coperta, e quello della sovraccoperta cresce con lui.
- { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-flat',
+ { id: 'hardcover', name: t({ en: 'Hardcover', es: 'Cartoné' }), binding: 'case-round',Errori frequenti
- I fogli vengono dopo le pagine del libro nell’elenco catturato: la coperta alla 38, la sovraccoperta alla 39, i risguardi alla 40 e alla 41. Se il libro guadagna una pagina, tutti i numeri si spostano.
- In un cartonato
sheet="cover"indica la coperta oltre alla copertina di una brossura;sheet="case"indica solo la coperta. Il riquadro proprio di un foglio sostituisce quello comune della stessa zona solo su quel foglio, e uno vuoto la lascia bianca.
Crediti
- Ricetta
- Ignacio Ferro
- Testo
- The Spirits’ Mountain and The Emerald Eyes, translated by Cornelia Frances Bates and Katharine Lee Bates, from Romantic Legends of Spain (1909), Project Gutenberg eBook #50044 · Gustavo Adolfo Bécquer · pubblico dominio
- El monte de las ánimas and Los ojos verdes, from the Obras (Madrid, Fernando Fe, 1885) as transcribed on Wikisource, accents modernised · Gustavo Adolfo Bécquer · pubblico dominio
- Immagini
- The dust jacket: a ruined chapel under the Moncayo on All Souls’ Night, in oils · Generated With Diffusion Models · originale
- The front endpaper: Soria above the Duero at dusk, with the Mountain of the Spirits · Generated With Diffusion Models · originale
- The back endpaper: a spring among poplars on the slopes of the Moncayo by moonlight · 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)


