Zum Hauptinhalt springen
Rezept Nummer 210

Rezepte · Kapitel 9 · Vollständige Publikationen

Abai und fünf Dichter der Steppe, kasachische Anthologie

Eine achtseitige Anthologie in sechs kyrillischen Sprachen: ein kasachisches Buch, je ein Gedicht, Glossen am Seitenfuß und Filzornament.

Auf dieser Seite
Gattung
Lyrik
Ausgabe
Canvas · PDF
Stufe
Mittel
Postext
Getestet mit Postext 1.100.0
Erfordert ≥ 1.100.0 · postext-pdf ≥ 1.100.0
Lizenz
Aktualisiert am 2. Dez. 2026
Code MIT · Text MIT

S. 1 von 8

  • Englisches Beispiel: noch keine deutsche Ausgabe
  • Endformat 145 × 215 mm
  • 1 Spalte
  • Alegreya 11/14,5
  • Alegreya Sans
  • Piazzolla
  • 8 Seiten
  • Stufe
  • Postext 1.100.0
  • In 56 ms gesetzt
  • 143 Zeilen Code

Kurz gesagt

Eine kleine Anthologie, die mit Abai beginnt und mit Gedichten auf Kirgisisch, Tatarisch, Baschkirisch, Mongolisch und Tadschikisch weitergeht. Schwere Wörter sind am Seitenfuß auf Kasachisch erklärt; das Ornament stammt von Filzteppichen.

Was Sie setzen

Дала үні (Stimme der Steppe), ein Heft von 145 × 215 mm auf acht Seiten. Der Umschlag ist ein Filzteppich aus Widderhornkacheln über Titel und Inhalt. Abais Erstes Wort und die erste Strophe seiner Achtzeiler füllen eine Doppelseite; je ein Gedicht auf Kirgisisch, Tatarisch, Baschkirisch, Mongolisch und Tadschikisch hat eine Seite, unter einem Feld in der Farbe des Dichters mit römischer Ziffer, Titel, Name, Lebensdaten und Sprache. Alte und fremde Wörter sind am Fuß auf Kasachisch glossiert. Der Text ist Alegreya, die Titel Piazzolla. Nur das Kolophon folgt der Sprache der Ausgabe.

Dieses Rezept beantwortet

  • Wie setze ich eine Anthologie in Kasachisch, Kirgisisch, Tatarisch, Mongolisch und Tadschikisch?

Die kurze Antwort

script.js · Zeilen 41–59im vollständigen Code
// The book is Kazakh: its hyphenation, the ties (a dash opens no line, a number keeps its unit)
// and its notes, which start again on every page with an indent of 1.5 em.
const LOCALE = 'kk';
// A poem in another language is a :::verse block that names it: the poem is shaped by that
// language and tagged with it in the PDF and the HTML, :::verse{lang=ky}.
// ky Kyrgyz, tt Tatar, ba Bashkir, mn Mongolian, tg Tajik. Two spaces at the head of a line
// draw it in, as in the third and sixth lines of «Сегіз аяқ».
const verse = { align: 'center', hang: em(2), keepStanzas: 8 }; // bodyText.verse
const bodyText = {
  fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
  boldColor: col('ink'), italicColor: col('ink'), referenceColor: col('red'),
  textAlign: 'justify', firstLineIndent: em(1.5), minWordSpacing: 0.75, maxWordSpacing: 1.7,
  maxJustifyTracking: 15,
  hyphenation: { leftMin: 2, rightMin: 2 }, verse,
};
// The glosses are Kazakh, whatever the language of the word: жеме — сөгіс, кінә.
const footnotes = { fontFamily: TEXT, fontSize: pt(8.8), lineHeight: pt(11.5),
  color: col('muted'), separator: { enabled: true, width: 0.2, lineWidth: pt(0.6),
    color: col('gold') } };

Zutaten

Schrift
Alegreya, Alegreya Sans, Piazzolla (SIL OFL 1.1)
Dateien
Keine: Jedes Bild wird im Code gezeichnet

Zubereitung

#1 · Ein kasachisches Buch mit Gedichten in fünf weiteren Sprachen

Der Code ist die kurze Antwort oben. locale: 'kk' gibt dem Buch seine Silbentrennung, seine zusammengehaltenen Wörter und seine Anmerkungen, die auf jeder Seite neu zählen und 1,5 em eingezogen sind. Jedes der übrigen Gedichte ist ein :::verse{lang=ky}, in seiner Sprache gesetzt und im PDF und HTML ausgezeichnet. align: 'center' zentriert jedes Gedicht nach seinem längsten Vers, keepStanzas: 8 hält eine Strophe auf einer Seite, und zwei Leerzeichen am Versanfang rücken ihn ein.

#2 · Ein Filzfeld in der Farbe des Dichters

script.js · Zeilen 63–84im vollständigen Code
// # Үлгү ырлар {tone="blue" author="Тоқтоғұл Сатылғанов" when="1864–1933" tongue="қырғызша"}
const PANEL = 56; // mm: the panel's height, from the head of the page
const opener = { enabled: true, minHeight: mm(PANEL - TOP + 8), slot: { elements: [
  image('panel', 'panel-{attr.tone}', { ...at('page', 'top-left'), size: { width: mm(TRIM_W) } }),
  text('number', '{number}', DISPLAY, 17, 700, 'cream', at('container', 'top-left', 0, -10)),
  text('title', '{titleText}', DISPLAY, 21, 800, 'cream',
    { ...at('container', 'top-left', 0, -2.5), ...fill }),
  text('author', '{attr.author}', SANS, 12, 700, 'cream', at('container', 'top-left', 0, 11)),
  text('when', '{attr.when} · {attr.tongue}', SANS, 11, 400, 'cream',
    { ...at('container', 'top-right', 0, 11.3) }, { align: 'right' }),
] } };
// A second piece by the same poet goes on in the page, under a narrower border.
const runOn = { id: 'run-on', breakBefore: { enabled: false }, marginTop: pt(LEAD),
  marginBottom: pt(0), advancedDesign: { enabled: true, minHeight: pt(3.6 * LEAD), slot: {
    elements: [
      image('strip', 'strip', { ...at('container', 'top-left'), ...fill }),
      text('number', '{number}', DISPLAY, 13, 700, 'red', at('container', 'top-left', 0, 9)),
      text('title', '{titleText}', DISPLAY, 17, 800, 'red',
        at('container', 'top-left', 9, 7.8)),
      text('tongue', '{attr.tongue}', SANS, 10, 400, 'muted',
        at('container', 'top-right', 0, 10), { align: 'right' }),
    ] } } };

Die Überschrift trägt, was das Feld druckt: # Үлгү ырлар {tone="blue" author="Тоқтоғұл Сатылғанов" when="1864–1933" tongue="қырғызша"}. panel-{attr.tone} benennt die Zeichnung, so dient eine Gestaltung vier Farben, und derselbe author steht im Inhalt und im Fuß. numberingTemplate: '{1:I}' schreibt die römische Ziffer. Ein zweites Stück desselben Dichters nimmt den Stil run-on, ohne Seitenumbruch und mit schmaler Bordüre.

#3 · Das Inhaltsverzeichnis auf dem Umschlag

script.js · Zeilen 88–106im vollständigen Code
const none = { numbered: false, toc: false, header: { elements: [] }, footer: { elements: [] } };
const RUG = 2 * (TRIM_W / 4); // mm: two rows of four tiles
const cover = { id: 'cover', ...none, marginBottom: pt(0), advancedDesign: { enabled: true,
  minHeight: mm(RUG - TOP + 41), slot: { elements: [
    image('rug', 'rug', { ...at('page', 'top-left'), size: { width: mm(TRIM_W) } }),
    text('title', '{titleText}', DISPLAY, 42, 800, 'red',
      at('page', 'top-left', INNER, RUG + 9)),
    text('subtitle', '{subtitle}', SANS, 13, 400, 'ink', at('#title', 'below', 0, 0.5)),
  ] } } };
const toc = {
  levels: [{ level: 1, fontFamily: DISPLAY, fontSize: pt(11), color: col('ink'),
    numberFontWeight: 700, numberColor: col('red'), numberWidth: mm(8), numberGap: mm(2),
    marginBottom: pt(2.5) }],
  pageNumber: { fontFamily: SANS, fontSize: pt(10), fontWeight: 700, color: col('red'),
    width: mm(5) },
  leader: { char: '. ', gap: mm(2) },
  subtitle: { enabled: true, attr: 'author', italic: false, fontFamily: SANS, fontSize: pt(9),
    color: col('muted') },
};

Die Umschlagüberschrift hält mit minHeight Platz für Teppich und Titel, und :::toc folgt im Fluss. toc.subtitle druckt den author jeder Überschrift darunter. Der Umschlag selbst ist weder nummeriert noch gelistet.

#4 · Widderhörner aus Halbkreisen

script.js · Zeilen 110–144im vollständigen Code
// A pair of horns is two half circles a side, radius 10 and then 6, on a stem; four pairs round
// a diamond make the tile, and a row of pairs, one up and one down, the border. The width of
// the stroke leaves as much ground as wool, so either colour can be read as the figure.
const horn = (side, sweep) => `M50 20 A10 10 0 0 ${sweep} ${50 + side * 20} 20 `
  + `A6 6 0 0 ${sweep} ${50 + side * 8} 20`;
const pair = `M50 40 V20 ${horn(-1, 0)} ${horn(1, 1)}`;
const horns = (colour, turn, w = 5.6) => `<path d="${pair}" transform="${turn}" fill="none" `
  + `stroke="${colour}" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round"/>`;
const shape = (d, colour, turn = '') => `<path d="${d}" fill="${colour}" transform="${turn}"/>`;
const tile = (x, y, ground, wool, spark) => `<g transform="translate(${x} ${y})">`
  + shape('M0 0H100V100H0Z', ground)
  + [0, 90, 180, 270].map((a) => horns(wool, `rotate(${a} 50 50)`)
    + shape('M0 0H17L0 17Z', spark, `rotate(${a} 50 50)`)).join('')
  + shape('M50 35L65 50L50 65L35 50Z', wool) + shape('M50 43L57 50L50 57L43 50Z', spark)
  + '</g>';
const UNIT = 50; // a pair of horns and its gap, in the border's units
const border = (n, colour, y) => Array.from({ length: n }, (_, i) => horns(colour, i % 2
  ? `translate(${i * UNIT - 25} ${y + 43}) scale(1 -1)`
  : `translate(${i * UNIT - 25} ${y - 3})`)).join('');
const teeth = (n, step, y, h, colour) => shape(Array.from({ length: n }, (_, i) =>
  `M${i * step} ${y}h${step}l${-step / 2} ${h}Z`).join(''), colour);
const svg = (w, h, body) => ({ width: w, height: h, markup: `<svg xmlns="http://www.w3.org/2000/`
  + `svg" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}">${body}</svg>` });
const { cream, gold } = palette;
const panel = (tone) => svg(600, 231.7, // the trim's width, 12 pairs of horns
  shape('M0 0H600V231.7H0Z', palette[tone]) + border(12, cream, 174)
  + shape('M0 160H600V163H0Z', cream) + teeth(48, 12.5, 222.7, 9, gold));
const rug = ['red', 'blue', 'green', 'ochre', 'blue', 'ochre', 'red', 'green'];
const ART = {
  rug: svg(400, 200, rug.map((tone, i) => tile((i % 4) * 100, Math.floor(i / 4) * 100,
    palette[tone], cream, gold)).join('')),
  strip: svg(1000, 60, shape('M0 0H1000V60H0Z', palette.red) + border(20, cream, 10)),
  ...Object.fromEntries(['red', 'blue', 'green', 'ochre']
    .map((tone) => [`panel-${tone}`, panel(tone)])),
};

Ein Horn besteht aus zwei Halbkreisen, Radius 10 und dann 6, an einem gemeinsamen Stiel. Vier Paare, um eine Raute gedreht, ergeben die Kachel; eine Reihe von Paaren, eines oben, eines unten, die Bordüre. Strich und Zwischenraum sind fast gleich breit, wie beim Schyrdak, wo jeder Filz zum anderen passt.

Das ganze Rezept

Sandbox
// ═══ Postext Cookbook · Nº 210 · A Kazakh anthology of six languages of the steppe ═══
// https://postext.dev/en/cookbook/abai-kazakh-anthology
// Code: MIT · Text: Abai, Toktogul, Tukay, Akmulla, Natsagdorj, Rudaki (PD) · Ornament: code
// Fonts: Alegreya, Alegreya Sans, Piazzolla (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 colophon ('en' | 'es' | 'ru')
const RECIPE = 'abai-kazakh-anthology';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// The dyed felts of a shyrdak, the mosaic rug of the yurt: madder, indigo, pine and bark, all
// cut against undyed wool.
const palette = {
  ink: '#2a1d17', // text, brown-black wool
  red: '#9c2a26', // madder: Abai, Rudaki, the note marks
  blue: '#1f4e79', // indigo: Toktogul, Natsagdorj
  green: '#2f5d3a', // pine: Tukay
  ochre: '#8a5010', // bark: Akmulla
  gold: '#dba544', // the small triangles and diamonds
  cream: '#f5ecda', // the paper and the undyed wool
  muted: '#6b5647', // languages, dates, notes
};
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = Object.entries({ ...palette, 'main-color': palette.red })
  .map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } }));
// All three hold ә ғ қ ң ө ұ ү һ, ҙ ҫ ҡ and ҷ ҳ ӣ ӯ in their cyrillic-ext files.
const [TEXT, SANS, DISPLAY] = ['Alegreya', 'Alegreya Sans', 'Piazzolla'];
const [BODY, LEAD] = [11, 14.5]; // pt
const [TRIM_W, TRIM_H, TOP, INNER, OUTER] = [145, 215, 22, 21, 19]; // mm: 60 × 90/16
const at = (to, edge, x = 0, y = 0) => ({ anchor: { to, edge }, offset: { x: mm(x), y: mm(y) } });
const text = (id, content, fontFamily, size, fontWeight, color, placement, extra = {}) => ({
  kind: 'text', id, content, fontFamily, fontSize: pt(size), fontWeight, color: col(color),
  align: 'left', lineHeight: 1.1, overflow: 'wrap', placement, ...extra });
const fill = { size: { width: 'fill' } };
const image = (id, resourceId, placement) => ({ kind: 'image', id, resourceId, placement });

// #region answer: a Kazakh document, with each poem named in its own language
// The book is Kazakh: its hyphenation, the ties (a dash opens no line, a number keeps its unit)
// and its notes, which start again on every page with an indent of 1.5 em.
const LOCALE = 'kk';
// A poem in another language is a :::verse block that names it: the poem is shaped by that
// language and tagged with it in the PDF and the HTML, :::verse{lang=ky}.
// ky Kyrgyz, tt Tatar, ba Bashkir, mn Mongolian, tg Tajik. Two spaces at the head of a line
// draw it in, as in the third and sixth lines of «Сегіз аяқ».
const verse = { align: 'center', hang: em(2), keepStanzas: 8 }; // bodyText.verse

Das zusammengesetzte script.js läuft unverändert: Fügen Sie es in das Modulskript einer beliebigen Seite ein, oder öffnen Sie das Rezept auf CodePen. Ordner des Rezepts auf GitHub ↗ (öffnet sich in einem neuen Tab)

Häufige Fehler

  • Prüfen Sie die Schrift Buchstabe für Buchstabe, bevor Sie sie wählen. Alegreya und Piazzolla haben ә ғ қ ң ө ұ ү һ ҙ ҫ ҡ ҳ ҷ ӣ ӯ; Literata, Spectral und Old Standard fehlen einige. Sie kommen aus den Dateien cyrillic-ext, die kitCyrillicFonts lädt.
  • Eine Überschrift ohne tone nennt keine Zeichnung, ihr Feld bleibt leer. Geben Sie jedem Gedicht eine der vier.

Nachweise

Text
Schriften
Alegreya (SIL OFL 1.1) · Alegreya Sans (SIL OFL 1.1) · Piazzolla (SIL OFL 1.1)
Sandbox