باختصار
قائمة مخبز مطبوعة على كرتون كرافت بني. الاسم والعناوين بحبر أبيض، ولا يظهر الأبيض على الورق البني إلا لأن المطبعة تضيفه حبرًا إضافيًا. ويضع ملف الطباعة الأبيض على لوح خاص به.
ما الذي ستنضده
قائمة Horno Alto، وهو مخبز قروي متخيَّل: بطاقة كرافت بنية بمقاس A5 مطوية مرة واحدة، في أربع صفحات. لا يحتوي الكرافت على أبيض، فكل أبيض في البطاقة حبر تضيفه المطبعة: الاسم وعناوين الأقسام مباشرة على البني، والحوامل التي توضع عليها لوحات الغواش الثلاث، والبطاقة التي تحمل مواعيد العمل. وتقف الأسعار عند علامة جدولة يسبقها خط نقطي، ببني داكن من الألوان الأساسية. وفي صفحة القهوة لوحة خضراء تحمل خَبزة اليوم بنص أبيض مفرّغ من الأخضر. ويفتح Folio البطاقة على منضدة من خشب البلوط في ضوء النهار.
تجيب هذه الوصفة عن
- كيف أطبع الأبيض على ورق الكرافت، نصًا وتحت الألوان؟
الجواب المختصر
// 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 } };
المكونات
- الميزات
- الأحبار الخاصةالألوان الخاصة وجدول الأحبارملفات PDF بنظام CMYK وبالتدرج الرماديعارض الكتاب ثلاثي الأبعاد (Folio)الورق والتجليد والمكتب والإضاءة (Folio)لوحة ألوان دلاليةالأغلفة وصفحات العنوان وبيانات النشرأنماط العناوينالنصوص والخطوط والمربعات في تصاميم الصفحةالصور في تصاميم الصفحةأنماط الفقراتمواضع الجدولة ونقاط التوجيهإطارات التنبيهالتصدير إلى PDFصفحات على اللوحة (Canvas)
- تستخدم أيضًا
- سمات العنوانشريط فصل بعرض الصفحةصفحات افتتاح مصمَّمةلون الورقالخطوط المضمَّنة في PDFأنواع موارد مخصّصةالأشكال والجداول بوصفها مواردترويسات لكل قسمفصول بلا أرقام
- الخطوط
- Alfa Slab One, Lora (SIL OFL 1.1)
- الأصول
coffee-600.jpgloaf-700.jpgpastries-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 في Separation خاص به بجانب ألواح الألوان الأساسية الأربعة. وقيمة hex الخاصة به على الشاشة أدنى بدرجة واحدة من #ffffff، حتى يميّز قناع التشطيبات الحبر من ورقة بيضاء.
#2 · الأبيض مباشرة على البني
// 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 · الأبيض فوق اللون: فرّغه
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' }] } },
];
تضع المطبعة الأبيض أولًا ثم الألوان فوقه، فيختفي النص الأبيض على اللوحة الخضراء تحت الأخضر. لذلك يأخذ نص اللوحة أبيض ثانيًا على اللوح نفسه، مع overprint: false: يفرّغ النص شكله من الأخضر ويملؤه الأبيض. ويختلف الأبيضان بدرجة hex واحدة لأن PDF يميّز الألوان بقيم hex.
#5 · الأسعار عند علامة جدولة
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 · ما يقوله الفحص المسبق
// 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 البطاقة على منضدة
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 الأبيض بحيث يغطي لون الورق، كما يفعل الحبر، ويجعل الكرتون ذو ملمس اللبّاد البنيَّ يبدو كرافتًا.
الوصفة كاملة
// ═══ 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 المجمّع كما هو: الصقه في سكربت الوحدة (module) لأي صفحة، أو افتح الوصفة على CodePen. مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)
تنويعات
أخطاء شائعة
- الحبر الأبيض على صفحة ورقها أبيض أو غير محدد لا يطبع شيئًا يُرى. اضبط
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)
- الشيفرة
- MIT، مثل Postext
حرّر هذا الشرح ↗ (يفتح في تبويب جديد)مجلد الوصفة على GitHub ↗ (يفتح في تبويب جديد)


