Skip to content
Yota Nakamura edited this page May 17, 2021 · 27 revisions

ZINE-TEMPLATE概要

ZINEのPDFを書き出したいときに使えるプログラムです. Processing IDEで動作します.

1ページ分はA4サイズ(裁ち落としなし)での書き出しを想定しています. いくつかの配置テンプレートをまとめています.

使用するフォント

デフォルトで使用するフォントは以下です. フォントをインストールした上で実行してください.

使い方

実行すると,コードとZINE-TEMPLATE/ZineTemplate/data/に置かれたデータを使い,ZINE-TEMPLATE/ZineTemplate/outputにPDFを1ページずつ書き出します.

初期設定

PDF書き出しの有効化/無効化

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

文章を書くページ

画像だけのページ

文章と画像が配置されるページ

コードを載せるページ