かんたんな説明
オスカー・ワイルドの有名な喜劇の冒頭を、俳優向けに刷ったものです。話す人の名前は太字の色で目立たせ、ト書きは読み飛ばしやすいようにグレーにしています。
できあがり
オスカー・ワイルド『まじめが肝心』(The Importance of Being Earnest)の冒頭を、140×216mmの5ページの上演台本として組みます。扉は金色の二重枠に囲まれたプラム色のプレイビルで、「Importance」と「Earnest」をファットフェイスの大文字で組み、題の下に金色のカーネーションを置きます。第1幕の向かいの配役表には、1895年にセント・ジェームズ劇場で各役を初演した俳優の名を並べます。各台詞は話者名を太字のプラム色で始め、折り返した行を5mmぶら下げるので、俳優は次のきっかけをひと目で見つけられます。ト書きは台詞の中にあってもあいだにあってもグレーのイタリックで、台詞をさらうときは目で飛ばせます。スペイン語版はスペインの舞台の慣習に従った新訳で、各名前のあとにダッシュを置き、ト書きを丸括弧に入れます。
このレシピが答える質問
- 脚本や戯曲を組むには(柱書き、役名、左右からインデントしたせりふ)?
- 本文や囲みの中で、キーワード(太字やイタリック)に色を付けるには?
- 番号のないアートワーク(オーナメント、カット、ロゴ)を組むには?
手短な答え
// Speeches are plain paragraphs, the speaker's name in bold and each stage direction in
// italic; a direction between two speeches is a paragraph of its own, in a container:
// **LANE.** Yes, sir. *[Hands them on a salver.]*
// :::paragraphs{style="direction"}
// *[Enter Lane.]*
// :::
// The body's two emphasis colours then mark who speaks (plum) and what is done (grey).
const dialogue = {
fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
boldColor: col('plum'), // **ALGERNON.**
italicColor: col('muted'), // *[Languidly.]*, in a speech or a paragraph of its own
minWordSpacing: 0.65, maxWordSpacing: 1.8, // justified (the default); limits inside 0.6–2
// A runt fix tracks by 5/1000 em at most (default 10). At 10, “that?” went up beside “as”
// and the speech stood darker than the ones around it; at 5 the word turns over.
maxRuntTracking: 5,
firstLineIndent: mm(5), hangingIndent: true, // the name at the margin, the turnovers hung
};
// Directions: smaller and centred, on the same grid. They are written *…* like the ones
// inside a speech, so both take the body's italic grey.
const direction = { id: 'direction', fontSize: pt(8.6),
textAlign: 'center', firstLineIndent: pt(0) };
材料
- 機能
- 段落スタイル太字・イタリックとその色タブストップとリーダー字下げ、行そろえ、段落間隔見出しの階層奇数ページから始まる章独自のリソースの種類その場に置く図見出しスタイル表紙、扉、奥付見出しの属性ページデザインの画像ページデザインのテキスト・罫・ボックス柱とノンブルページの役割ごとの柱文書のメタデータ用紙の色セマンティックカラーパレット
- 種類
- Libre Baskerville, Abril Fatface, Playfair Display SC (SIL OFL 1.1)
- 素材
- The title page’s frame and the carnation fleuron, drawn in code in the page’s palette (Ignacio Ferro, MIT)
作り方
#1 · 幕はふつうの見出し
const headings = {
fontFamily: LABEL, fontWeight: 400, color: col('ink'),
textAlign: 'center', // every level: the act, the cast list's heads, the scene
lineHeight: pt(LEAD), marginTop: pt(LEAD), marginBottom: pt(0), // whole lines of the grid
levels: [
{ level: 1, fontFamily: DISPLAY, fontSize: pt(24), lineHeight: pt(3 * LEAD),
color: col('plum'), textTransform: 'uppercase',
breakBefore: { enabled: true, parity: 'odd' } }, // a recto, facing the cast list
{ level: 2, fontSize: pt(13), lineHeight: pt(2 * LEAD) },
{ level: 3, fontSize: pt(9.5), color: col('plum') },
],
};
幕の題は、デザインのスロットがないレベル1の見出しで、Abril Fatfaceの24ptです。textTransformで大文字にし、13.6ptのグリッド行3行分を取ることで、大文字は版面の上端から5.5mm下に来ます(見出し)。textAlign: 'center'はレベルごとには設定できないので、配役表の見出しと「Scene」のラベルも中央にそろいます。breakBeforeをparity 'odd'にすると、幕は奇数ページから、配役表の向かいで始まります。既定の'always-odd'では、両者のあいだに白ページが2ページ入ります(前で改ページ)。
#2 · 配役表は点の列で俳優へつなぐ
// A tab sends the actor to a stop at the end of the measure that ends the text there; the stop's
// leader fills the room before it with dots, from half an em after the person to half an em
// before the actor. The bill's head is a centred line in the face's own small capitals.
const person = { id: 'person', fontSize: pt(8.8), firstLineIndent: pt(0), textAlign: 'left',
tabStops: [{ position: 'end', align: 'end', leader: '.' }],
spaceBetween: pt(LEAD / 2) }; // a person every line and a half
const billHead = { id: 'bill-head', fontFamily: LABEL, fontSize: pt(8.5), color: col('plum'),
textAlign: 'center', firstLineIndent: pt(0), marginTop: pt(LEAD / 2),
marginBottom: pt(LEAD / 2) };
// The scenes: two stops, so `:tab Act I :tab Algernon’s flat` ends the act on the first
// (15 mm in) and starts the place on the second, 2 mm after it, as a two-column list would.
const scene = { id: 'scene', textAlign: 'left', firstLineIndent: pt(0), marginTop: pt(LEAD / 2),
tabStops: [{ position: mm(15), align: 'end' }, { position: mm(17) }] };
登場人物はそれぞれpersonスタイルの段落で、俳優の名前は:tabのあとに書きます(タブとタブ位置)。このスタイルには、行長の終わりである'end'にタブ位置が1つだけあり、align: 'end'によって俳優の名前はそこで終わります。leader: '.'はタブ位置の前のアキをピリオドで埋め、役名と俳優名からそれぞれ0.5em離します。spaceBetweenで役は1.5行ごとに並びます。役名は太字なので、台詞の話者名と同じくプラム色で刷られます。初演の配役、劇場、日付はbill-headスタイルで一覧の先頭に置き、Playfair Display SCで中央にそろえます。この書体の小文字はスモールキャピタルです。場面には2つのタブ位置を使います。:tab Act I :tab …は、15mmの位置にある1つ目のタブ位置で「Act I」をalign: 'end'により終わらせるので、3つの幕は1つの列に右そろえで並びます。場所は2つ目のタブ位置、その2mm先から始まります。時代設定はト書きのスタイルで組んだ中央そろえの1行です。
#3 · 番号もキャプションもない飾り
// ::resource{id="fleuron"} sets it where it stands (gotcha: resource-double-quotes).
const unnumbered = (id, name, defaultPlacement) => ({ id, name, shortLabel: '', captionPrefix: '',
numberingTemplate: '{n}', resetOn: 'never', counterFormat: 'decimal', defaultPlacement });
const resourceTypes = [
unnumbered('ornament', 'Ornament', { position: 'here', width: 0.24, align: 'center' }),
];
captionPrefixとshortLabelを空にしたリソースの種類は、画像を何も添えずに刷ります(リソースの種類)。そのdefaultPlacementは、::resource{id="fleuron"}のある位置にカーネーションを中央そろえで置き、幅は107mmの行長の0.24、約26mmです。
#4 · 扉は見出しスタイル
// # The Importance of Being Earnest {style="playbill" small="The" big="Importance" …}
// Each attribute is a playbill line in its own face and size. The ground is an image that
// fills the sheet: the heading reserves down to its foot, so the cast list starts on page 2.
const line = (id, content, font, size, y, color, extra = {}) => ({ kind: 'text', id, content,
fontFamily: font, fontSize: pt(size), lineHeight: 1, color: col(color), align: 'center',
placement: { anchor: { to: 'page', edge: 'top' }, offset: { y: mm(y) } }, ...extra });
const tracked = (track) => ({ textTransform: 'uppercase', letterSpacing: pt(track) });
const playbill = {
id: 'playbill', span: 'page', // kept in the column, its foot would cut the ground
header: { elements: [] }, footer: { elements: [] }, // no heads on p. 2, no folio on p. 1
advancedDesign: { enabled: true, slot: { elements: [
{ kind: 'image', id: 'ground', resourceId: 'playbill',
placement: { anchor: { to: 'bleed', edge: 'top-left' }, size: { width: 'fill' } } },
line('kicker', '{subtitle}', LABEL, 8.5, 36, 'gilt', tracked(1.7)),
line('small', '{attr.small}', TEXT, 17, 51, 'paper', { italic: true }),
line('big', '{attr.big}', DISPLAY, 40, 60, 'paper', { textTransform: 'uppercase' }),
line('link', '{attr.link}', TEXT, 17, 78, 'gilt', { italic: true }),
line('name', '{attr.name}', DISPLAY, 60, 87, 'paper', { textTransform: 'uppercase' }),
line('author', '{author}', LABEL, 13, 133, 'paper', tracked(3)),
line('theatre', '{attr.theatre}', LABEL, 8, 170, 'gilt', tracked(1.6)),
line('premiere', '{attr.premiere}', TEXT, 8.5, 176, 'paper', { italic: true }),
] } },
};
# The Importance of Being Earnest {style="playbill" …}は題を4つの属性に分けて持ち、デザインはそれを2つの書体で組みます。名詞はAbril Fatfaceの40ptと60pt、「The」と「of Being」はLibre Baskervilleのイタリック17ptです(見出しの属性)。プラム色の地、枠、カーネーションは、コードで描いた1つのSVGで、塗り足しに固定します(画像要素)。本は1段組みですが、スタイルはspan: 'page'を設定します。段の中に置くと、デザインは版面の下端、つまり用紙の下端から23.3mm上で切れてしまいます。スタイルの空のheaderは、同じ節に属する配役表から柱を外します。空のfooterは扉から下ノンブルを外します。扉に置くと、プラム色の上にプラム色で刷られてしまいます(見出しスタイル)。
地は画像要素で、扉の見出しは画像の下端までの高さを確保します。そのため見出しは用紙全体を押さえ、扉の各行がどこにあっても、題のあとに:::pagebreakを書かなくても「The Persons of the Play」は2ページ目から始まります。letterSpacingを付けた中央そろえの行にも補正は要りません。最後の文字のあとの字間は中央そろえの計算に入らず、「OSCAR WILDE」はページの中央に来ます。
#5 · 幕の最初のページを飛ばす柱
const head = (id, content, parity, edge, x, style) => ({
kind: 'text', id, content, parity, pages: 'body', // never on openers or blank pages
fontFamily: LABEL, fontSize: pt(8.5), letterSpacing: pt(0.8), color: col('muted'),
textTransform: 'uppercase', ...style,
placement: { anchor: { to: 'page', edge }, offset: { x: mm(x), y: mm(11) } },
});
const folio = { fontFamily: TEXT, letterSpacing: pt(0), color: col('plum') };
const header = { elements: [
head('verso-folio', '{pageNumber}', 'even', 'top-left', OUTER, folio),
head('verso-title', '{title}', 'even', 'top-left', OUTER + 8),
head('recto-act', '{chapterTitle}', 'odd', 'top-right', -(OUTER + 8)),
head('recto-folio', '{pageNumber}', 'odd', 'top-right', -OUTER, folio),
] };
// The act's first page carries a drop folio instead, centred under the text block.
const footer = { elements: [{ ...head('drop-folio', '{pageNumber}', 'all', 'top', 0, folio),
pages: 'opener', align: 'center',
placement: { anchor: { to: 'container', edge: 'top' }, offset: { y: mm(8) } } }] };
偶数ページにはフロントマターから戯曲の題を、奇数ページには{chapterTitle}から幕名を入れます。どちらもPlayfair Display SCの大文字で、ノンブルは外側の端にプラム色で置きます(テキスト要素)。幕の最初のページは、最初のブロックが改ページする見出しなので扉として数えられ、pages: 'body'でそこから柱を外し、フッターが代わりに下ノンブルを付けます。
レシピの全体
// ═══ Postext Cookbook · Nº 070 · Play script: cast list, speakers and stage directions ═══
// https://postext.dev/en/cookbook/stage-play
// Code: MIT · Text: Oscar Wilde, 1895 (PD, Gutenberg #844), Spanish: the Cookbook · Art: in code
// Fonts: Libre Baskerville, Abril Fatface, Playfair Display SC (OFL 1.1) · Needs postext ≥ 1.25.0
import {
buildDocumentWithFonts, renderPageToCanvas, registerResourceImage,
} from 'https://esm.sh/postext';
const LANG = 'en'; // @lang: the language of the sample document ('en' | 'es')
const RECIPE = 'stage-play';
// ─── 1 · Design ─────────────────────────────────────────────────────────────
const palette = { // every colour in the config links to one of these
ink: '#221b1f', // the dialogue: a near-black with a little plum in it
plum: '#5b2349', // the one accent: speakers' names, act titles, the title page's ground
gold: '#b48a45', // rules and ornaments
gilt: '#c9aa77', // gold lightened for small type on the plum ground (5.3:1)
muted: '#6c6168', // stage directions and running heads (5.5:1 on the paper)
paper: '#fbf6ec', // a cream stock
};
// A colour is its hex and the palette entry it follows.
const col = (id) => ({ hex: palette[id], model: 'hex', paletteId: id });
const colorPalette = [
...Object.entries(palette).map(([id, hex]) => ({ id, name: id, value: { hex, model: 'hex' } })),
// The engine's defaults link to 'main-color': point it at the accent, so nothing prints blue.
{ id: 'main-color', name: 'plum (defaults)', value: { hex: palette.plum, model: 'hex' } },
];
const [TEXT, DISPLAY, LABEL] = ['Libre Baskerville', 'Abril Fatface', 'Playfair Display SC'];
const [BODY, LEAD] = [9.4, 13.6]; // pt: the dialogue and its leading, the pitch of the grid
const TRIM = { width: 140, height: 216 }; // mm: 5½ × 8½ in, the acting-edition size
const [TOP, INNER, OUTER, LINES] = [20, 18, 15, 36]; // mm, and 36 lines to a full page
// #region answer: a speech is a paragraph: the name in bold, the directions in italic
// Speeches are plain paragraphs, the speaker's name in bold and each stage direction in
// italic; a direction between two speeches is a paragraph of its own, in a container:
// **LANE.** Yes, sir. *[Hands them on a salver.]*
// :::paragraphs{style="direction"}
// *[Enter Lane.]*
// :::
// The body's two emphasis colours then mark who speaks (plum) and what is done (grey).
const dialogue = {
fontFamily: TEXT, fontSize: pt(BODY), lineHeight: pt(LEAD), color: col('ink'),
boldColor: col('plum'), // **ALGERNON.**
italicColor: col('muted'), // *[Languidly.]*, in a speech or a paragraph of its own
minWordSpacing: 0.65, maxWordSpacing: 1.8, // justified (the default); limits inside 0.6–2
// A runt fix tracks by 5/1000 em at most (default 10). At 10, “that?” went up beside “as”
// and the speech stood darker than the ones around it; at 5 the word turns over.
maxRuntTracking: 5,
組み立てたscript.jsはそのまま動きます。任意のページのモジュールスクリプトに貼り付けるか、レシピをCodePenで開いてください。 GitHub上のレシピのフォルダー ↗ (新しいタブで開きます)
アレンジ
#ト書きを折り返しの行にそろえる
左そろえにして1行目を5mm字下げすると、1行のト書きは台詞の折り返しの行と同じ位置から始まり、舞台の設定は中央そろえのラベルの下で、字下げした2つの段落になります。
const direction = { id: 'direction', fontSize: pt(8.6),
- textAlign: 'center', firstLineIndent: pt(0) };
+ textAlign: 'left', firstLineIndent: mm(5) };#台詞のあいだに1行空ける
paragraphSpacing: trueは、各台詞のあとに空のグリッド行を1行足します。英語版の幕は3ページから5ページに、スペイン語版は4ページに延びます。
firstLineIndent: mm(5), hangingIndent: true, // the name at the margin, the turnovers hung
+ paragraphSpacing: true,
};よくあるつまずき
つまずき
::resource{id="…"}は二重引用符でしか書けない
ブロックの埋め込みとして認識されるのは、二重引用符を使った::resource{id="…"}の形だけです。ほかの書き方は、目に見える1行として本文に残ります。 その場に置く図 →
- 台詞の中のイタリックはすべて、強調も含めて
italicColorを取ります。そのためレインが強調する「is」も、ト書きのグレーで刷られます。ト書きの多くは台詞の中、強調と同じ段落にあるので、グレーはbodyTextに設定します。「is」を墨のまま保てるのはローマン体だけです。 - ワイルドの台詞のうち3つは、1語だけの最終行で終わります。「information.」「you.」「that?」です。3つ目は、
bodyText.maxRuntTrackingが既定で許す1%の負のトラッキングを使えば前の行に引き上げられますが、その台詞だけが前後より黒く見えます。maxRuntTracking: 5で上限を半分にすると、「that?」は次の行に送られ、上の行の語間は通常の1.78倍まで開きます。これは上限の1.8に収まっています。英語のページは、ワイルドの言葉を変えるよりも3つのラントを残しています。スペイン語訳は、行が1文字の語で終わる箇所や音節が1つだけ残る箇所をすべて言い換えました。 - 名前もほかの語と同じくハイフネーションされます。5ページでは「Au-gusta」と「Gwen-dolen」が行をまたいで分かれています。「Augusta」の中にワードジョイナー(U+2060)を入れれば一語のまま保てますが、上の行の語間が通常の1.71倍に広がるので、英語のテキストはハイフンを残しています。
- Playfair Display SCはCanvasで「fi」を小文字の合字として描くので、「first」はスモールキャピタルの中に小文字の「fi」が混じって刷られます。配役表の先頭の行が「The original cast」となっているのはそのためです。
クレジット
- 本文
- The Importance of Being Earnest (1895): the persons and scenes of the play, the first cast and the opening of the first act · Oscar Wilde · パブリックドメイン
- The Spanish translation of the extract, the cast list and the scenes · Postext Cookbook · オリジナル
- 画像
- The title page’s frame and the carnation fleuron, drawn in code in the page’s palette · Ignacio Ferro · MIT
- フォント
- Libre Baskerville (SIL OFL 1.1) · Abril Fatface (SIL OFL 1.1) · Playfair Display SC (SIL OFL 1.1)


