# 黒と蛍光ピンクで刷る音楽ジン

> 黒と蛍光ピンクの2版で刷る仕事です。写真はトーンカーブでダブルトーンにし、黒はオーバープリント、ピンクはFolioで紙より明るく光ります。

- HTML版: https://postext.dev/ja/cookbook/fluorescent-pink-zine
- レシピ No. 190 · 出力と組み込み · 難易度 3 (上級) · 出力: Canvas, PDF
- ジャンル: 雑誌とジン
- 必要なもの postext ≥ 1.84.0, postext-pdf ≥ 1.84.0 · テスト環境 1.84.0, postext-pdf 1.84.0 ／テスト日 2026-11-13
- ページ: [1](https://postext.dev/cookbook/fluorescent-pink-zine/en/p01.webp?v=716d2404), [2](https://postext.dev/cookbook/fluorescent-pink-zine/en/p02.webp?v=716d2404), [3](https://postext.dev/cookbook/fluorescent-pink-zine/en/p03.webp?v=716d2404), [4](https://postext.dev/cookbook/fluorescent-pink-zine/en/p04.webp?v=716d2404), [5](https://postext.dev/cookbook/fluorescent-pink-zine/en/p05.webp?v=716d2404), [6](https://postext.dev/cookbook/fluorescent-pink-zine/en/p06.webp?v=716d2404), [7](https://postext.dev/cookbook/fluorescent-pink-zine/en/p07.webp?v=716d2404), [8](https://postext.dev/cookbook/fluorescent-pink-zine/en/p08.webp?v=716d2404)
- PDF: https://postext.dev/cookbook/fluorescent-pink-zine/en/fluorescent-pink-zine.pdf?v=716d2404
- Sandboxで開く: https://postext.dev/ja/sandbox#recipe=fluorescent-pink-zine&lang=en (.postext: https://postext.dev/cookbook/fluorescent-pink-zine/en/fluorescent-pink-zine.postext)
- 最終更新: 2026-11-13
- 他の言語: [en](https://postext.dev/en/cookbook/fluorescent-pink-zine.md), [es](https://postext.dev/es/cookbook/fluorescent-pink-zine.md), [ca](https://postext.dev/ca/cookbook/fluorescent-pink-zine.md), [de](https://postext.dev/de/cookbook/fluorescent-pink-zine.md), [fr](https://postext.dev/fr/cookbook/fluorescent-pink-zine.md), [it](https://postext.dev/it/cookbook/fluorescent-pink-zine.md), [pt](https://postext.dev/pt/cookbook/fluorescent-pink-zine.md), [zh](https://postext.dev/zh/cookbook/fluorescent-pink-zine.md), [ar](https://postext.dev/ar/cookbook/fluorescent-pink-zine.md)

## かんたんな説明

黒と鮮やかな蛍光ピンクの2色のインキだけで刷った、小さな音楽雑誌です。写真は黒とピンクで刷られ、ピンクは3D表示で光り、印刷用のファイルの版はちょうど2枚です。

## できあがり

架空の音楽ジン『Pink Noise』の第7号です。A5で8ページの中綴じで、ドラムが2つある印刷機で刷ります。片方は黒、もう片方は蛍光ピンクを刷り、紙にはそれ以外何も載りません。ピンクは表紙のタイトル、インタビューの扉の帯、質問、プルクオート、裏表紙に使い、30 %の網点がライブ情報の囲みを埋めます。3枚の写真はグレーの原稿で、シャドウが黒、中間調がピンクのダブルトーンで刷られます。Folioはジンを暗いテーブルの上に開いて置き、ピンクが紙から浮き立ちます。

**このレシピが答える問い:**

- 黒と蛍光ピンクだけでジンを刷り、写真をダブルトーンにするにはどうしますか？

## 手短な答え

```js
// script.js, 行 20–32
// The pink is a spot ink; the ink table says it is fluorescent, as the printer will be told.
// The screen paints its hex, Folio makes it stand brighter than the paper, and the PDF puts it
// on a plate of its own. The ink table also takes the name the poster files gave it.
const PINK = { name: 'PANTONE 806 C', cmyk: { c: 0, m: 77, y: 0, k: 0 } };
const pink = (hex, tint) => ({ hex, model: 'spot', spot: { ...PINK, tint } });
// The job prints these two plates and nothing else. Pictures print as duotones: each
// plate takes the grey of a pixel through its curve, [tone, ink] in percent.
const CURVES = { Black: [[0, 0], [45, 8], [100, 92]], // the shadows
  'PANTONE 806 C': [[0, 0], [35, 45], [70, 80], [100, 60]] }; // the middle tones
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51',
  inks: [{ name: 'PANTONE 806 C', aliases: ['Fluo pink'], finish: { kind: 'fluorescent' } }],
  plates: { inks: ['Black', 'PANTONE 806 C'], images: ['Black', 'PANTONE 806 C'],
    curves: CURVES } };
```

## 材料

**学べること**

- [特殊インキ](https://postext.dev/ja/docs/special-inks-die-cuts.md#加工): 加工の種類を持つ特色です。メタリック、箔押し、蛍光、不透明白、ニスがあります。専用の版に出力され、キャンバスでは光沢や加工マップを表示でき、Folioでは光が当たります。
- [特色とインキ表](https://postext.dev/ja/docs/configuration-pdf-output.md#特色): モデルが 'spot' の色は、その濃度で専用の版に出力されます。インキ表は印刷所が呼ぶ名前で版に名前を付け、パレットやSVG、取り込んだファイルが同じインキに付けた別名をその版にまとめます。

**ほかに使うもの**

- [CMYKとグレースケールのPDF](https://postext.dev/ja/docs/configuration-fonts-colors-viewers.md#pdf生成設定)
- [3Dの本のビューアー（Folio）](https://postext.dev/ja/docs/configuration-html-folio-epub.md#3dの本postext-folio)
- [用紙、綴じ、机、照明（Folio）](https://postext.dev/ja/docs/configuration-fonts-colors-viewers.md#folioビューアー設定)
- [セマンティックカラーパレット](https://postext.dev/ja/docs/configuration-fonts-colors-viewers.md#カラーパレット)
- [表紙、扉、奥付](https://postext.dev/ja/docs/configuration-styles.md#見出しスタイル)
- [見出しスタイル](https://postext.dev/ja/docs/configuration-styles.md#見出しスタイル)
- [デザインした章扉](https://postext.dev/ja/docs/configuration-headings.md#幅と詳細デザイン)
- [ページデザインのテキスト・罫・ボックス](https://postext.dev/ja/docs/configuration-headers-footers.md#柱とノンブル)
- [ページデザインの画像](https://postext.dev/ja/docs/configuration-headers-footers.md#画像要素)
- [囲み](https://postext.dev/ja/docs/configuration-callouts.md#囲みスタイル)
- [リソースとしての図と表](https://postext.dev/ja/docs/document-format-resources.md#リソース)
- [PDFの書き出し](https://postext.dev/ja/docs/configuration-pdf-output.md#pdfの生成)
- [キャンバス上のページ](https://postext.dev/ja/docs/configuration-programmatic-usage.md#ページをビットマップに描画する)
- [囲みの中や本文中の段組み](https://postext.dev/ja/docs/document-format-directives.md#columns)
- [見出しの属性](https://postext.dev/ja/docs/document-format.md#見出しの属性)
- [その場に置く図](https://postext.dev/ja/docs/document-format-resources.md#ブロック埋め込み任意本文中への明示的な配置)
- [段抜きの章見出し帯](https://postext.dev/ja/docs/configuration-headings.md#幅と詳細デザイン)
- [用紙の色](https://postext.dev/ja/docs/configuration-page-layout.md#ページ)
- [PDFに埋め込むフォント](https://postext.dev/ja/docs/configuration-pdf-output.md#なぜフォントプロバイダーが必要か)
- [独自のリソースの種類](https://postext.dev/ja/docs/configuration-resources.md#リソースの種類)
- [節ごとの柱](https://postext.dev/ja/docs/configuration-styles.md#見出しスタイル)
- [段抜きの囲み](https://postext.dev/ja/docs/configuration-callouts.md#calloutコンテナー)
- [番号のない章](https://postext.dev/ja/docs/configuration-styles.md#見出しスタイル)

**設定の一覧**

- [`bodyText`](https://postext.dev/ja/docs/configuration-text.md#本文), [`calloutStyles`](https://postext.dev/ja/docs/configuration-callouts.md#囲みスタイル), [`captionStyle`](https://postext.dev/ja/docs/configuration-resources.md#キャプションスタイル), [`colorPalette`](https://postext.dev/ja/docs/configuration-fonts-colors-viewers.md#カラーパレット), [`folio`](https://postext.dev/ja/docs/configuration-html-folio-epub.md#外観), [`footer`](https://postext.dev/ja/docs/configuration-headers-footers.md#柱とノンブル), [`header`](https://postext.dev/ja/docs/configuration-headers-footers.md#柱とノンブル), [`headingStyles`](https://postext.dev/ja/docs/configuration-styles.md#見出しスタイル), [`headings`](https://postext.dev/ja/docs/configuration-headings.md#見出し), [`layout`](https://postext.dev/ja/docs/configuration-page-layout.md#レイアウト), [`locale`](https://postext.dev/ja/docs/configuration-language.md#ハイフネーション), [`page`](https://postext.dev/ja/docs/configuration-page-layout.md#ページ), [`print`](https://postext.dev/ja/docs/configuration-fonts-colors-viewers.md#印刷出力設定), [`resourceTypes`](https://postext.dev/ja/docs/configuration-resources.md#リソースの種類), [`unorderedLists`](https://postext.dev/ja/docs/configuration-lists-math.md#箇条書きリスト)

**API**

- [`buildDocumentWithFonts`](https://postext.dev/ja/docs/configuration-programmatic-usage.md#レイアウトの前にフォントを読み込む), [`createFolioFromDocument`](https://postext.dev/ja/docs/configuration-html-folio-epub.md#3dの本postext-folio), [`decompressWoff2`](https://postext.dev/ja/docs/configuration-pdf-output.md#ブラウザー向けフォントプロバイダーfontsource--woff2), [`registerResourceImage`](https://postext.dev/ja/docs/architecture.md#apiの概要), [`renderPageToCanvas`](https://postext.dev/ja/docs/configuration-programmatic-usage.md#ページをビットマップに描画する), [`renderToPdf`](https://postext.dev/ja/docs/configuration-pdf-output.md#pdfの生成)

**書体**

- Archivo Black (OFL-1.1), IBM Plex Sans (OFL-1.1), IBM Plex Mono (OFL-1.1)

## 作り方

### 1 · 版は2枚、ピンクは蛍光

コードは上の[手短な答え](https://postext.dev/ja/cookbook/fluorescent-pink-zine.md#手短な答え)にあります。`print.plates`はこの仕事で刷る版、`Black`と`PANTONE 806 C`を指定し、PDFにはその2つの分版だけができます（[2色刷り](https://postext.dev/ja/docs/configuration-pdf-output.md#特色)）。ピンクは特色です。その加工は、印刷所への発注書に書くのと同じようにインキ表に書き、これで蛍光インキになります。専用の版を持ち、Folioでは紙より明るく照らされます（[加工](https://postext.dev/ja/docs/special-inks-die-cuts.md#加工)）。`images`で写真を両方の版に載せ、`CURVES`でそれぞれの形を決めます。黒はシャドウだけ、ピンクは中間調に置いて暗部では弱め、ピンクが黒を濁らせないようにします。

### 2 · 画面でもダブルトーンを見せる

```js
// script.js, 行 280–305
// The PDF separates the grey original through CURVES. The screen would paint it grey, so the
// picture registered for the canvas and Folio is the same grey run through the same curves:
// the black over the pink, multiplied as inks lie on paper. The PDF still gets the original.
const ink = (curve, tone) => { // a curve read at a tone, both 0–1
  const i = curve.findIndex(([x]) => x / 100 >= tone);
  const [[x0, y0], [x1, y1]] = [curve[Math.max(0, i - 1)], curve[Math.max(0, i)]];
  return (x1 === x0 ? y1 : y0 + ((tone * 100 - x0) * (y1 - y0)) / (x1 - x0)) / 100;
};
const PINK_RGB = [0xff, 0x3e, 0xa5];
async function loadDuotone(fileId, url) {
  await loadImage(fileId, url); // the grey bytes, kept for the PDF
  const grey = await createImageBitmap(new Blob([imageBytes(fileId)]));
  const canvas = new OffscreenCanvas(grey.width, grey.height);
  const g = canvas.getContext('2d');
  g.drawImage(grey, 0, 0);
  const img = g.getImageData(0, 0, canvas.width, canvas.height);
  for (let i = 0; i < img.data.length; i += 4) {
    const tone = 1 - img.data[i] / 255;
    const [k, p] = [ink(CURVES.Black, tone), ink(CURVES['PANTONE 806 C'], tone)];
    for (let c = 0; c < 3; c++) {
      img.data[i + c] = 255 * (1 - k) * (1 - p * (1 - PINK_RGB[c] / 255));
    }
  }
  g.putImageData(img, 0, 0);
  registerResourceImage(fileId, canvas.transferToImageBitmap());
}
```

キャンバスとFolioは画像をファイルのとおりに描くので、グレーの写真は、刷り上がりがピンクと黒でも、画面ではグレーに見えてしまいます。このレシピは画面用に2枚目の画像を登録します。同じグレーを同じ`CURVES`で読み、紙の上でインキが重なるように黒をピンクに乗算したものです。PDFには引き続き`imageBytes`からグレーの原稿が渡り、PDFの側で分版します。

### 3 · ピンクに重ねる黒

```js
// script.js, 行 60–74
const BAND = 134; // mm from the top of the bleed to the black band
const cover = { ...bare, id: 'cover', advancedDesign: { enabled: true, minHeight: mm(150),
  slot: { elements: [
    { kind: 'image', id: 'photo', resourceId: 'crowd', fit: 'cover', focus: { x: 0.35, y: 0.5 },
      placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: mm(BAND + 4) }) },
    { kind: 'box', id: 'band', style: { backgroundColor: col('black') },
      placement: at('bleed', 'top-left', 0, BAND + 3, { width: 'fill', height: mm(90) }) },
    text('issue', '{attr.issue}', label(8, col('pink')), at('page', 'top-left', 12, 12)),
    text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(70), lineHeight: 0.82,
      textTransform: 'uppercase', color: col('pink') },
    at('page', 'top-left', 10, BAND + 9, { width: mm(130) })),
    text('lines', '{attr.lines}', { fontFamily: SANS, fontWeight: 700, fontSize: pt(11),
      lineHeight: 1.25, color: col('paper') }, at('page', 'top-left', 12, BAND + 55,
      { width: mm(110) })),
  ] } } };
```

黒はK版だけを使うCMYKの色として、`overprint: true`付きで定義します。黒の文字や表紙の黒い帯がピンクと重なるところでは、ピンクをノックアウトせずにその上に刷られるので、少し見当がずれた紙でも白いすき間が出ません。ピンクのタイトルは逆に黒をノックアウトします。暗い帯に載る文字はそうあるべきです。

### 4 · 暗いテーブルの上のFolio

```js
// script.js, 行 119–125
const folio = {
  tilt: 22, yaw: -14,
  paper: { type: 'uncoated', grammage: 100, shade: '#ffffff' },
  binding: { type: 'saddleStitch', cover: 'pages' },
  surface: { type: 'plain', color: { hex: '#2b2b30', model: 'hex' } },
  lighting: { environment: 'overcast', intensity: 1.05 },
};
```

蛍光インキは、まわりに少し暗さがあって初めて蛍光らしく見えます。ジンはインタビューのページで開いたまま無地の暗い面に置かれ、曇り空のフラットな光を受けて、ピンクの帯と写真の中のピンクが白い紙から浮き立ちます。

## レシピの全体

レシピのフォルダーから合成した1つのファイルで、サンプルのテキストとレシピ集の共通キットを埋め込んであり、自分でページを組み立てます。動かすには、空のページの`<script type="module">`に入れるか、新しいCodePenのpenのJSパネルに貼り付けます（モジュールとして）。esm.shからpostextを読み込むので、インストールもビルドも要りません。

- レシピのフォルダー: https://github.com/drnachio/postext/tree/main/cookbook/fluorescent-pink-zine

### script.js

```js
// ═══ Postext Cookbook · Nº 190 · A zine in black and fluorescent pink ════════════════════
// https://postext.dev/en/cookbook/fluorescent-pink-zine
// Code: MIT · Text: original (CC BY 4.0) · Photographs: diffusion models
// Fonts: Archivo Black, IBM Plex Sans, IBM Plex Mono (SIL OFL 1.1) · Needs postext ≥ 1.84.0
//
// A music zine printed on two plates, black and a fluorescent pink. The pink is a spot ink
// with a fluorescent finish; the job prints those two plates and nothing else, so the grey
// photographs print as duotones and every other colour is projected onto the two inks.
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 = 'fluorescent-pink-zine';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region answer: two plates: black and a fluorescent pink that glows
// The pink is a spot ink; the ink table says it is fluorescent, as the printer will be told.
// The screen paints its hex, Folio makes it stand brighter than the paper, and the PDF puts it
// on a plate of its own. The ink table also takes the name the poster files gave it.
const PINK = { name: 'PANTONE 806 C', cmyk: { c: 0, m: 77, y: 0, k: 0 } };
const pink = (hex, tint) => ({ hex, model: 'spot', spot: { ...PINK, tint } });
// The job prints these two plates and nothing else. Pictures print as duotones: each
// plate takes the grey of a pixel through its curve, [tone, ink] in percent.
const CURVES = { Black: [[0, 0], [45, 8], [100, 92]], // the shadows
  'PANTONE 806 C': [[0, 0], [35, 45], [70, 80], [100, 60]] }; // the middle tones
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra51',
  inks: [{ name: 'PANTONE 806 C', aliases: ['Fluo pink'], finish: { kind: 'fluorescent' } }],
  plates: { inks: ['Black', 'PANTONE 806 C'], images: ['Black', 'PANTONE 806 C'],
    curves: CURVES } };
// #endregion
// Black is the K plate alone, and it overprints: on the pink it prints over the ink instead of
// knocking a hole that a sheet out of register would show as a white rim.
const palette = {
  black: { hex: '#1b1a1d', model: 'cmyk', cmyk: { c: 0, m: 0, y: 0, k: 100 }, overprint: true },
  pink: pink('#ff3ea5'),
  pink30: pink('#ffc5e4', 30),
  paper: { hex: '#ffffff', model: 'hex' },
};
const col = (id) => ({ ...palette[id], paletteId: id });
const colorPalette = [...Object.entries(palette).map(([id, value]) => ({ id, name: id, value })),
  { id: 'main-color', name: 'pink (defaults)', value: palette.pink }];

const [TRIM_W, TRIM_H] = [148, 210]; // A5, an A4 sheet folded once
const MARGIN = { top: 16, bottom: 18, inner: 14, outer: 12 };
const LEAD = 12.4; // pt
const [DISPLAY, SANS, MONO] = ['Archivo Black', 'IBM Plex Sans', 'IBM Plex Mono'];
const at = (to, edge, x = 0, y = 0, size) => ({ anchor: { to, edge },
  offset: { x: mm(x), y: mm(y) }, ...(size && { size }) });
const text = (id, content, look, placement) => ({ kind: 'text', id, content, align: 'left',
  overflow: 'wrap', placement, ...look });
const label = (size, color) => ({ fontFamily: MONO, fontWeight: 500, fontSize: pt(size),
  letterSpacing: pt(size * 0.12), textTransform: 'uppercase', color });
const bare = { numbered: false, toc: false, span: 'page', header: { elements: [] },
  footer: { elements: [] } };

// #region cover: the crowd over a black band, the title in pink on the black
const BAND = 134; // mm from the top of the bleed to the black band
const cover = { ...bare, id: 'cover', advancedDesign: { enabled: true, minHeight: mm(150),
  slot: { elements: [
    { kind: 'image', id: 'photo', resourceId: 'crowd', fit: 'cover', focus: { x: 0.35, y: 0.5 },
      placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: mm(BAND + 4) }) },
    { kind: 'box', id: 'band', style: { backgroundColor: col('black') },
      placement: at('bleed', 'top-left', 0, BAND + 3, { width: 'fill', height: mm(90) }) },
    text('issue', '{attr.issue}', label(8, col('pink')), at('page', 'top-left', 12, 12)),
    text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(70), lineHeight: 0.82,
      textTransform: 'uppercase', color: col('pink') },
    at('page', 'top-left', 10, BAND + 9, { width: mm(130) })),
    text('lines', '{attr.lines}', { fontFamily: SANS, fontWeight: 700, fontSize: pt(11),
      lineHeight: 1.25, color: col('paper') }, at('page', 'top-left', 12, BAND + 55,
      { width: mm(110) })),
  ] } } };
// #endregion

// #region feature: a photograph to the head of the page, the title in black on a pink band
const feature = { ...bare, id: 'feature', span: 'page', advancedDesign: { enabled: true,
  minHeight: mm(128), slot: { elements: [
    { kind: 'image', id: 'photo', resourceId: '{attr.photo}', fit: 'cover',
      placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: mm(96) }) },
    { kind: 'box', id: 'band', style: { backgroundColor: col('pink') },
      placement: at('bleed', 'top-left', 0, 93, { width: 'fill', height: mm(36) }) },
    text('kicker', '{attr.kicker}', label(7.5, col('black')), at('page', 'top-left', 12, 98)),
    text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(21), lineHeight: 1,
      textTransform: 'uppercase', color: col('black') },
    at('#kicker', 'below', 0, 2, { width: mm(124) })),
  ] } } };
// #endregion

// An ordinary section: a pink kicker over a black title.
const opener = { enabled: true, minHeight: mm(26), slot: { elements: [
  text('kicker', '{attr.kicker}', label(7.5, col('pink')), at('container', 'top-left')),
  text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(22), lineHeight: 1,
    textTransform: 'uppercase', color: col('black') },
  at('#kicker', 'below', 0, 1.5, { width: mm(122) })),
] } };

// The back cover: a pink flood to the bleed, the colophon over it in black.
const back = { ...bare, id: 'back', breakBefore: { enabled: true, parity: 'even' },
  advancedDesign: { enabled: true, minHeight: mm(150), slot: { elements: [
    { kind: 'box', id: 'flood', style: { backgroundColor: col('pink') },
      placement: at('bleed', 'top-left', 0, 0, { width: 'fill', height: 'fill' }) },
    text('title', '{titleText}', { fontFamily: DISPLAY, fontSize: pt(40), lineHeight: 0.85,
      textTransform: 'uppercase', color: col('black') }, at('page', 'top-left', 12, 120,
      { width: mm(120) })),
    text('colophon', '{attr.colophon}', { fontFamily: SANS, fontSize: pt(8), lineHeight: 1.35,
      color: col('black') }, at('#title', 'below', 0, 6, { width: mm(100) })),
  ] } } };

const footer = { elements: [
  text('folio', '{pageNumber}  ·  {title}', { ...label(6.5, col('black')), parity: 'even' },
    at('page', 'bottom-left', MARGIN.outer, -10)),
  text('folio-r', '{chapterTitle}  ·  {pageNumber}', { ...label(6.5, col('black')),
    parity: 'odd', align: 'right' }, at('page', 'bottom-right', -MARGIN.outer, -10)),
] };

// #region folio: a saddle-stitched zine on a dark table under a dim, flat light
const folio = {
  tilt: 22, yaw: -14,
  paper: { type: 'uncoated', grammage: 100, shade: '#ffffff' },
  binding: { type: 'saddleStitch', cover: 'pages' },
  surface: { type: 'plain', color: { hex: '#2b2b30', model: 'hex' } },
  lighting: { environment: 'overcast', intensity: 1.05 },
};
// #endregion

const config = () => ({
  locale: t({ en: 'en-gb', es: 'es' }),
  colorPalette,
  page: { sizePreset: 'custom', width: mm(TRIM_W), height: mm(TRIM_H), dpi: 150,
    backgroundColor: col('paper'), margins: { top: mm(MARGIN.top), bottom: mm(MARGIN.bottom),
      left: mm(MARGIN.inner), right: mm(MARGIN.outer), mirror: true } },
  layout: { layoutType: 'double', gutterWidth: mm(5) },
  bodyText: { fontFamily: SANS, fontSize: pt(8.8), lineHeight: pt(LEAD), color: col('black'),
    boldColor: col('black'), italicColor: col('black'), referenceColor: col('black'),
    textAlign: 'left', firstLineIndent: mm(3), indentAfterHeading: false,
    hyphenation: { enabled: true }, avoidWidows: true, avoidOrphans: true },
  headings: { fontFamily: SANS, fontWeight: 700, color: col('black'), levels: [
    { level: 1, span: 'page', breakBefore: { enabled: true, parity: 'any' },
      advancedDesign: opener },
    { level: 2, fontSize: pt(8.8), lineHeight: pt(LEAD), color: col('pink'),
      marginTop: pt(LEAD), marginBottom: pt(0) }] },
  headingStyles: [cover, feature, back],
  calloutStyles: [{ id: 'quote', background: col('pink'), marginTop: pt(LEAD),
    marginBottom: pt(LEAD), padding: { top: mm(3), right: mm(3), bottom: mm(3), left: mm(3) },
    body: { fontFamily: DISPLAY, fontSize: pt(13), lineHeight: pt(15), color: col('black'),
      textTransform: 'uppercase', textAlign: 'left', firstLineIndent: pt(0) } },
  { id: 'gigs', background: col('pink30'), columnGap: mm(4), marginTop: pt(LEAD),
    marginBottom: pt(LEAD),
    padding: { top: mm(5), right: mm(4), bottom: mm(5), left: mm(4) },
    body: { fontFamily: SANS, fontSize: pt(9.6), lineHeight: pt(14), color: col('black'),
      boldColor: col('black'), textAlign: 'left', firstLineIndent: pt(0) } }],
  unorderedLists: { bulletChar: '+', color: col('pink'), marginTop: pt(0), marginBottom: pt(0) },
  captionStyle: { fontFamily: MONO, fontSize: pt(6.5), color: col('black'), gap: mm(1.5) },
  print: PRINT,
  header: { elements: [] }, footer, folio,
});

// ─── 2 · Content ────────────────────────────────────────────────────────────
const markdown = String.raw`---
title: "Pink Noise"
author: "Pink Noise"
---

# Pink Noise {style="cover" issue="Nº 7 · Spring 2026 · Free" lines="Lena Ros of Hollín on three chords and a borrowed amp · The poster wall behind the Lavadero · Every gig until June"}

# Hello again {kicker="Editorial"}

Seven issues in, and this is the first one printed in two colours. The copy shop on Calle Ancha bought a second-hand press with two drums in January, and the owner said she would run us off a test at cost if we promised not to ask for gold. So: black, and a pink that looks like a highlighter left in the sun. Under a bar’s lights it glows. Hold it up and see.

The scene had a strange winter. The Lavadero lost its licence for six weeks over the noise, two bands split, and three new ones played their first gigs in a garage on the industrial estate because there was nowhere else. Then the licence came back, the garage stayed open on Sundays, and March was the busiest month we have counted since we started counting.

This issue is about the people who kept it going. Lena Ros of Hollín talks about learning to play on a guitar with five strings and an amp borrowed from her uncle. We walked the alley behind the Lavadero, where every poster since 2019 is still on the wall under the newer ones. And the listings run to June, the longest we have printed.

As always, the zine is free, it is made by four people on a kitchen table, and anyone can send us a review, a photo or a complaint. The address is on the back.

## In this issue

- Three chords and a borrowed amp: an interview with Lena Ros
- The wall: seven years of posters behind the Lavadero
- Every gig until June

# Three chords and a borrowed amp {style="feature" photo="guitarist" kicker="Interview · Lena Ros, Hollín"}

Hollín have played eleven gigs, released one cassette and sold out of it twice. Their guitarist and singer, Lena Ros, is nineteen. We met her in the café opposite the Lavadero on a wet Tuesday.

## How did Hollín start?

With a guitar that had five strings. It was my uncle’s, and he lent me his amp too, as long as I gave it back when I had my own. I still have it. I learnt three chords from a video and wrote a song with them the same night. It was terrible. The second one was less terrible.

## Who else is in the band?

Iker on drums, who I met at school because he drummed on every desk, and Sara on bass, who answered a note I left in the record shop. Her note back said she had a bass but had never played it. That was fine. Neither had I, really.

:::callout{type="quote"}
We were bad for a year, and nobody minded. That is what a scene is for.
:::

## What was the first gig like?

Twelve minutes long. We played six songs, two of them twice because we forgot we had already played them. There were maybe thirty people and they were all our friends, so they shouted for more, and we did not have any more. We played the first one again.

## Why cassettes?

Because a cassette costs us one euro to make and people keep it. Nobody keeps a link. We recorded it in Sara’s grandmother’s living room on a Sunday when she was at her sister’s, with blankets on the windows. You can hear the clock on track three.

## What does the scene need?

Somewhere to play on a Wednesday, for bands who are not good yet. Everything is on Fridays now, and on a Friday you have to sell tickets. We were bad for a year, and the Lavadero let us play anyway, and nobody minded. That is what a scene is for: being bad in front of people until you are not.

## What next?

A second cassette in May, and a gig in another town, which would be our first. We do not know which town yet. Any town that has a bus back.

# The wall {kicker="Scene"}

::resource{id="posters"}

Behind the Lavadero there is an alley with no name on the map. Everyone calls it the wall. Since the venue opened in 2019, every band that played there has put a poster up on the bricks between the back door and the bins, and nobody has ever taken one down.

So the wall is a record. Under the posters for this spring’s gigs are the ones from last autumn, and under those the ones from the year before, back to the first: a photocopied sheet for a band called Lunes that played to nineteen people on a Monday in October 2019. A corner of it still shows near the drainpipe, if you know where to look.

The paste is flour and water, cooked on the venue’s stove. The posters are mostly photocopies, a few are screen prints, and one, for a gig that never happened, was painted straight on the wall in 2022 and has been pasted over eleven times since. In the rain the top layers peel and the old names come back for a week.

The owners have been asked twice by the council to clean it. Twice they have said they would think about it. We hope they keep thinking.

# Every gig until June {kicker="Listings"}

:::callout{type="gigs" span="page"}
:::columns{count=3 breaks="6,11"}
**April**

- **Fri 3** · Hollín, Ciervo · the Lavadero, 21:00, 6 €
- **Sat 11** · Las Bajas, Polvo Fino · Garaje 4, 20:00, free
- **Wed 15** · Open stage, any band · the Lavadero, 20:30, free
- **Fri 24** · Marea Roja, Lunes (reunion) · the Lavadero, 21:00, 8 €

**May**

- **Sat 2** · Cassette night: Hollín launch · Sala Norte, 21:00, 7 €
- **Sun 10** · Matinee: three new bands · Garaje 4, 18:00, free
- **Wed 20** · Open stage · the Lavadero, 20:30, free
- **Fri 29** · Polvo Fino, Los Grillos · the Lavadero, 21:00, 6 €

**June**

- **Fri 5** · Summer fair: eight bands on the river bank · Paseo del Río, 17:00, free
- **Wed 17** · Open stage · the Lavadero, 20:30, free
- **Sat 27** · Pink Noise party, issue 8 out · the Lavadero, 21:00, 5 €
:::
:::

Wednesday open stages are new this spring, and they are what Lena asked for. Any band can play three songs; sign up at the bar before nine. Bring your own leads.

Listings are free. Send us the date, the bands, the place, the time and the price by the first of the month, and we will print them if there is room. There is always room.

# Heard this spring {kicker="Reviews"}

## Hollín, *Cinta uno* (cassette, self-released)

Eight songs in nineteen minutes, recorded in a living room with blankets on the windows, and it sounds like it, in the best way. Lena Ros sings as if the microphone had been switched off and she wanted to be heard anyway. “Cinco cuerdas” is the one everybody shouts along to at gigs; “Reloj” is the quiet one, and you can hear the clock. Sold out twice. A third run is promised for May.

## Polvo Fino, live at Garaje 4, 8 March

The garage holds sixty if nobody brings a bike. Polvo Fino played to about eighty, with the door open onto the car park and the drummer’s brother holding the cymbal stand up for the last three songs. New songs, slower and longer than last year’s, and better for it. The bass player has started to sing, and should keep going.

## Marea Roja, *Lejos* (seven-inch single)

The first record on vinyl from anyone in town for years, pressed in an edition of 150 in pink, of course. The A side is the song they close with; the B side is a cover of a song nobody could name, and the sleeve does not say. It was gone in a weekend. Ask at the record shop: they kept five back.

## Open stage at the Lavadero, 18 March

The first Wednesday open stage, and nine bands signed up. Three of them had never played anywhere. One played the same song three times, and nobody minded.

# Pink Noise {style="back" colophon="Pink Noise is made by four people on a kitchen table and printed in black and fluorescent pink on a two-drum press at the copy shop on Calle Ancha. Free, issue 7, spring 2026. Write to hola@pinknoise.example. Pink Noise, the Lavadero and every band and person in it are fictional. Photographs generated with diffusion models."}
`; // content.<lang>.md, inlined by the Cookbook

// #region duotone: the screen shows each photograph as the two plates will print it
// The PDF separates the grey original through CURVES. The screen would paint it grey, so the
// picture registered for the canvas and Folio is the same grey run through the same curves:
// the black over the pink, multiplied as inks lie on paper. The PDF still gets the original.
const ink = (curve, tone) => { // a curve read at a tone, both 0–1
  const i = curve.findIndex(([x]) => x / 100 >= tone);
  const [[x0, y0], [x1, y1]] = [curve[Math.max(0, i - 1)], curve[Math.max(0, i)]];
  return (x1 === x0 ? y1 : y0 + ((tone * 100 - x0) * (y1 - y0)) / (x1 - x0)) / 100;
};
const PINK_RGB = [0xff, 0x3e, 0xa5];
async function loadDuotone(fileId, url) {
  await loadImage(fileId, url); // the grey bytes, kept for the PDF
  const grey = await createImageBitmap(new Blob([imageBytes(fileId)]));
  const canvas = new OffscreenCanvas(grey.width, grey.height);
  const g = canvas.getContext('2d');
  g.drawImage(grey, 0, 0);
  const img = g.getImageData(0, 0, canvas.width, canvas.height);
  for (let i = 0; i < img.data.length; i += 4) {
    const tone = 1 - img.data[i] / 255;
    const [k, p] = [ink(CURVES.Black, tone), ink(CURVES['PANTONE 806 C'], tone)];
    for (let c = 0; c < 3; c++) {
      img.data[i + c] = 255 * (1 - k) * (1 - p * (1 - PINK_RGB[c] / 255));
    }
  }
  g.putImageData(img, 0, 0);
  registerResourceImage(fileId, canvas.transferToImageBitmap());
}
// #endregion

const photo = (id, [w, h], altText, extra) => ({ id, typeId: 'photo', kind: 'bitmap',
  createdAt: 0, updatedAt: 0, bitmap: { fileId: `${id}.jpg`, format: 'jpeg', width: w,
    height: h }, altText, ...extra });
const resourceTypes = [{ id: 'photo', name: '', captionPrefix: '', numberingTemplate: '' }];
const resources = [
  photo('crowd', [900, 600], t({ en: 'A crowd with raised arms in front of a singer in a low '
    + 'basement.', es: 'Un público con los brazos en alto ante un cantante en un sótano bajo.' })),
  photo('guitarist', [600, 750], t({ en: 'A young guitarist on a small stage under fairy '
    + 'lights.', es: 'Un guitarrista joven en un escenario pequeño bajo unas luces.' })),
  photo('posters', [560, 700], t({ en: 'A wet alley at night, its brick wall layered with torn '
    + 'posters.', es: 'Un callejón mojado de noche, con la pared cubierta de carteles rotos.' }),
  { placement: { position: 'top' }, caption: t({ en: 'The wall behind the Lavadero, March.',
    es: 'La pared de detrás del Lavadero, en marzo.' }) }),
];
await Promise.all([loadDuotone('crowd.jpg', asset('crowd-900.jpg')),
  loadDuotone('guitarist.jpg', asset('guitarist-600.jpg')),
  loadDuotone('posters.jpg', asset('posters-560.jpg'))]);

// ─── 3 · Fonts ──────────────────────────────────────────────────────────────
const FONTS = { 'Archivo Black': ['400'], 'IBM Plex Sans': ['400', '400i', '700'],
  'IBM Plex Mono': ['500'] };

// ─── 4 · Build & show ───────────────────────────────────────────────────────
const doc = await buildDocumentWithFonts({ markdown, resources }, { ...config(), resourceTypes },
  kitFonts(FONTS));
showPages(doc, { title: t({ en: 'Pink Noise · a zine in black and fluorescent pink',
  es: 'Pink Noise · un fanzine en negro y rosa flúor' }) });
offerPdf(() => renderToPdf(doc, { fontProvider: fontsourceProvider, resourceBytes: imageBytes,
  profileBaseUrl: 'https://postext.dev/icc/' }), `${RECIPE}.pdf`);

// The zine in the hand, under a dim light where the pink stands out from the paper.
const stage = document.createElement('section');
stage.id = 'folio';
stage.ariaLabel = t({ en: 'The zine in 3D', es: 'El fanzine en 3D' });
stage.style.cssText = 'height: min(78vh, 720px); margin: 0 auto; max-width: 1280px';
document.getElementById('pages').before(stage);
createFolioFromDocument(stage, doc, { at: 2, // open at the interview
  appearance: { textureBaseUrl: 'https://postext.dev/folio/textures' } });

// ─── Kit ── helpers shared by every Cookbook recipe · postext.dev/cookbook ─────

// ─── Kit · core v1 ── the same in every recipe · postext.dev/cookbook
function mm(value) { return { value, unit: 'mm' }; }
function pt(value) { return { value, unit: 'pt' }; }
function em(value) { return { value, unit: 'em' }; }
/** The sample language's string: t({ en: 'Figure', es: 'Figura' }). */
function t(strings) { return strings[LANG] ?? Object.values(strings)[0]; }
/** A file in this recipe's assets folder, served from the Postext repo by jsDelivr. */
function asset(file) { return `https://cdn.jsdelivr.net/gh/drnachio/postext@main/cookbook/${RECIPE}/assets/${file}`; }

// ─── Kit · fonts v3 ── the same in every recipe · postext.dev/cookbook
// Postext loads the faces a config asks for before layout and asks the kit
// for Fontsource's files, the ones the PDF embeds too.

/** buildDocumentWithFonts' options: the resolver, and FONTS' faces loaded
 *  with the config's. FONTS = { 'Family Name': ['400', '400i', '700'] }. */
function kitFonts(FONTS = {}) {
  const faces = Object.entries(FONTS).flatMap(([family, specs]) => specs.map((spec) =>
    ({ family, weight: parseInt(spec, 10), style: spec.endsWith('i') ? 'italic' : 'normal' })));
  return { resolve: fontsourceResolver, faces };
}

/** A face's files with their ranges: latin, then latin-ext and greek when
 *  `text` needs them (kitSubsetsFor). Null for a face Fontsource lacks. */
async function fontsourceResolver(family, weight, style, { text = '' } = {}) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  if (meta && !(await fontsourceWeights(family, style)).includes(weight)) return null;
  kitStatus('Loading fonts…');
  const at = await fontsourceAt(id);
  return ['latin', ...kitSubsetsFor(text, meta)].map((subset) => ({
    source: `${at}files/${id}-${subset}-${weight}-${style}.woff2`,
    unicodeRange: kitRanges()[subset],
  }));
}

/** Each file's unicode-range (a function: the kit runs after the pen's code). */
function kitRanges() {
  return {
    latin: 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,'
      + 'U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD',
    'latin-ext': 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,'
      + 'U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF',
    greek: 'U+0370-03FF',
  };
}

/** For the cjk, arabic and comics blocks: loads `faces` (as FONTS) for the
 *  sample `text`; `optional` skips a face Fontsource lacks. Files are added in
 *  the order asked, the last winning a shared character. Resolves to the count. */
async function loadFonts(faces, text = '', { optional = false } = {}) {
  kitStatus('Loading fonts…');
  const ranges = kitRanges();
  const jobs = [];
  for (const [family, specs] of Object.entries(faces)) {
    const id = fontsourceId(family);
    const todo = [...new Set(specs)].map((spec) => [parseInt(spec, 10), spec.endsWith('i') ? 'italic' : 'normal'])
      .filter(([weight, style]) => !hasFace(family, weight, style)); // before any await
    const at = fontsourceAt(id);
    const meta = optional || /[^\0-ÿ]/u.test(text) ? await fontsourceMeta(family) : null;
    const subsets = ['latin', ...kitSubsetsFor(text, meta)];
    for (const [weight, style] of todo) {
      if (optional && !(meta && (await fontsourceWeights(family, style)).includes(weight))) continue;
      for (const subset of subsets) {
        const url = `${await at}files/${id}-${subset}-${weight}-${style}.woff2`;
        const face = new FontFace(family, `url(${url}) format('woff2')`,
          { weight: String(weight), style, unicodeRange: ranges[subset] });
        jobs.push(face.load().catch(() => {
          if (subset === 'latin' && !optional) throw new Error(`Fontsource has no ${family} ${weight} ${style}`);
        }));
      }
    }
  }
  const ready = await Promise.all(jobs).catch((error) => { kitFail(error); throw error; });
  return ready.filter((face) => face && document.fonts.add(face)).length;
}

/** A loaded FontFace covers this face (fonts.check() says yes to any family). */
function hasFace(family, weight, style) {
  for (const face of document.fonts) {
    if (face.status !== 'loaded' || face.style !== style) continue;
    if (face.family.replace(/^["']|["']$/g, '') !== family) continue;
    const [low, high = low] = face.weight.split(' ').map(Number);
    if (weight >= low && weight <= high) return true;
  }
  return false;
}

/** The files beyond latin `text` needs that `meta`'s family ships. */
function kitSubsetsFor(text, meta) {
  return [[/[Ā-˿ᴀ-ᶿḀ-ỿ†ℓⱠ-Ɀ꜠-ꟿ]/u, 'latin-ext'], [/[Ͱ-Ͽ]/u, 'greek']]
    .filter(([re, x]) => re.test(text) && meta?.subsets?.includes(x)).map(([, x]) => x);
}

/** Fontsource's id for a family: 'Source Serif 4' → 'source-serif-4'. */
function fontsourceId(family) { return family.toLowerCase().replace(/\s+/g, '-'); }

/** A package's folder at the one version @5 names now (#766). */
function fontsourceAt(id, u = `https://cdn.jsdelivr.net/npm/@fontsource/${id}@`) {
  return (fontsourceAt.c ??= {})[id] ??= fetch(u + '5/package.json').then((r) => r.json())
    .then((p) => p.version || 5, () => 5).then((v) => `${u}${v}/`);
}

/** The family's Fontsource metadata (weights, styles, subsets), or null. */
function fontsourceMeta(family, id = fontsourceId(family)) {
  return (fontsourceMeta.c ??= {})[id] ??= fetch(`https://api.fontsource.org/v1/fonts/${id}`)
    .then((res) => (res.ok ? res.json() : null), () => null);
}

/** The weights the package ships in `style`: the API pairs none (no Libre
 *  Caslon 700 italic file), so italics are read from latin-italic.css. */
function fontsourceWeights(family, style, id = fontsourceId(family)) {
  return (fontsourceWeights.c ??= {})[id + style] ??= fontsourceMeta(family).then(async (m) => {
    if (!m?.styles.includes(style)) return m ? [] : [400, 700];
    const css = style === 'italic' ? await fetch(`${await fontsourceAt(id)}latin-italic.css`).then((r) => (r.ok ? r.text() : ''), () => '') : '';
    const w = [...css.matchAll(/weight: (\d+)/g)].map((x) => +x[1]);
    return w.length ? w : m.weights;
  });
}

// ─── Kit · viewer v2 ── the same in every recipe · postext.dev/cookbook
/** The pages as spreads on a dark desk, page 1 alone, then verso | recto,
 *  each painted when it scrolls near. Other options go to renderPageToCanvas. */
function showPages(docs, { title, width = 460, ...render } = {}) {
  const root = viewer(title);
  const pages = [docs].flat().flatMap((doc) =>
    doc.pages.map((page) => ({ doc, page, n: (doc.pageIndexOffset ?? 0) + page.index })));
  const spreads = [];
  let verso = null;
  for (const p of pages) {
    if (p.n % 2 === 1) { if (verso) spreads.push([verso, null]); verso = p; }
    else { spreads.push([verso, p]); verso = null; }
  }
  if (verso) spreads.push([verso, null]);
  const density = Math.min(window.devicePixelRatio || 1, 2);
  showPages.painter?.disconnect();
  const painter = new IntersectionObserver((entries) => {
    for (const { isIntersecting, target } of entries) {
      if (!isIntersecting) continue;
      painter.unobserve(target);
      const { doc, page } = target.postext;
      renderPageToCanvas(page, doc, target, { ...render, scale: (width * density) / page.width });
    }
  }, { rootMargin: '800px' });
  showPages.painter = painter;
  root.replaceChildren(...spreads.map((pair) => {
    const spread = document.createElement('div');
    spread.className = 'pt-spread';
    for (const p of pair) {
      const figure = document.createElement('figure');
      if (p) {
        const label = p.page.pageLabel || String(p.n + 1);
        const canvas = document.createElement('canvas');
        canvas.postext = p;
        canvas.style.aspectRatio = `${p.page.width} / ${p.page.height}`;
        canvas.setAttribute('role', 'img');
        canvas.setAttribute('aria-label', `Page ${label}`);
        const folio = document.createElement('figcaption');
        folio.textContent = label;
        figure.append(canvas, folio);
        painter.observe(canvas);
      } else figure.className = 'pt-blank';
      spread.append(figure);
    }
    return spread;
  }));
  kitStatus(`${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`);
  document.documentElement.dataset.postext = 'ready';
  return pages.length;
}

/** The desk, the bar and the error reporting, created once. */
function viewer(title) {
  if (!document.getElementById('pt-kit')) {
    document.head.insertAdjacentHTML('beforeend', `<style id="pt-kit">
      :root { color-scheme: dark; }
      body { margin: 0; background: #0e1014; color: #b9bcc4; font: 13px/1.45 system-ui, sans-serif; }
      #pt-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center;
        gap: 6px 16px; padding: 10px 16px; background: rgb(14 16 20 / .92); backdrop-filter: blur(6px);
        border-bottom: 1px solid #23262d; }
      #pt-bar strong { color: #f4f1ea; font-weight: 600; }
      #pt-actions { display: flex; gap: 12px; margin-left: auto; }
      #pt-actions a, #pt-actions button { color: #d8a21a; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
      #pages { display: grid; justify-items: center; gap: 48px; padding: 32px 16px 72px; }
      .pt-spread { display: flex; }
      .pt-spread figure { margin: 0; width: min(460px, 44vw); }
      .pt-spread canvas { display: block; width: 100%; background: #fff;
        box-shadow: 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figure:first-child canvas { box-shadow: inset -14px 0 14px -14px rgb(0 0 0 / .18), 0 1px 2px rgb(0 0 0 / .5), 0 22px 44px -16px rgb(0 0 0 / .8); }
      .pt-spread figcaption { margin-top: 10px; text-align: center; font: 600 10px/1 system-ui, sans-serif;
        letter-spacing: .18em; text-transform: uppercase; color: #6c7079; }
      .pt-blank { visibility: hidden; }
      @media (max-width: 760px) {
        .pt-spread { flex-direction: column; gap: 32px; }
        .pt-spread figure { width: min(460px, 92vw); }
        .pt-blank { display: none; }
      }
    </style>`);
    document.body.insertAdjacentHTML('afterbegin',
      '<header id="pt-bar"><strong id="pt-title"></strong><span id="pt-status" role="status"></span><span id="pt-actions"></span></header>');
    document.getElementById('pt-title').textContent = document.title || 'Postext';
    addEventListener('error', (event) => kitFail(event.error ?? event.message));
    addEventListener('unhandledrejection', (event) => kitFail(event.reason));
  }
  if (title) document.getElementById('pt-title').textContent = title;
  return document.getElementById('pages')
    ?? document.body.appendChild(Object.assign(document.createElement('main'), { id: 'pages' }));
}

function kitStatus(text) {
  viewer();
  document.getElementById('pt-status').textContent = text;
}

function kitFail(error) {
  document.documentElement.dataset.postext = 'error';
  kitStatus(`Error: ${error?.message ?? error}`);
}

// ─── Kit · pdf v3 ── the same in every recipe that exports a PDF
/** The Fontsource files the screen used, as TrueType, with their range and
 *  place: the nearest weight the family ships in that style, upright with no italic;
 *  latin, then what its letters need (kitSubsetsFor). */
async function fontsourceProvider(family, weight, style, request) {
  const id = fontsourceId(family);
  const meta = await fontsourceMeta(family);
  const s = style === 'italic' && meta && !meta.styles.includes('italic') ? 'normal' : style;
  const shipped = meta ? await fontsourceWeights(family, s) : [];
  const weights = shipped.length ? shipped : [400, 700];
  const w = weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a));
  const text = String.fromCodePoint(...(request?.codePoints ?? []));
  const files = await Promise.all(['latin', ...kitSubsetsFor(text, meta)].map(async (subset, order) => {
    const res = await fetch(`${await fontsourceAt(id)}files/${id}-${subset}-${w}-${s}.woff2`);
    if (!res.ok) throw new Error(`Fontsource has no ${family} ${w} ${s} ${subset}`);
    return Object.assign(await decompressWoff2(new Uint8Array(await res.arrayBuffer())),
      { unicodeRange: kitRanges()[subset], order });
  }));
  return files.length === 1 ? files[0] : files;
}

/** A "Build the PDF" button; then "Open the PDF" (a new tab: CodePen's frame
 *  shows no PDFs) and a download link. */
function offerPdf(makePdf, filename) {
  viewer();
  const button = Object.assign(document.createElement('button'), { type: 'button', textContent: 'Build the PDF' });
  button.dataset.postextPdf = filename;
  button.addEventListener('click', async () => {
    button.disabled = true;
    button.textContent = 'Building the PDF…';
    try {
      const bytes = await makePdf();
      const url = URL.createObjectURL(new Blob([bytes], { type: 'application/pdf' }));
      const size = `${Math.max(1, Math.round(bytes.length / 1024))} KB`;
      button.replaceWith(
        Object.assign(document.createElement('a'), { href: url, target: '_blank', rel: 'noopener', textContent: 'Open the PDF ↗' }),
        Object.assign(document.createElement('a'), { href: url, download: filename, textContent: `Download ${filename} · ${size}` }));
    } catch (error) {
      button.disabled = false;
      button.textContent = 'Build the PDF';
      kitFail(error);
    }
  });
  document.getElementById('pt-actions').append(button);
}

// ─── Kit · images v3 ── recipes with pictures · postext.dev/cookbook
/** Registers a photo or PNG for the canvas and keeps its bytes for the PDF.
 *  fetch → ImageBitmap never taints the canvas (a plain cross-origin <img> would). */
async function loadImage(fileId, url) {
  const res = await fetch(url);
  if (!res.ok) throw new Error(`Image not found (${res.status}): ${url}`);
  const bytes = new Uint8Array(await res.arrayBuffer());
  registerResourceImage(fileId, await createImageBitmap(new Blob([bytes])));
  (loadImage.bytes ??= new Map()).set(fileId, bytes);
}

/** Registers SVG markup as a vector image, its fonts inside (inlineSvgFonts, ≥ 1.25).
 *  `options` go to registerResourceImage: { singleInk: true } tints it on the canvas. */
async function loadSvg(fileId, svg, options) {
  if (typeof inlineSvgFonts === 'function') svg = await inlineSvgFonts(svg, svgFaces);
  const img = new Image();
  img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
  await img.decode();
  registerResourceImage(fileId, img, options);
  (loadImage.bytes ??= new Map()).set(fileId, new TextEncoder().encode(svg));
}

/** A face's Fontsource files: nearest weight; latin + what the SVG sets. */
async function svgFaces(family, weight, style, { codePoints = [] } = {}) {
  const [id, m] = [fontsourceId(family), await fontsourceMeta(family)];
  const w = m?.weights.reduce((a, b) => (Math.abs(b - weight) < Math.abs(a - weight) ? b : a)) ?? weight;
  const s = m?.styles.includes(style) === false ? 'normal' : style;
  return Promise.all(['latin', ...kitSubsetsFor(String.fromCodePoint(...codePoints), m)].map(async (x) => new Uint8Array(
    await (await fetch(`${await fontsourceAt(id)}files/${id}-${x}-${w}-${s}.woff2`)).arrayBuffer())));
}

/** renderToPdf({ resourceBytes: imageBytes }) */
function imageBytes(fileId) { return loadImage.bytes?.get(fileId); }

/** renderToHtml({ resourceImageUrl: imageUrl }) */
function imageUrl(fileId) {
  const bytes = imageBytes(fileId);
  if (!bytes) return undefined;
  imageUrl.urls ??= new Map();
  if (!imageUrl.urls.has(fileId)) {
    const type = /\.svg$/i.test(fileId) ? 'image/svg+xml' : /\.png$/i.test(fileId) ? 'image/png' : 'image/jpeg';
    imageUrl.urls.set(fileId, URL.createObjectURL(new Blob([bytes], { type })));
  }
  return imageUrl.urls.get(fileId);
}

// ─── /Kit ───────────────────────────────────────────────────────────────────────
```

## アレンジ

### 写真を黒だけで刷る

画像用の版を1枚にすると、写真は黒の普通のグレースケールで刷られ、ピンクは文字と囲みのために残ります。

```diff
-  plates: { inks: ['Black', 'PANTONE 806 C'], images: ['Black', 'PANTONE 806 C'],
+  plates: { inks: ['Black', 'PANTONE 806 C'], images: ['Black'],
```

### 蛍光イエローに替える

インキとその画面用の色を変えます。版、加工、カーブは名前に従います。

```diff
-const PINK = { name: 'PANTONE 806 C', cmyk: { c: 0, m: 77, y: 0, k: 0 } };
+const PINK = { name: 'PANTONE 803 C', cmyk: { c: 0, m: 0, y: 92, k: 0 } };
```

`CURVES`、`PRINT`、パレットの`hex`でも同じように`PANTONE 806 C`の名前を変えてください。

## よくあるつまずき

- どちらの版も刷らない色は、2つのインキに投影されます。スタイルに残ったプロセスの青は黒ずんだピンクになります。ファイルを送る前に、プリフライトの`offPlateColor`の指摘を読んでください。
- 蛍光インキには忠実なCMYKの代替色がありません。校正刷りやRGBのPDFは`hex`の色を見せますが、紙の上のインキよりくすんで見えます。

## クレジット

- レシピ: Ignacio Ferro ([@drnachio](https://github.com/drnachio))
- 画像: A crowd at a basement gig, on the cover: Generated With Diffusion Models, オリジナル
- 画像: A guitarist on a small stage: Generated With Diffusion Models, オリジナル
- 画像: An alley wall layered with posters: Generated With Diffusion Models, オリジナル
- 書体: Archivo Black (OFL-1.1), IBM Plex Sans (OFL-1.1), IBM Plex Mono (OFL-1.1)
- コード: MIT · サンプルの内容: CC-BY-4.0

## 関連レシピ

- [No. 051 · 2色リソのZine：図版を1色の特色で](https://postext.dev/ja/cookbook/riso-zine-single-ink.md): 2ドラムのリソグラフ用の4ページのZineです。フルカラーの線画はピンクの濃淡で印刷され、CanvasでもPDFでもエンジンが色を置き換えます。 · 難易度 3 (上級) · 雑誌とジン
- [No. 188 · 濃紺の表紙に金の箔押し](https://postext.dev/ja/cookbook/gold-foil-poetry-cover.md): 金箔を加工付きの特色にします。PDFでは専用の版になり、Folioでは光り、紺の厚紙とクリームの紙はインキを刷りません。 · 難易度 3 (上級) · 詩歌
- [No. 192 · ソフトタッチの写真誌に部分グロスニス](https://postext.dev/ja/cookbook/spot-uv-photo-magazine.md): 2種類のニスを特色として扱います。全ページにソフトタッチ、写真と題字にはグロスを重ね、Folioと加工ビューで、どこにどのニスがかかるかを確かめます。 · 難易度 3 (上級) · 雑誌とジン
