-
Notifications
You must be signed in to change notification settings - Fork 0
Home
ZINEのPDFを書き出したいときに使えるプログラムです. Processing IDEで動作します.
1ページ分はA4サイズ(裁ち落としなし)での書き出しを想定しています. いくつかの配置テンプレートをまとめています.
デフォルトで使用するフォントは以下です. フォントをインストールした上で実行してください.
実行すると,コードとZINE-TEMPLATE/ZineTemplate/data/
に置かれたデータを使い,ZINE-TEMPLATE/ZineTemplate/output
にPDFを1ページずつ書き出します.
PDFを書き出すときは,ZineTemplate.pde
の以下の記述をtrue
にしてください.
デフォルトはtrue
です.
boolean isExportPDF = true; // 全ページをPDFとして出力
書き出す時のページ配置を選べます.
- A3サイズ:2ページを横に並べて書き出す
- A4サイズ:1ページだけ書き出す
2ページを横に並べるときは,ZineTemplate.pde
の以下の記述をtrue
にしてください.
デフォルトはtrue
です.
boolean isTwoSheets = true; // 2ページを横に並べて,見開き1ページとして表示
レイアウトの基準となるグリッドを用意しています.
背景に水色のグリッドを表示する場合は,ZineTemplate.pde
の以下の記述をtrue
にしてください.
デフォルトはfalse
です.
boolean isVisibleGrid = false; // 描画の基準として使用する水色のグリッドを,背景に表示
Author.pde
内の,執筆者の役割を示すクラスRole
内の項目を追加/削除してください.役割を追加する場合はrole5
などとして追加します.
role1("役割1"),
role2("役割2"),
role3("役割3"),
role4("役割4");
次にAuthor.pde
内の,著者リストを表すクラスAuthor
内の項目を追加/削除してください.著者を追加する場合はauthor7
などとして追加します.
author1("執筆者1", "author1", "執筆者1の所属", new Role[]{ Role.role1, Role.role2, Role.role3 }),
author2("執筆者2", "author2", "執筆者2の所属", new Role[]{ Role.role1, Role.role2, Role.role3 }),
author3("執筆者3", "author3", "執筆者3の所属", new Role[]{ Role.role1, Role.role2, Role.role3 }),
author4("執筆者4", "author4", "執筆者4の所属", new Role[]{ Role.role1, Role.role4 }),
author5("執筆者5", "author5", "執筆者5の所属", new Role[]{ Role.role1, Role.role4 }),
author6("執筆者6", "author6", "執筆者6の所属", new Role[]{ Role.role1, Role.role4 });
Section.pde
内の,章/節のリストを表すクラスSection
内の項目を追加/削除してください.
cover(cover_path, "表紙", new Author[]{ Author.author1 }),
foreword(foreword_path, "まえがき", new Author[]{ Author.author1 }),
contents(contents_path, "目次", new Author[]{ Author.author1 }),
chap1_cover(chap1_path + cover_path, "1章", new Author[]{ Author.author1, Author.author2, Author.author3, Author.author4, Author.author5, Author.author6 }),
chap1_sec1_cover(chap1_path + sec1_path + cover_path, "1章1節表紙", new Author[]{ Author.author1 }),
chap1_sec1(chap1_path + sec1_path, "1章1節", new Author[]{ Author.author1 }),
afterword(afterword_path, "あとがき", new Author[]{ Author.author1, Author.author2, Author.author3, Author.author4, Author.author5, Author.author6 }),
colophon(colophon_path, "奥付", new Author[]{ Author.author1 }),
backcover(backcover_path, "裏表紙", new Author[]{ Author.author1 }),
empty("", "", new Author[]{});
各配置テンプレートは,classとして作っています(DescriptionPage.pde
のように,各pdeファイルに書いています).
Pageクラス(Page.pde
)を継承して作っています.
命名規則は以下です.
役割 | クラス名 | 命名例 |
---|---|---|
文章を書くページ | DescriptionPage |
DescriptionPage |
画像だけのページ | LargeImagePage |
LargeImagePage2 |
文章と画像が配置されるページ |
[クラス名] + [画像の枚数]
|
DescriptionPage12 |
コードを載せるページ |
[クラス名] + Code
|
DescriptionPage1Code |
各画像のサイズが異なるページ |
[クラス名] + mini + [サイズが異なる画像の枚数]
|
DescriptionPage2mini1 |