Με λίγα λόγια
Ένα βιβλίο με εικόνες από χαρτόνι για νήπια. Κάθε τρύπα σε μια σελίδα δείχνει ένα μικρό κομμάτι της επόμενης εικόνας, οι λέξεις κάνουν μια εικασία, και όταν γυρίσετε τη σελίδα φαίνεται τι είναι πραγματικά.
Τι θα στοιχειοθετήσετε
Peek-a-boo! Who’s in the Garden?, ένα βιβλίο δεκατεσσάρων σελίδων από χαρτόνι σε τετράγωνο 160 mm, με τις γωνίες στρογγυλεμένες και στις τέσσερις πλευρές. Κάθε πίνακας έχει μια τρύπα, και η τρύπα κόβεται ακριβώς εκεί όπου ο επόμενος πίνακας κρατά το μέρος που ξεγελά το μάτι: το ριγέ πλευρό μιας γάτας που κοιμάται και θα μπορούσε να είναι τίγρη, το μαλλί ενός προβάτου που θα μπορούσε να είναι σύννεφο, ένα φανάρι που θα μπορούσε να είναι το φεγγάρι. Το παράθυρο του εξωφύλλου είναι φαρδύτερο από την τρύπα πίσω του, έτσι η πρώτη ματιά φτάνει δύο σελίδες σε βάθος. Οι λέξεις στα αριστερά κάνουν την εικασία· το γύρισμα της σελίδας την απαντά. Το αρχείο για το τυπογραφείο φέρει τη γραμμή κοπτικού σε δικό της τσίγκο.
Αυτή η συνταγή απαντά
- Πώς ανοίγω τρύπες στις σελίδες ενός βιβλίου, καθεμία από τις οποίες δείχνει μέρος της επόμενης εικόνας;
- Πώς στέλνω στον κατασκευαστή του κοπτικού μια γραμμή κοπτικού σε δικό της τσίγκο στο PDF;
Η σύντομη απάντηση
// Each painting is cut where the next one's telling part lies: the cat's striped flank, the
// sheep's wool, the lantern's glow. The cover's window is wider than the hedge's hole and
// holds it, so from the cover you see the hedge, and through the hedge the cat. A hole cuts
// both sides of its leaf, mirrored on the verso, and the words there run round it.
const circle = (id, name, cx, cy, d) => ({ id, name, shape: 'circle', x: mm(cx - d / 2),
y: mm(cy - d / 2), width: mm(d), height: mm(d), wrap: { gap: mm(4) } });
const dieCuts = {
shapes: [
circle('window', t({ en: 'Cover window', es: 'Ventana de la cubierta' }), 112, 68, 60),
circle('hedge', t({ en: 'Gap in the hedge', es: 'Hueco del seto' }), 112, 60, 36),
{ id: 'knot', name: t({ en: 'Knothole', es: 'Nudo de la valla' }), shape: 'ellipse',
x: mm(102), y: mm(48), width: mm(32), height: mm(40), wrap: { gap: mm(4) } },
circle('peephole', t({ en: 'Barn-door peephole', es: 'Mirilla del granero' }), 91, 29, 20),
],
// By position in the book: page 1 is the cover, 3 the hedge, 7 the fence, 11 the door.
pages: [{ pages: '1', die: 'window' }, { pages: '3', die: 'hedge' },
{ pages: '7', die: 'knot' }, { pages: '11', die: 'peephole' }],
corners: { radius: mm(9), edges: 'all' }, // board books are rounded on all four corners
};
Υλικά
- Λειτουργίες
- Οπές κοπής (die-cut)Στρογγυλεμένες γωνίες και βιβλία με σχήμαΓραμμή κοπτικού στο PDFΤρύπες σε πολλά φύλλαΤρισδιάστατη προβολή βιβλίου (Folio)Στιλ επικεφαλίδωνΕικόνες στις σχεδιάσεις σελίδαςΙδιότητες επικεφαλίδωνΣτιλ παραγράφωνΠεριθώριο αιμορραγίας και σημάδια κοπήςPDF σε CMYK και σε τόνους του γκριΕξαγωγή PDFΕικόνες και πίνακες ως πόροιΣημασιολογική χρωματική παλέταΣελίδες σε καμβά
- Χρησιμοποιεί επίσης
- Χαρτί, βιβλιοδεσία, γραφείο και φως (Folio)Σχεδιασμένες εναρκτήριες σελίδεςΧρώμα χαρτιούΧρώματα ανά μέροςΓραμματοσειρές ενσωματωμένες στο PDFΓεωμετρία ενότηταςΚεφάλαια χωρίς αρίθμηση
- Γραμματοσειρές
- Andika, Fredoka, Nunito (SIL OFL 1.1)
- Αρχεία
cat.jpgcover.jpgdoor.jpgfence.jpghedge.jpglantern.jpgsheep.jpg- Cover painting: a cottage garden, a hedge, hollyhocks and a robin (Generated With Diffusion Models, πρωτότυπο)
- Page 3: the hedge (Generated With Diffusion Models, πρωτότυπο)
- Page 5: the ginger cat asleep (Generated With Diffusion Models, πρωτότυπο)
- Page 7: the wooden fence (Generated With Diffusion Models, πρωτότυπο)
- Page 9: the sheep (Generated With Diffusion Models, πρωτότυπο)
- Page 11: the barn door (Generated With Diffusion Models, πρωτότυπο)
- Page 13: Grandpa and his lantern at dusk (Generated With Diffusion Models, πρωτότυπο)
Προετοιμασία
#1 · Τρύπες εκεί όπου μιλά η επόμενη εικόνα
Ο κώδικας είναι η σύντομη απάντηση παραπάνω. Κάθε σχήμα τοποθετείται από την πάνω αριστερή γωνία της κομμένης σελίδας και το dieCuts.pages ονομάζει τη σελίδα που κόβει, μετρώντας από την πρώτη σελίδα του βιβλίου. Μετρήστε την τρύπα πάνω στον πίνακα που αποκαλύπτει, όχι στη σελίδα όπου κόβεται: ο φράχτης από θάμνους, ο ξύλινος φράχτης και η πόρτα είναι υφές που δέχονται τρύπα οπουδήποτε, η γάτα και το φανάρι όχι.
#2 · Πίνακες σε σύμπτωση με τις τρύπες
// Each painting hangs from the trim and runs BLEED past it on every side, so the holes hit it
// in the same place on screen and in print. A picture's section drops the foot margin, so its
// design reaches the foot of the page; the words on the verso behind it, in the same section,
// start TOP down.
const SHEET = { width: mm(TRIM + 2 * BLEED), height: mm(TRIM + 2 * BLEED) }; // trim + bleed
const painting = { kind: 'image', id: 'painting', resourceId: '{attr.picture}', fit: 'cover',
placement: at('page', 'top-left', -BLEED, -BLEED, SHEET) };
const full = (elements) => ({ enabled: true, minHeight: mm(TRIM - TOP), slot: { elements } });
const flush = { margins: { top: mm(TOP), bottom: mm(0), left: mm(INNER), right: mm(OUTER) } };
const title = { kind: 'text', id: 'title', content: '{titleText}', fontFamily: DISPLAY,
fontWeight: 600, fontSize: pt(40), lineHeight: 1, color: col('accent'), align: 'left',
placement: at('page', 'top-left', 62, 8, { width: mm(88) }) };
const headingStyles = [
{ id: 'cover', numbered: false, toc: false, ...flush, advancedDesign: full([painting, title]) },
{ id: 'picture', numbered: false, ...flush, breakBefore: { enabled: true, parity: 'odd' },
advancedDesign: full([painting]) },
// The back cover: the board printed dusk blue (the section's palette), the type in cream.
{ id: 'back', numbered: false, toc: false, breakBefore: { enabled: true, parity: 'even' },
color: col('cream'), palette: { paper: palette.dusk } },
];
Οι τρύπες είναι σε χιλιοστά της κομμένης σελίδας, γι' αυτό κάθε πίνακας κρέμεται από την κομμένη σελίδα και απλώνεται στο περιθώριο αιμορραγίας πέρα από αυτήν σε κάθε πλευρά, στην οθόνη όπως και στην εκτύπωση. Το στιλ της εικόνας αφήνει έξω μόνο το κάτω περιθώριο: η σχεδίασή του φτάνει ως το κάτω μέρος της σελίδας, και οι λέξεις στην αριστερή σελίδα πίσω του κρατούν το πάνω περιθώριο των 44 mm, που τις κατεβάζει κάτω από την κορυφή των μικρών τρυπών.
#3 · Η γραμμή κοπτικού σε δικό της τσίγκο
// The die line is stroked on a Separation plate of its own ('Die'), overprinting, that the
// press never inks. PDF/X-4 on coated stock: the board is printed on coated paper.
print: { standard: 'pdfx4', outputProfile: 'fogra51', convertImages: false,
dieLine: { output: 'page', ink: 'Die', width: pt(0.5) } },
Το PDF τυπώνει κάθε σελίδα ολόκληρη και χαράζει το περίγραμμα κάθε τρύπας, και κάθε στρογγυλεμένου φύλλου, σε έναν τσίγκο Die που τυπώνεται με υπερεκτύπωση και δεν μελανώνεται ποτέ. Το convertImages: false κρατά τους πίνακες ως JPEG σε RGB με ετικέτα sRGB, κάτι που το PDF/X-4 επιτρέπει, έτσι το αρχείο μένει μικρό.
#4 · Το βιβλίο στο χέρι
folio: {
tilt: 50, yaw: -32,
paper: { type: 'board', shade: '#fbf5e8' },
binding: { type: 'hardcover', cover: 'pages', coverMaterial: 'paper' },
surface: { type: 'oak' },
lighting: { environment: 'daylight', intensity: 1.05 },
},
Το Folio κόβει τις τρύπες σε κάθε φύλλο και δείχνει τις σελίδες από κάτω με τα τοιχώματα της κοπής (die-cut), έτσι το κλιμακωτό παράθυρο διαβάζεται ως βάθος. Το χαρτόνι γυρίζει σκληρό, και οι στρογγυλεμένες γωνίες κόβονται σε κάθε φύλλο.
#5 · Επίπεδες σελίδες που βλέπουν από μέσα
// renderPageToCanvas cuts the holes; `beneath` hands it the pages under them, painted here
// at a lower scale (the composite stretches them to the page), each with its own holes.
const under = new Map();
const beneath = (i) => {
if (!under.has(i) && doc.pages[i]) {
const canvas = document.createElement('canvas');
under.set(i, canvas);
renderPageToCanvas(doc.pages[i], doc, canvas, { scale: 1, beneath });
}
return under.get(i);
};
Στον καμβά μια τρύπα δείχνει ό,τι βρίσκεται πίσω από τον καμβά, εκτός αν ο αποδοτής πάρει τις σελίδες από κάτω. Το beneath τις επιστρέφει με βάση τον δείκτη τους, καθεμία ζωγραφισμένη με τις δικές της τρύπες, έτσι το εξώφυλλο δείχνει τον φράχτη και, μέσα από τον φράχτη, τη γάτα.
Η πλήρης συνταγή
// ═══ Postext Cookbook · Nº 193 · A peek-a-boo board book with holes in register ════════
// https://postext.dev/en/cookbook/peek-a-boo-board-book
// Code: MIT · Text: original (CC BY 4.0) · Paintings: generated with diffusion models
// Fonts: Andika, Fredoka, Nunito (SIL OFL 1.1) · Needs postext ≥ 1.84.0
//
// A fourteen-page board book for toddlers: on every other recto a hole is cut through the
// painting, and what shows through it is a scrap of the next picture. The words on the left
// make a guess from the scrap; the turned page shows what it really is. The leaves have
// rounded corners, the holes step down from the cover, and the PDF carries the die line.
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
import { createFolioFromDocument } from 'https://esm.sh/postext-folio';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'peek-a-boo-board-book';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region palette: a cream board, a robin red for the title and the guesses, a dusk blue
const palette = {
ink: '#2a2420', // text: a warm near-black
accent: '#b8432c', // the cover title and the guesses: the robin's breast
paper: '#fbf5e8', // the board the words are printed on
dusk: '#253a63', // the back cover, the blue of the last painting's sky
cream: '#fff9ec', // type on the cover and the back
muted: '#7a6f64', // the colophon
};
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' } },
];
// #endregion
const [TRIM, BLEED] = [160, 3]; // mm: a square board book, and its bleed
const [TOP, FOOT, INNER, OUTER] = [44, 16, 18, 16]; // the words sit low, under the holes' tops
const [TEXT, DISPLAY, LABEL] = ['Andika', 'Fredoka', 'Nunito'];
const LEAD = 31; // pt: 24 pt type on a generous leading, for reading aloud
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
// #region answer: the dies, and the pages they cut
// Each painting is cut where the next one's telling part lies: the cat's striped flank, the
// sheep's wool, the lantern's glow. The cover's window is wider than the hedge's hole and
// holds it, so from the cover you see the hedge, and through the hedge the cat. A hole cuts
// both sides of its leaf, mirrored on the verso, and the words there run round it.
const circle = (id, name, cx, cy, d) => ({ id, name, shape: 'circle', x: mm(cx - d / 2),
y: mm(cy - d / 2), width: mm(d), height: mm(d), wrap: { gap: mm(4) } });
Το συντεθειμένο script.js εκτελείται ως έχει: επικολλήστε το στο module script οποιασδήποτε σελίδας ή ανοίξτε τη συνταγή στο CodePen. Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)
Παραλλαγές
#Στρογγυλέψτε μόνο τις γωνίες της εξωτερικής άκρης
Ένα εμπορικό βιβλίο με εικόνες στρογγυλεύει τις δύο γωνίες μακριά από τη ράχη και κρατά τη ράχη ίσια.
- corners: { radius: mm(9), edges: 'all' }, // board books are rounded on all four corners
+ corners: { radius: mm(6), edges: 'fore' },#Κόψτε κάθε φύλλο σε σχήμα
Ένα περίγραμμα σε μονάδες viewBox κόβει κάθε φύλλο σε αυτό το σχήμα, κατοπτρισμένο στις αριστερές σελίδες· υπερισχύει των γωνιών.
corners: { radius: mm(9), edges: 'all' }, // board books are rounded on all four corners
+ outline: { d: 'M0 0.35 L0.5 0 L1 0.35 L1 1 L0 1 Z', viewBox: [1, 1] }, // a houseΕυχαριστίες
- Συνταγή
- Ignacio Ferro
- Κείμενο
- The words of the board book · Postext Cookbook · CC BY 4.0
- Εικόνες
- Cover painting: a cottage garden, a hedge, hollyhocks and a robin · Generated With Diffusion Models · πρωτότυπο
- Page 3: the hedge · Generated With Diffusion Models · πρωτότυπο
- Page 5: the ginger cat asleep · Generated With Diffusion Models · πρωτότυπο
- Page 7: the wooden fence · Generated With Diffusion Models · πρωτότυπο
- Page 9: the sheep · Generated With Diffusion Models · πρωτότυπο
- Page 11: the barn door · Generated With Diffusion Models · πρωτότυπο
- Page 13: Grandpa and his lantern at dusk · Generated With Diffusion Models · πρωτότυπο
- Γραμματοσειρές
- Andika (SIL OFL 1.1) · Fredoka (SIL OFL 1.1) · Nunito (SIL OFL 1.1)
- Κώδικας
- MIT, όπως το Postext
Επεξεργασία αυτού του κειμένου ↗ (ανοίγει σε νέα καρτέλα)Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)


