本文へスキップ
レシピ番号191

レシピ集 · 第10章 · 出力と組み込み

クラフト紙に白インキで刷るベーカリーのメニュー

不透明白を特色としてクラフト紙に刷ります。茶色の板紙に白い文字、茶色の文字の下に白いカード、緑の面から白抜きにした文字。

このページの内容
出力
Canvas · PDF
レベル
上級
Postext
Postext 1.85.1で検証済み
1.85.1以上が必要 · postext-pdf ≥ 1.85.1
ライセンス
2026年11月13日更新
コードMIT · 本文CC BY 4.0

1ページ(全4ページ)

  • 英語の見本:日本語版はまだありません
  • 仕上がり148 × 210 mm
  • 1段
  • Lora 9.6/13.2
  • Alfa Slab One
  • 4ページ
  • レベル
  • Postext 1.85.1
  • 組版時間60 ms
  • コード190行

かんたんな説明

茶色のクラフト板紙に刷ったパン屋のメニューです。店名と見出しは白インキで、茶色い紙に白が見えるのは印刷所が追加のインキとして刷るからです。印刷用のファイルは白を専用の版に載せます。

できあがり

架空の村のパン屋、Horno Altoのメニューです。A5のクラフト板紙を一度折った4ページ。クラフト紙には白が含まれないので、カードの白はすべて印刷所が足すインキです。茶色の上にじかに刷る店名と見出し、3点のガッシュ画を載せる台紙、営業時間を載せるカード。値段はタブで揃え、点線リーダーを引き、プロセスカラーの濃い茶色で刷ります。コーヒーのページでは、緑の面に今日の焼き菓子を白い文字で入れ、文字は緑から抜いてあります。Folioは昼の光の中、オークのカウンターにカードを広げます。

このレシピが答える質問

  • クラフト紙に白を刷るには?文字として、また色の下地として。

手短な答え

script.js · 20〜35行コード全体で見る
// The paper is a colour that prints no ink: the screen and Folio paint kraft, and no plate
// gets a dot of it. Because it is not white, the preflight knows the white ink shows on it.
// The white is a spot ink with the white finish: its own plate, laid down before the others.
const kraft = { hex: '#c19a6b', model: 'cmyk', cmyk: { c: 0, m: 0, y: 0, k: 0 } };
const WHITE = { name: 'Opaque White', cmyk: { c: 0, m: 0, y: 0, k: 0 } };
// A white ink overprints by default: laid under the colours, it must not cut holes in them.
const white = { hex: '#f7f4ee', model: 'spot', spot: { ...WHITE, finish: { kind: 'white' } } };
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra52', convertImages: false,
  inks: [{ name: 'Opaque White', aliases: ['White'], finish: { kind: 'white' } }] };

// White type on a green panel must knock the green out.
// White printed under the green is hidden by it. For white type on a colour, the type must cut
// its shape out of the colour, so this white says overprint: false. Its hex differs by one
// step from the other white, since the PDF tells colours apart by hex; both print on one plate.
const whiteOut = { hex: '#f6f3ed', model: 'spot',
  spot: { ...WHITE, finish: { kind: 'white' }, overprint: false } };

材料

種類
Alfa Slab One, Lora (SIL OFL 1.1)
素材
  • coffee-600.jpg
  • loaf-700.jpg
  • pastries-900.jpg
  • A sourdough loaf, on the cover (Generated With Diffusion Models, オリジナル)
  • Three pastries (Generated With Diffusion Models, オリジナル)
  • A cup of coffee (Generated With Diffusion Models, オリジナル)

作り方

#1 · 紙はクラフト、白はインキ

コードは上の手短な答えにあります。紙はCMYKを0 %で指定したパレットの色です。画面とFolioはクラフトを描きますが、どの版もそれを刷りません。白は白の加工を持つ特色で(加工)、インキ表では印刷所に伝える名前どおりOpaque Whiteとします。PDF/X-4のファイルはこれを4枚のプロセス版の隣に、専用のSeparationとして置きます。画面用のhexは#ffffffより1段低くし、加工マスクがインキと白い紙を見分けられるようにします。

#2 · 茶色の上にじかに白

script.js · 63〜70行コード全体で見る
// The mount is a box in the white, the painting a picture over it. The white goes down first
// on press and runs on under the whole painting, so its light tones print on white.
const mount = (x, y, w, h, extra) => [
  { kind: 'box', id: 'mount', style: { backgroundColor: col('white') },
    placement: at('page', 'top-left', x, y, { width: mm(w), height: mm(h) }) },
  { kind: 'image', id: 'photo', resourceId: '{attr.photo}', fit: 'cover', ...extra,
    placement: at('page', 'top-left', x + 4, y + 4, { width: mm(w - 8), height: mm(h - 8) }) },
];

店名、見出し、中ページのタイトルは白の文字で、書体はAlfa Slab Oneです。白インキは墨ほど隠ぺい力がなく、細い線では茶色が透けます。そのため12 pt以上の太いスラブセリフなら読めますが、細いセリフ体はベージュに沈みます。台紙は同じ白のボックスで、絵より四方とも4 mm大きくします。白は絵のまわりだけでなく絵の下全体にも敷かれるので、絵の明るい部分は茶色ではなく白の上に刷られます。

#3 · 白の上に色

営業時間は白インキのカードに、メニュー本文の濃い茶色で載せます。白インキは初期設定でオーバープリントし、茶色もオーバープリントにしてあるので(パレットの色にoverprint: true)、印刷機の上で茶色は白の上に乗り、白から文字の形を抜くことはありません。

#4 · 色の上に白:抜く

script.js · 114〜126行コード全体で見る
const calloutStyles = [
  { id: 'bake', background: col('green'), marginTop: pt(LEAD), marginBottom: pt(0),
    padding: { top: mm(4), right: mm(5), bottom: mm(4), left: mm(5) },
    body: { fontFamily: SERIF, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('whiteOut'),
      boldColor: col('whiteOut'), italicColor: col('whiteOut'), textAlign: 'left',
      firstLineIndent: pt(0) } },
  // The hours: brown type on a card of white ink, the colour printed over the white.
  { id: 'hours', background: col('white'), marginTop: pt(LEAD), marginBottom: pt(0),
    padding: { top: mm(4), right: mm(5), bottom: mm(4), left: mm(5) },
    body: { fontFamily: SERIF, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
      boldColor: col('ink'), textAlign: 'left', firstLineIndent: pt(0),
      tabStops: [{ position: 'end', align: 'end' }] } },
];

印刷機は白を先に刷り、色をその上に重ねます。そのため緑の面に置いた白い文字は緑の下に隠れてしまいます。面の文字には同じ版の2つ目の白を使い、overprint: falseにします。文字が緑から自分の形を抜き、そこを白が埋めます。2つの白のhexが1段違うのは、PDFが色をhexで区別するからです。

#5 · 値段をタブで揃える

script.js · 106〜110行コード全体で見る
const dish = { id: 'dish', name: 'Dish', textAlign: 'left',
  tabStops: [{ position: 'end', align: 'end', leader: '. ' }],
  spaceBetween: pt(LEAD / 3), marginTop: pt(LEAD / 2) };
// The story on the back: half a line between paragraphs.
const story = { id: 'story', name: 'Story', spaceBetween: pt(LEAD / 2) };

各セクションは料理のスタイルを持つ:::paragraphsグループです。値段の前の:tabで値段を行長の端へ送り、そこまで点線リーダーを引きます。ビストロのメニューと同じやり方です。

#6 · プリフライトの結果

script.js · 274〜282行コード全体で見る
// A white ink on white paper prints nothing you can see, and the preflight warns of it
// (whiteInkOnWhite). On kraft it does not fire; the findings left say which special ink the
// job carries and that the press lays the white first.
const findings = preflightDocument(doc);
const report = document.createElement('p');
report.textContent = `Preflight: ${findings.map((f) => f.kind === 'inkPressOrder'
  ? `inkPressOrder (first: ${f.first.join(', ')})` : `${f.kind}${f.ink ? ` (${f.ink})` : ''}`)
  .join('; ') || 'no findings'}`;
document.querySelector(`[data-postext-pdf="${RECIPE}.pdf"]`).after(report);

preflightDocumentは、紙が白か未設定のページに白インキが乗るとwhiteInkOnWhiteで警告します。そこでは何も見えないからです。クラフト紙なら警告は出ず、ダウンロードボタンの下の行には残りの項目が並びます。特殊インキとしての白(spotInkFinish)と、白を最初に刷る刷り順(inkPressOrder)です。

#7 · Folioでカウンターに置いたカードを見る

script.js · 130〜136行コード全体で見る
const folio = {
  tilt: 20, yaw: -12,
  paper: { type: 'cardStock', grammage: 250, texture: 'felt', shade: kraft },
  binding: { type: 'folded', cover: 'pages' },
  surface: { type: 'oak' },
  lighting: { environment: 'daylight', intensity: 1.1 },
};

Folioは実際のインキと同じように、白が紙の色を覆うように描きます。フェルト目の板紙を選ぶと、茶色がクラフトらしく見えます。

レシピの全体

Sandbox
// ═══ Postext Cookbook · Nº 191 · A bakery menu in white ink on kraft ═════════════════════
// https://postext.dev/en/cookbook/white-ink-kraft-menu
// Code: MIT · Text: original (CC BY 4.0) · Paintings: diffusion models
// Fonts: Alfa Slab One, Lora (SIL OFL 1.1) · Needs postext ≥ 1.85.1
//
// The menu of a bakery, a folded card of brown kraft. Kraft takes no white from the paper, so
// the name and the course heads print in an opaque white ink, and the paintings sit on white
// mounts that the same ink lays under them; the menu text is a dark brown in process colour.
import {
  buildDocumentWithFonts, renderPageToCanvas, registerResourceImage, preflightDocument,
} 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 = 'white-ink-kraft-menu';

// ─── 1 · Design ─────────────────────────────────────────────────────────────
// #region answer: kraft as the paper, and an opaque white as a spot ink
// The paper is a colour that prints no ink: the screen and Folio paint kraft, and no plate
// gets a dot of it. Because it is not white, the preflight knows the white ink shows on it.
// The white is a spot ink with the white finish: its own plate, laid down before the others.
const kraft = { hex: '#c19a6b', model: 'cmyk', cmyk: { c: 0, m: 0, y: 0, k: 0 } };
const WHITE = { name: 'Opaque White', cmyk: { c: 0, m: 0, y: 0, k: 0 } };
// A white ink overprints by default: laid under the colours, it must not cut holes in them.
const white = { hex: '#f7f4ee', model: 'spot', spot: { ...WHITE, finish: { kind: 'white' } } };
const PRINT = { standard: 'pdfx4', outputProfile: 'fogra52', convertImages: false,
  inks: [{ name: 'Opaque White', aliases: ['White'], finish: { kind: 'white' } }] };

// White type on a green panel must knock the green out.
// White printed under the green is hidden by it. For white type on a colour, the type must cut
// its shape out of the colour, so this white says overprint: false. Its hex differs by one
// step from the other white, since the PDF tells colours apart by hex; both print on one plate.
const whiteOut = { hex: '#f6f3ed', model: 'spot',
  spot: { ...WHITE, finish: { kind: 'white' }, overprint: false } };
// #endregion

const palette = {
  kraft, white, whiteOut,
  // The brown overprints: on the white card it lands on the white instead of cutting it away.
  ink: { hex: '#3b2a1c', model: 'cmyk', cmyk: { c: 0, m: 45, y: 75, k: 82 }, overprint: true },
  green: { hex: '#2f5a43', model: 'cmyk', cmyk: { c: 80, m: 25, y: 75, k: 40 } }, // the panel
};
const col = (id) => ({ ...palette[id], paletteId: id });
const colorPalette = [...Object.entries(palette).map(([id, value]) => ({ id, name: id, value })),
  { id: 'main-color', name: 'ink (defaults)', value: palette.ink }];

const [TRIM_W, TRIM_H] = [148, 210]; // A5, an A4 card folded once

組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)

アレンジ

#ノートの表紙

メニューの代わりに、表にタイトルと白い罫の模様を置きます。紙、インキ、インキ表はそのままです。

#白を2度刷り

濃いクラフト紙では、印刷所に白を2度刷ってもらうと白がより白くなります。発注書で頼めばよく、ファイルは白版1枚のまま変わりません。

よくあるつまずき

  • 紙が白か未設定のページに白インキを置いても、見えるものは何も刷られません。page.backgroundColorに用紙をCMYK 0 %で指定すれば、プリフライトの警告は消えます。
  • 下に白を敷かずにクラフトへじかに刷った画像は、明るい部分すべてから茶色が透けます。色を保ちたい画像の下には、ここの台紙と同じように白のボックスを置きます。
  • 色の上の白い文字はオーバープリントにしてはいけません。初期設定のままだと色の下に刷られて消えます。

クレジット

レシピ
Ignacio Ferro
本文
書き下ろしの文章, CC BY 4.0
画像
  • A sourdough loaf, on the cover · Generated With Diffusion Models · オリジナル
  • Three pastries · Generated With Diffusion Models · オリジナル
  • A cup of coffee · Generated With Diffusion Models · オリジナル
フォント
Alfa Slab One (SIL OFL 1.1) · Lora (SIL OFL 1.1)
SandboxPDF