Με λίγα λόγια
Ένα μικρό βιβλίο για δώρο με ουκρανικά ποιήματα του Ταράς Σεφτσένκο: κόκκινη σελίδα τίτλου με κέντημα, μια ταινία πάνω από τον τίτλο κάθε ποιήματος και σύντομες σημειώσεις με αστερίσκο.
Τι θα στοιχειοθετήσετε
Έξι σελίδες από μια έκδοση δώρου του Кобзар του Ταράς Σεφτσένκο, σε 130 × 200 mm, το σχήμα 84 × 108/32 μετά το ξάκρισμα: σελίδα τίτλου στο κόκκινο του κερασιού με ταινίες σταυροβελονιάς, σημείωμα για το κείμενο και τρία ποιήματα. Από το «Причинна» υπάρχει η περίφημη αρχή «Реве та стогне Дніпр широкий»· τα «Заповіт» και «Садок вишневий коло хати» είναι ολόκληρα. Κάθε ποίημα ανοίγει κάτω από ταινία με κόκκινες και μαύρες βελονιές. Οι στίχοι είναι Vollkorn 11 σε 15,5 pt και οι τίτλοι Yeseva One, παχιά γράμματα με τις στρογγυλές φόρμες της τέχνης του βιβλίου στο Κίεβο γύρω στο 1917. Χρονολογίες και τόποι είναι πλάγια κάτω από τα ποιήματα και οι σημειώσεις έχουν αστερίσκο. Το σημείωμα ακολουθεί τη γλώσσα της έκδοσης· τα ποιήματα μένουν ουκρανικά.
Αυτή η συνταγή απαντά
- Πώς στοιχειοθετώ βιβλίο με ποιήματα στα ουκρανικά, με στροφές, χρονολογίες και σημειώσεις;
- Πώς στοιχειοθετώ ποίηση: μία γραμμή ανά στίχο, κενά ανάμεσα στις στροφές, κρεμαστές εσοχές για τις αναδιπλωμένες γραμμές, χωρίς συλλαβισμό;
Η σύντομη απάντηση
// locale 'uk' is the language of the hyphenation, the ties (no line of the note parts «і», «в»,
// «на» from its word) and the footnotes, which start again on every page, indented. The
// apostrophe is typed ’ (U+2019): сем’ї, кров’ю stay whole words.
const LOCALE = 'uk';
// A poem is one :::verse block, written as it is printed, a blank line between two stanzas. A
// poem longer than its page goes on overleaf after a whole stanza or between two lines.
const verse = { align: 'center', hang: em(2) }; // bodyText.verse: centred on its longest line
// The note's mark follows its word: «півні[^1] не співали».
// Asterisks count a page's notes: *, **, ***, the custom of a book with few of them.
const footnotes = { numberFormat: 'symbols', fontFamily: TEXT, fontSize: pt(8.2),
lineHeight: pt(11), color: col('muted'),
separator: { enabled: true, width: 0.2, lineWidth: pt(0.5), color: col('cherry') } };
// The date and the place, in italics under the poem, drawn in to 16 mm from the
// right edge, under the ends of the lines.
const date = { id: 'date', fontSize: pt(9.2), color: col('muted'), textAlign: 'right',
italic: true, endIndent: mm(16), firstLineIndent: pt(0), marginTop: pt(LEAD),
hyphenation: false };
Υλικά
- Λειτουργίες
- Στίχοι γραμμή προς γραμμήΟι γλώσσες με κυριλλικό αλφάβητο ως γλώσσα του εγγράφουΥποσημειώσειςΛέξεις που δεν χωρίζονται στο τέλος της γραμμήςΣυλλαβισμός και γλώσσα του εγγράφουΣχεδιασμένες εναρκτήριες σελίδεςΣτιλ επικεφαλίδωνΙδιότητες επικεφαλίδωνΚεφάλαια χωρίς αρίθμησηΕικόνες στις σχεδιάσεις σελίδαςΚείμενο, γραμμές και πλαίσια στις σχεδιάσεις σελίδαςΕξώφυλλα, σελίδες τίτλου και κολοφώνεςΣτιλ παραγράφωνΜεταδεδομένα εγγράφουΤρέχουσες κεφαλίδες και αριθμοί σελίδαςΚεφαλίδες ανά ρόλο σελίδαςΣυμμετρικά περιθώριαΧρώμα χαρτιούΣημασιολογική χρωματική παλέταΕξαγωγή PDF
- Χρησιμοποιεί επίσης
- Γραμματοσειρές ενσωματωμένες στο PDFΕικόνες και πίνακες ως πόροιΓεωμετρία ενότηταςΤρέχουσες κεφαλίδες ανά ενότητα
- Γραμματοσειρές
- Vollkorn, Yeseva One (SIL OFL 1.1)
- Αρχεία
- Κανένα: κάθε εικόνα σχεδιάζεται με κώδικα
Προετοιμασία
#1 · Το ουκρανικό locale και ένα μπλοκ στίχων
Ο κώδικας είναι η σύντομη απάντηση παραπάνω. Το locale: 'uk' επιλέγει τον συλλαβισμό και τα δεσίματα των ουκρανικών, μετρά ξανά τις σημειώσεις σε κάθε σελίδα και τις βάζει σε εσοχή (κυριλλική σελιδοποίηση). Κάθε ποίημα είναι ένα μπλοκ :::verse (οδηγίες) γραμμένο όπως τυπώνεται, με κενή γραμμή ανάμεσα στις στροφές. Το align: 'center' κεντράρει το μπλοκ με βάση τον μακρύτερο στίχο και όλοι αρχίζουν από την ίδια άκρη. Το [^1] ακολουθεί τη λέξη του και το numberFormat: 'symbols' το σημειώνει * (σημειώσεις). Το :::paragraphs{style="date"} στοιχειοθετεί τη χρονολογία.
#2 · 84 × 108/32, 28 γραμμές
const [TRIM_W, TRIM_H, TOP, INNER, OUTER, LINES] = [130, 200, 22, 19, 21, 28]; // mm, lines
const page = {
sizePreset: '84x108/32', dpi: 150, backgroundColor: col('paper'),
margins: { top: mm(TOP), bottom: mm(TRIM_H - TOP - LINES * LINE), left: mm(INNER),
right: mm(OUTER), mirror: true },
};
const MEASURE = TRIM_W - INNER - OUTER; // mm: 90
const SHIFT = (INNER - OUTER) / 2; // mm: the text block's centre is off the page's centre
Το sizePreset: '84x108/32' είναι σοβιετικό και ουκρανικό σχήμα φύλλου που ξακρίζεται στα 130 × 200 mm. Το κάτω περιθώριο είναι ό,τι αφήνουν 28 γραμμές, οπότε το πλαίσιο του κειμένου τελειώνει πάντα σε ολόκληρη γραμμή. Τα εξωτερικά περιθώρια είναι μεγαλύτερα από τα εσωτερικά και εναλλάσσονται με το mirror. Το SHIFT κεντράρει κεφαλίδες και αριθμούς σελίδων πάνω στο κείμενο, που απέχει 1 mm από το μέσο της σελίδας.
#3 · Μια κόκκινη σελίδα, ύστερα μια ταινία ανά ποίημα
const none = { header: { elements: [] }, footer: { elements: [] } };
// No margins on that page: the ground and the bands reach the trim on all four sides.
const flush = { span: 'page',
margins: { top: mm(0), bottom: mm(0), left: mm(0), right: mm(0) } };
const titlePage = { id: 'title-page', ...none, ...flush, marginBottom: pt(0),
breakBefore: { enabled: true, parity: 'odd' },
advancedDesign: { enabled: true, minHeight: mm(TRIM_H), slot: { elements: [
{ kind: 'box', id: 'ground', style: { backgroundColor: col('cherry') },
placement: { ...at('page', 'top-left'), size: { width: 'fill', height: mm(TRIM_H) } } },
image('head', 'linen', { ...at('page', 'top-left'), size: { width: mm(TRIM_W) } }),
image('foot', 'linen', { ...at('page', 'bottom-left'), size: { width: mm(TRIM_W) } }),
text('author', '{author}', DISPLAY, 13, 'paper', at('page', 'top', 0, 58), wide),
text('title', '{titleText}', DISPLAY, 58, 'paper', at('page', 'top', 0, 67)),
text('subtitle', '{subtitle}', TEXT, 14, 'paper', at('page', 'top', 0, 96), italic),
image('star', 'star', { ...at('page', 'top', 0, 116), size: { width: mm(22) } }),
text('place', '{attr.place}', DISPLAY, 10, 'paper', at('page', 'bottom', 0, -32), wide),
] } } };
const poem = { id: 'poem', breakBefore: { enabled: true, parity: 'any' }, marginBottom: pt(0),
numbered: false, advancedDesign: { enabled: true, minHeight: pt(7 * LEAD), slot: { elements: [
image('band', 'band', { ...at('container', 'top', 0, -TOP + 14),
size: { width: mm(MEASURE) } }),
text('title', '{titleText}', DISPLAY, 16, 'cherry', at('container', 'top', 0, 14)),
text('kicker', '{attr.kicker}', TEXT, 9.5, 'muted', at('#title', 'below', 0, 1.5), italic),
] } } };
// The note stands low on the verso behind the title page, under a star.
const notePage = { id: 'note-page', ...none, breakBefore: { enabled: true, parity: 'any' },
marginBottom: pt(0), advancedDesign: { enabled: true, minHeight: pt(15 * LEAD), slot: {
elements: [
image('star', 'redstar', { ...at('container', 'top', 0, 10 * LINE),
size: { width: mm(13) } }),
text('label', '{titleText}', DISPLAY, 10, 'cherry', at('container', 'top', 0, 13.2 * LINE)),
] } } };
Το # Кобзар {style="title-page" place="Київ"} γεμίζει τη σελίδα 1: με span: 'page' και χωρίς περιθώρια το σχέδιο φτάνει ως το ξάκρισμα και παίρνει τον συγγραφέα και τον υπότιτλο από το frontmatter. Το # Заповіт {style="poem" kicker="…"} δίνει σε κάθε ποίημα την ταινία, τον τίτλο και μια γραμμή με πλάγια· minHeight επτά γραμμών τα κάνει όλα να αρχίζουν στο ίδιο ύψος.
#4 · Κέντημα μετρημένο σε πλέγμα
// Every stitch is an ×, so the pattern is counted, not drawn: the rose is the cells of a petal,
// b from 1 to 4 and a from b + 1 to b + 4, mirrored into its eight octants; a lozenge with a
// cross in it fills the gap every 24 stitches. Red and black threads on the paper, linen on red.
const [PERIOD, HALF] = [24, 11]; // stitches: one rose to the next, the middle row to the edge
const rose = (x, y) => { const [b, a] = [Math.abs(x), Math.abs(y)].sort((p, q) => p - q);
return b >= 1 && b <= 4 && a >= b + 1 && a <= b + 4; };
function thread(x, y) { // 'A' the main thread, 'B' the second, '' bare cloth
const u = ((x % PERIOD) + PERIOD) % PERIOD; // 0 at the middle of a rose
const [dx, v] = [u > PERIOD / 2 ? u - PERIOD : u, Math.abs(y)];
const r = Math.abs(u - PERIOD / 2) + v; // from the middle of the lozenge
if (v === HALF) return 'B';
if (v === HALF - 1) return x % 2 === 0 ? 'A' : '';
if (rose(dx, y)) return 'A';
if (r === 5 || r === 0) return 'B';
if (r === 2 && (y === 0 || u === PERIOD / 2)) return 'A';
// Small pyramids above and below the lozenge, hanging from the border.
return Math.abs(u - PERIOD / 2) + (9 - v) <= 2 && v <= 9 ? 'B' : '';
}
function stitches(x0, x1, y0, y1, colours, cellAt = thread) { // one path per thread, 1 unit a cell
const d = { A: '', B: '' };
for (let y = y0; y <= y1; y++) {
for (let x = x0; x <= x1; x++) {
const t = cellAt(x, y);
if (t) d[t] += `M${x - x0 + 0.14} ${y - y0 + 0.14}l.72 .72m0 -.72l-.72 .72`;
}
}
const [w, h] = [x1 - x0 + 1, y1 - y0 + 1];
return { width: w * 10, height: h * 10,
markup: `<svg xmlns="http://www.w3.org/2000/svg" width="${w * 10}" height="${h * 10}" `
+ `viewBox="0 0 ${w} ${h}" fill="none" stroke-width=".4" stroke-linecap="round">`
+ `<path d="${d.A}" stroke="${palette[colours[0]]}"/>`
+ `<path d="${d.B}" stroke="${palette[colours[1]]}"/></svg>` };
}
const whole = (x, y) => (rose(x, y) ? 'A' : Math.abs(x) + Math.abs(y) === 0 ? 'B' : '');
const ART = {
linen: stitches(-72, 72, -HALF, HALF, ['paper', 'paper']), // the width of the title page
band: stitches(-60, 60, -HALF, HALF, ['cherry', 'ink']), // over a poem, at the measure
star: stitches(-8, 8, -8, 8, ['paper', 'paper'], whole),
redstar: stitches(-8, 8, -8, 8, ['cherry', 'ink'], whole),
};
Οι ταινίες είναι SVG από βελονιές ×, μία διαδρομή για κάθε κλωστή. Ένα πέταλο είναι τα κελιά με b από 1 ως 4 και a από b + 1 ως b + 4, που μεταφέρονται στα οκτώ ογδοημόρια με απόλυτες τιμές· ένας ρόμβος και δύο πυραμίδες γεμίζουν το κενό κάθε 24 κελιά. 121 βελονιές πιάνουν το πλάτος του κειμένου και 145 τη σελίδα, ώστε στη μέση να υπάρχει πάντα ένα ολόκληρο ρόδο.
Η πλήρης συνταγή
// ═══ Postext Cookbook · Nº 208 · Shevchenko's poems in a gift edition of the Kobzar ══════
// https://postext.dev/en/cookbook/kobzar-ukrainian-poems
// Code: MIT · Text: T. Shevchenko, 1837–1847 (PD, litopys.org.ua) · Embroidery: drawn in code
// Fonts: Vollkorn, Yeseva One (SIL OFL 1.1) · Needs postext ≥ 1.100.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
import { renderToPdf, decompressWoff2 } from 'https://esm.sh/postext-pdf';
const LANG = 'en'; // @lang: the language of the note on the text ('en' | 'es' | 'ru')
const RECIPE = 'kobzar-ukrainian-poems';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
// The red and black thread of a Dnipro embroidery on linen-coloured paper, and the round, dark
// capitals of the Kyiv book art of the 1910s and 1920s.
const palette = {
ink: '#231b18', // the poems, the black thread
cherry: '#a3221f', // the title page, the titles, the red thread
muted: '#6f5e52', // notes, dates, running heads
paper: '#fbf5e8', // the page, the linen thread on the red
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.cherry })
.map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
const [TEXT, DISPLAY] = ['Vollkorn', 'Yeseva One']; // both with ґ є і ї
const [BODY, LEAD, LINE] = [11, 15.5, (15.5 * 25.4) / 72]; // pt, pt, and a line in mm: 5.47
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const text = (id, content, family, size, color, placement, extra = {}) => ({ kind: 'text', id,
content, fontFamily: family, fontSize: pt(size), color: col(color), align: 'center',
lineHeight: 1.15, overflow: 'wrap', ...extra,
placement: { ...placement, size: { width: 'fill' } } });
const [wide, italic] = [{ letterSpacing: pt(1) }, { italic: true }];
const image = (id, resourceId, placement) => ({ kind: 'image', id, resourceId, placement });
// #region answer: the Ukrainian locale, a :::verse block a poem, its date and its notes
// locale 'uk' is the language of the hyphenation, the ties (no line of the note parts «і», «в»,
// «на» from its word) and the footnotes, which start again on every page, indented. The
// apostrophe is typed ’ (U+2019): сем’ї, кров’ю stay whole words.
const LOCALE = 'uk';
// A poem is one :::verse block, written as it is printed, a blank line between two stanzas. A
// poem longer than its page goes on overleaf after a whole stanza or between two lines.
const verse = { align: 'center', hang: em(2) }; // bodyText.verse: centred on its longest line
// The note's mark follows its word: «півні[^1] не співали».
// Asterisks count a page's notes: *, **, ***, the custom of a book with few of them.
const footnotes = { numberFormat: 'symbols', fontFamily: TEXT, fontSize: pt(8.2),
lineHeight: pt(11), color: col('muted'),
separator: { enabled: true, width: 0.2, lineWidth: pt(0.5), color: col('cherry') } };
// The date and the place, in italics under the poem, drawn in to 16 mm from the
Το συντεθειμένο script.js εκτελείται ως έχει: επικολλήστε το στο module script οποιασδήποτε σελίδας ή ανοίξτε τη συνταγή στο CodePen. Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)
Συνήθη λάθη
Συνηθισμένο λάθος
Ένα στιλ επικεφαλίδας κληρονομεί την αλλαγή σελίδας του επιπέδου του
Μια εγγραφή headingStyles παίρνει κάθε πεδίο που παραλείπει από το επίπεδο επικεφαλίδας της, μαζί με το breakBefore. Μια σελίδα περιεχομένων ή ένας κολοφώνας με στιλ πάνω σε H1 μετά από :::pagebreak κληρονομεί parity 'odd' και καταλήγει πίσω από μια κενή σελίδα. Δώστε σε ένα τέτοιο στιλ breakBefore: { enabled: false }. Στιλ επικεφαλίδων →
- Πληκτρολογήστε την απόστροφο ’ (U+2019) στα сем’ї και з’їли. Ένα ίσιο ' διαβάζεται σαν σύμβολο ποδιών.
- Το στυλ τίτλου ορίζει τη δική του αλλαγή σελίδας: δώστε στο
poemτοbreakBeforeτου, αλλιώς το ποίημα συνεχίζει μετά το προηγούμενο. - Το
hyphenationσε στυλ παραγράφου είναι boolean. Κείμενο σε άλλη γλώσσα παίρνει:::paragraphs{lang="el"}, που φέρνει και τα πρότυπα εκείνης της γλώσσας. - Ελέγξτε ότι τα γράμματα των τίτλων έχουν ґ, є, і και ї πριν τα διαλέξετε· πολλά κυριλλικά σταματούν στα ρωσικά.
Ευχαριστίες
- Συνταγή
- Ignacio Ferro
- Κείμενο
- Причинна (1837), lines 1–16, after the text of the Collected Works in six volumes, vol. 1 (Kyiv, 2003) · Taras Shevchenko · κοινό κτήμα
- Заповіт (1845), whole, after the same edition, vol. 1 · Taras Shevchenko · κοινό κτήμα
- Садок вишневий коло хати (1847), whole, after the same edition, vol. 2 · Taras Shevchenko · κοινό κτήμα
- The note on the text, the footnotes and the colophon · Postext Cookbook · πρωτότυπο
- Γραμματοσειρές
- Vollkorn (SIL OFL 1.1) · Yeseva One (SIL OFL 1.1)
- Κώδικας
- MIT, όπως το Postext
Επεξεργασία αυτού του κειμένου ↗ (ανοίγει σε νέα καρτέλα)Φάκελος της συνταγής στο GitHub ↗ (ανοίγει σε νέα καρτέλα)


