summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlotte Koch <dressupgeekout@gmail.com>2023-02-16 16:44:34 -0800
committerCharlotte Koch <dressupgeekout@gmail.com>2023-02-16 16:44:34 -0800
commit758952605ea8cb1b7cf926076f591007d8d98b7e (patch)
tree2ac581d31045011899a312efeb849f3540b3187a
First commit
-rw-r--r--.gitignore6
-rw-r--r--Gemfile3
-rw-r--r--LICENSE23
-rw-r--r--README.md33
-rw-r--r--fonts/EBGaramond-COPYING93
-rw-r--r--fonts/EBGaramond-Initials.ttfbin0 -> 262724 bytes
-rw-r--r--fonts/EBGaramond-InitialsF1.ttfbin0 -> 202440 bytes
-rw-r--r--fonts/EBGaramond-InitialsF2.ttfbin0 -> 8692 bytes
-rw-r--r--fonts/EBGaramond08-Italic.ttfbin0 -> 180220 bytes
-rw-r--r--fonts/EBGaramond08-Regular.ttfbin0 -> 280540 bytes
-rw-r--r--fonts/EBGaramond12-AllSC.ttfbin0 -> 184628 bytes
-rw-r--r--fonts/EBGaramond12-Italic.ttfbin0 -> 330352 bytes
-rw-r--r--fonts/EBGaramond12-Regular.ttfbin0 -> 498588 bytes
-rw-r--r--fonts/EBGaramondSC08-Regular.ttfbin0 -> 261780 bytes
-rw-r--r--fonts/EBGaramondSC12-Regular.ttfbin0 -> 412464 bytes
-rw-r--r--fonts/Tuffy-Bold.ttfbin0 -> 105220 bytes
-rw-r--r--fonts/Tuffy-BoldItalic.ttfbin0 -> 87864 bytes
-rw-r--r--fonts/Tuffy-COPYING5
-rw-r--r--fonts/Tuffy-Italic.ttfbin0 -> 87444 bytes
-rw-r--r--fonts/Tuffy-Regular.ttfbin0 -> 132864 bytes
-rw-r--r--fonts/TuffyInfant-Regular.ttfbin0 -> 119168 bytes
-rw-r--r--fonts/TuffyScript-Regular.ttfbin0 -> 119744 bytes
-rw-r--r--lib/willora_pdf_converter.rb19
-rw-r--r--mk/willora.mk57
-rw-r--r--themes/poppy-theme.yml105
25 files changed, 344 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d7cfe98
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*.adoc
+*.pdf
+*.swo
+*.swp
+Gemfile.lock
+vendor/
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..5657762
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+gem "asciidoctor-pdf"
+gem "rghost"
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..ec2b441
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2023 Charlotte Koch.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..887a479
--- /dev/null
+++ b/README.md
@@ -0,0 +1,33 @@
+# WilloraPDF
+
+**WilloraPDF** is a free and open source document preparation system for
+professional publishing.
+
+It is a collection of themes, tools and other goodies for
+[Asciidoctor-PDF][]. **WilloraPDF is designed to empower self-publishers**
+and lower the barrier to entry for authors who want their work
+professionally printed.
+
+It is currently a **work in progress,** being developed alongside my debut
+novel. Version 1.0 of WilloraPDF will be released when the first paperback
+and/or hardcover editions are printed for my book! Then you'll know for certain
+that WilloraPDF _can_ be used to publish actual, real-life books.
+
+
+## Use cases
+
+- Typesetting for printed text with no (or very few) illustrations
+- Render PDFs for local home printing or actual bookbinding
+- Generate properly formatted manuscripts
+
+
+## How it works
+
+1. Write your book in the [AsciiDoc][] markup language
+2. Choose a theme, trim size and other settings
+3. Feed your book into WilloraPDF
+4. A good-looking PDF document comes out!
+
+
+[Asciidoctor]: https://asciidoctor.org/
+[Asciidoctor-PDF]: https://docs.asciidoctor.org/pdf-converter/latest/
diff --git a/fonts/EBGaramond-COPYING b/fonts/EBGaramond-COPYING
new file mode 100644
index 0000000..6049b0c
--- /dev/null
+++ b/fonts/EBGaramond-COPYING
@@ -0,0 +1,93 @@
+Copyright (c) 2010-2013 Georg Duffner (http://www.georgduffner.at)
+
+All "EB Garamond" Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/fonts/EBGaramond-Initials.ttf b/fonts/EBGaramond-Initials.ttf
new file mode 100644
index 0000000..266bd4d
--- /dev/null
+++ b/fonts/EBGaramond-Initials.ttf
Binary files differ
diff --git a/fonts/EBGaramond-InitialsF1.ttf b/fonts/EBGaramond-InitialsF1.ttf
new file mode 100644
index 0000000..957ded3
--- /dev/null
+++ b/fonts/EBGaramond-InitialsF1.ttf
Binary files differ
diff --git a/fonts/EBGaramond-InitialsF2.ttf b/fonts/EBGaramond-InitialsF2.ttf
new file mode 100644
index 0000000..fe27add
--- /dev/null
+++ b/fonts/EBGaramond-InitialsF2.ttf
Binary files differ
diff --git a/fonts/EBGaramond08-Italic.ttf b/fonts/EBGaramond08-Italic.ttf
new file mode 100644
index 0000000..76c8113
--- /dev/null
+++ b/fonts/EBGaramond08-Italic.ttf
Binary files differ
diff --git a/fonts/EBGaramond08-Regular.ttf b/fonts/EBGaramond08-Regular.ttf
new file mode 100644
index 0000000..ec558aa
--- /dev/null
+++ b/fonts/EBGaramond08-Regular.ttf
Binary files differ
diff --git a/fonts/EBGaramond12-AllSC.ttf b/fonts/EBGaramond12-AllSC.ttf
new file mode 100644
index 0000000..e97914f
--- /dev/null
+++ b/fonts/EBGaramond12-AllSC.ttf
Binary files differ
diff --git a/fonts/EBGaramond12-Italic.ttf b/fonts/EBGaramond12-Italic.ttf
new file mode 100644
index 0000000..c453410
--- /dev/null
+++ b/fonts/EBGaramond12-Italic.ttf
Binary files differ
diff --git a/fonts/EBGaramond12-Regular.ttf b/fonts/EBGaramond12-Regular.ttf
new file mode 100644
index 0000000..d00050e
--- /dev/null
+++ b/fonts/EBGaramond12-Regular.ttf
Binary files differ
diff --git a/fonts/EBGaramondSC08-Regular.ttf b/fonts/EBGaramondSC08-Regular.ttf
new file mode 100644
index 0000000..1be871e
--- /dev/null
+++ b/fonts/EBGaramondSC08-Regular.ttf
Binary files differ
diff --git a/fonts/EBGaramondSC12-Regular.ttf b/fonts/EBGaramondSC12-Regular.ttf
new file mode 100644
index 0000000..ef44b24
--- /dev/null
+++ b/fonts/EBGaramondSC12-Regular.ttf
Binary files differ
diff --git a/fonts/Tuffy-Bold.ttf b/fonts/Tuffy-Bold.ttf
new file mode 100644
index 0000000..9df0646
--- /dev/null
+++ b/fonts/Tuffy-Bold.ttf
Binary files differ
diff --git a/fonts/Tuffy-BoldItalic.ttf b/fonts/Tuffy-BoldItalic.ttf
new file mode 100644
index 0000000..e409820
--- /dev/null
+++ b/fonts/Tuffy-BoldItalic.ttf
Binary files differ
diff --git a/fonts/Tuffy-COPYING b/fonts/Tuffy-COPYING
new file mode 100644
index 0000000..17f5c79
--- /dev/null
+++ b/fonts/Tuffy-COPYING
@@ -0,0 +1,5 @@
+I have placed these fonts in the Public Domain. This is all 100% my
+own work. Usage is totally unrestricted. If you want to make
+derivative works for any purpose, please go ahead.
+
+-Thatcher Ulrich <tu@tulrich.com> http://tulrich.com
diff --git a/fonts/Tuffy-Italic.ttf b/fonts/Tuffy-Italic.ttf
new file mode 100644
index 0000000..f4724ef
--- /dev/null
+++ b/fonts/Tuffy-Italic.ttf
Binary files differ
diff --git a/fonts/Tuffy-Regular.ttf b/fonts/Tuffy-Regular.ttf
new file mode 100644
index 0000000..4d7a4c7
--- /dev/null
+++ b/fonts/Tuffy-Regular.ttf
Binary files differ
diff --git a/fonts/TuffyInfant-Regular.ttf b/fonts/TuffyInfant-Regular.ttf
new file mode 100644
index 0000000..a1aef1f
--- /dev/null
+++ b/fonts/TuffyInfant-Regular.ttf
Binary files differ
diff --git a/fonts/TuffyScript-Regular.ttf b/fonts/TuffyScript-Regular.ttf
new file mode 100644
index 0000000..916b506
--- /dev/null
+++ b/fonts/TuffyScript-Regular.ttf
Binary files differ
diff --git a/lib/willora_pdf_converter.rb b/lib/willora_pdf_converter.rb
new file mode 100644
index 0000000..8fb9d4a
--- /dev/null
+++ b/lib/willora_pdf_converter.rb
@@ -0,0 +1,19 @@
+#
+# WilloraPDF
+# Charlotte Koch <dressupgeekout@gmail.com>
+#
+
+# With guidance from:
+# - https://docs.asciidoctor.org/pdf-converter/latest/extend/create-converter/
+# - https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#custom-thematic-break
+class WilloraPDFConverter < Asciidoctor::Converter.for('pdf')
+ register_for 'pdf'
+
+ # My custom thematic break, which is just a blank space the size of the main
+ # font. (The default thematic break draws a horizontal rule.)
+ def convert_thematic_break(node)
+ theme_margin(:thematic_break, :top)
+ move_down(theme.base_font_size)
+ theme_margin(:thematic_break, ((block_next = next_enclosed_block node) ? :bottom : :top), block_next || true)
+ end
+end
diff --git a/mk/willora.mk b/mk/willora.mk
new file mode 100644
index 0000000..b459c93
--- /dev/null
+++ b/mk/willora.mk
@@ -0,0 +1,57 @@
+#
+# willora.mk
+# Charlotte Koch <dressupgeekout@gmail.com>
+#
+
+# XXX this should be generated w/ a configure-step?
+WILLORABASE?= ${.CURDIR}
+
+NAME?= mybook
+PDF_OUT?= ${NAME}.pdf
+ADOC_TOTAL= ${NAME}.adoc
+
+BUNDLE?= bundle
+THEME?= poppy
+THEMEDIR?= ${WILLORABASE}/themes
+FONTDIR?= ${WILLORABASE}/fonts
+MEDIA?= prepress
+
+CUSTOM_PDF_CONVERTER= ${WILLORABASE}/lib/willora_pdf_converter.rb
+
+########## ########## ##########
+
+# XXX: Figure out why I can't do this:
+# 'asciidoctor-pdf -a optimize'
+# > GPL Ghostscript 9.50: Can't find initialization file gs_init.ps.
+# https://docs.asciidoctor.org/pdf-converter/latest/optimize-pdf/
+
+${PDF_OUT}: ${THEMEDIR}/${THEME}-theme.yml ${CUSTOM_PDF_CONVERTER} ${ADOC_TOTAL} Gemfile.lock
+ ${BUNDLE} exec sciidoctor-pdf \
+ -v \
+ -r ${CUSTOM_PDF_CONVERTER} \
+ -d book \
+ -o ${.TARGET} \
+ -a pdf-fontsdir=${FONTDIR} \
+ -a pdf-theme=${THEME} \
+ -a pdf-themesdir=${THEMEDIR} \
+ -a media=${MEDIA} \
+ -a text-align=justify \
+ ${ADOC_TOTAL}
+
+${ADOC_TOTAL}: ${CHAPTERS}
+ rm -f ${.TARGET}
+.for chapter in ${CHAPTERS}
+ dos2unix < ${chapter} | sed -E \
+ -e 's,[[:space:]]--[[:space:]],\&\#8212;,g' \
+ -e 's,\&eacute;,\&\#233;,g' >> ${.TARGET}
+ printf '\n\n' >> ${.TARGET}
+.endfor
+
+Gemfile.lock:
+ ${BUNDLE} install
+
+########## ########## ##########
+
+.PHONY: clean
+clean:
+ rm -f ${PDF_OUT} ${ADOC_TOTAL}
diff --git a/themes/poppy-theme.yml b/themes/poppy-theme.yml
new file mode 100644
index 0000000..e17c1a5
--- /dev/null
+++ b/themes/poppy-theme.yml
@@ -0,0 +1,105 @@
+#
+# WilloraPDF
+# "Poppy" Asciidoctor PDF theme
+#
+# - IngramSpark 5.25"x8" Perfectbound (paperback)
+# - Using my edition of "The Poppy War" as a template
+#
+---
+
+extends: base
+
+font:
+ catalog:
+ merge: false
+ EBGaramond:
+ normal: EBGaramond08-Regular.ttf
+ italic: EBGaramond08-Italic.ttf
+ bold: EBGaramond12-Regular.ttf
+ WaterGothic:
+ normal: WatGoth1.ttf
+ italic: WatGoth1.ttf
+ bold: WatGoth1.ttf
+ Cabin:
+ normal: Cabin-Regular.ttf
+ italic: Cabin-Italic.ttf
+ bold: Cabin-Bold.ttf
+ Tuffy:
+ normal: Tuffy-Regular.ttf
+ italic: Tuffy-Italic.ttf
+ bold: Tuffy-Bold.ttf
+
+running-content:
+ start-at: 4
+
+page:
+ layout: portrait
+ margin: [0.75in, 0.5in, 0.5in, 0.5in]
+ margin-inner: 0.5in
+ size: [5.25in, 8in]
+ numbering:
+ start-at: 4
+
+base:
+ font-color: #000000
+ font-family: EBGaramond
+ font-size: 12pt
+ line-height: 1.25
+
+title-page:
+ text-align: center
+ title:
+ font-family: WaterGothic
+ font-size: 34pt
+ authors:
+ font-size: 16pt
+
+prose:
+ text-indent-inner: 12pt
+ margin-bottom: 0
+ margin-inner: 0
+
+verse:
+ font-family: EBGaramond
+ border-left-width: 0
+
+heading:
+ h1:
+ font-family: Tuffy
+ font-style: normal
+ text-align: center
+ margin-page-top: 2.0in
+ h2:
+ font-family: Tuffy
+ font-style: normal
+ text-align: center
+ margin-page-top: 1.0in
+ margin-bottom: 0.5in
+
+# "Real" Poppy style
+header:
+ font-family: Tuffy
+ font-size: 9pt
+ height: 0.75in
+ line-height: 1.0
+ verso:
+ left:
+ content: '{page-number}'
+ center:
+ content: 'CHARLOTTE KOCH'
+ recto:
+ center:
+ content: 'THE WOLFSKULL STANDARD'
+ right:
+ content: '{page-number}'
+
+# Plain style
+#header:
+# height: 0.75in
+# line-height: 1.0
+# verso:
+# center:
+# content: '{page-number}'
+# recto:
+# center:
+# content: '{page-number}'