Because of that, I’ve always seen myself as a publisher first and then everything else second.
This, particularly the second point. I’ve seen myself as a publisher for a long time now as well, with all the books and language charts and magazines and even the art. And the web makes publishing so, so easy. It’s magical. Instant worldwide distribution. (Well, instant for the digital things I make.)
His first point has stuck with me as well — I’ve tended to think of my site mostly as a place to publish PDFs and EPUBs and images and other files I’ve made, but I like the idea of the web as the actual delivery mechanism, for more than just blog posts. This isn’t a new idea, of course; it’s just something I haven’t been thinking about as much till now. I’m looking over the type of things I’ve made — books, languages charts, etc. — and thinking what it would be like if the end product were a web page instead of a PDF or an EPUB. And of course nowadays I’m using HTML/CSS as the source for all three main formats for books (web, EPUB, PDF), so it doesn’t necessarily have to be either/or.
Anyway, nothing specific in mind yet. We’ll see what comes of it.
Introducing Life of Theseus, from Plutarch’s Lives of the Noble Greeks and Romans. Available as a free PDF download.
Making-of notes
It’s set in LfA Aluminia, a resurrected version of Electra. I enjoyed this article about the making of the typeface.
Chrome still has the bizarre copy-paste issue in macOS Preview, so I used Firefox. But Firefox doesn’t yet support hyphenate-limit-chars, sadly. I decided not to stress about it.
It’s left-justified since browser justification still isn’t great and I didn’t want to spend eons fine-tuning the spacing. I did, however, tweak word-spacing to eliminate hyphens at the ends of pages and most widows and orphans (though I wasn’t fully strict here). Also manually inserted ­ to insert hyphens as needed (mostly in the Greek names — and I probably got some of those wrong but I did try my best) and turned off ligatures that crossed hyphenation breaks (“ff”).
I used Paged.js, which generally worked well. Whenever I made changes, though, reloading the page and finding my place again (usually by cmd+f with some string of text) started getting laborious. Thinking about either building a Firefox extension that maintains scroll position even on hard refresh or building an Electron app that does the same.
Not sure yet if I’m going to continue on with typesetting the rest of the Lives, but hopefully I do.
This time the chart doesn’t have a specific year baked in, so it’s reusable. (And there’s a variation for leap years.) It’s freely available as PDFs in both portrait and landscape. Currently just letter size, though maybe someday I’ll start including A4 and other sizes.
Colophon: I made these charts with HTML (it’s just a table), CSS, JavaScript (on page rather than via Node), and Firefox. The font is Avenir Next.
After what feels like a long absence from bookmaking, I’ve gotten back into it and have a new release: Historia Calamitatum, available as a PDF.
The book is a medieval autobiography by Peter Abélard, a Catholic philosopher who lived in the eleventh and twelfth centuries in France.
Some notes on the making, for those who like that sort of thing:
I used paged.js for the typesetting, so I was editing HTML and CSS files instead of wrangling InDesign or Affinity Publisher or LaTeX. It’s a different workflow, to be sure (lots of reloading in Chrome and then finding my spot again), but overall I love having the source files be plain text.
The line-breaking algorithm isn’t as nice as InDesign’s. Had to finagle the word-spacing and letter-spacing properties a bit to fix some more egregious spots. (At the same time, I wasn’t fixated on making the spacing perfect. Nor did I fix the hyphenation stacks, because they don’t bother me. I’m clearly becoming a bit more relaxed about typesetting rules as I get older.)
For the typeface I went with IM Fell DW Pica, which is no doubt anachronistic but I like the feeling it gives the book.
I proofed the PDFs in the Documents app on my iPad. Much nicer than printing the whole thing out (which I used to do, years ago).
I made the cover using Cirque with textures applied in Affinity Photo.
Update on Press (the PDF compiler). I haven’t worked on it at all lately, but I wanted to document its current state for history’s sake, and as part of working in public. (I’ve also been sitting on this post for over a year.)
Back in 2017 I did end up re-architecting Press to use Low Ink as an intermediate page description language. In the process, Low Ink changed from a JSON-based idea to this:
It was intended to be a fairly low-level wrapper on the PDF format, with the idea being that other libraries/apps would provide more ergonomic abstractions on top of it.
I initially used Python because Press started out as a library, but with the pivot to a compiler model, I think Go or Rust would probably end up being a better choice (Rust would make integrating HarfBuzz a bit easier, at any rate).
Potential improvements
To my 2021 eyes, the language design isn’t particularly elegant. I like that the parameters are named (clarity), but for most of the commands there aren’t actually that many parameters, because many of the settings that would normally be parameters are separate commands. For parameters that are clearly unambiguous, the names hamper readability. For example, I think something like this might be better:
:line 0,0 to 1080,0
:fillcolor #345
I’ve also thought that push and pop could potentially be clearer as curly braces, and that the initial colons aren’t really necessary:
{
translate 0,1040
strokecolor #999
linewidth 0.25pt
line 0,0 to 1080,0
stroke
{
fillcolor #999
font 14pt helv
text 1085,-3 "ascender"
}
}
The future
My initial reason for building Press was to have an easy, programmable cross-platform way to create language chart PDFs (so I could move away from PlotDevice/DrawBot), and what I’ve realized (acknowledging that I haven’t really been making language charts in recent years) is that there are some other, better options now.
One that seems decent is SVG, converted to PDF by way of Inkscape. Initial tests here seem like it would probably work fine.
Another promising option that I admittedly haven’t looked into very much yet is Paged.js. HTML and CSS are already great for declarative typesetting, and the more I’ve thought about programmatic typesetting, the more this model seems to be the future I’d want to work with (and not just because of parity with web, though that makes it much more compelling).
tl;dr I don’t see myself continuing on with Press, so we may as well call a mortem on it.
Progress on Press has been a bit slower lately. I’ve fixed most of the errors I discovered by running the exported PDFs through the 3-Heights PDF validator. I also refactored the code and reorganized the package per Kenneth Reitz’s advice.
I’ve implemented initial support for embedding subsetted fonts (doing the subsetting via fontTools.subset), and while the fonts (including uninstalled fonts) display fine on my macOS box, the PDFs don’t validate properly and the fonts don’t show at all on iOS, which means the embedding isn’t actually working right. Current suspects include the /Differences array (which I’m not generating properly yet) and the CMap (which I haven’t implemented at all yet). I still have to implement ToUnicode as well, so that copying and pasting does what it should, but I’m fairly certain that isn’t what’s causing the fonts to not embed properly.
I’m also trying to figure out color spaces. In general I believe I want the output to be either DeviceRGB or DeviceCMYK, with some way of specifying an output intent, and also an option for the user to embed an ICC profile if they want. I’m part of the way there.
Anyway, the font stuff is far more complicated than I expected going in, but I’m still making progress, and I’m learning a lot.
Font maps are admittedly extra work, but they do have some advantages as well: you can use fonts you haven’t installed, for example, and you can specify exactly which font files you want to use. And I can’t see any good way around the lack of a cross-platform font selection mechanism (meaning, a way to pass in ‘Minion Pro’ with specific weight and styles, and get a font filename in return).
Anyway, I’m in the middle of reading the PDF spec on CIDFonts and CMaps. It’s … complicated. It makes my head hurt. But it’ll be awesome when it’s done.
I’ve renamed inkpdf to Press (as in printing press).
I reached the point where creating the PDF manually is no longer feasible, so I’ve been working on getting Press to a point where I can implement the PDF generation. The basic structure is in place, sans the PDF part. (That’s next.)
Here’s what a Press script looks like right now:
from press import Press
p = Press('output.pdf', width=6*Press.INCH, height=11*Press.INCH,
margin=1*Press.INCH)
# Horizontal borders at top and bottom of page
p.stroke('#000')
p.pen(1.0)
p.line(p.page_min_x, p.page_min_y, p.page_max_x, p.page_min_y)
p.line(p.page_max_x, p.page_min_y, p.page_max_x, p.page_max_y)
# Page 2
p.page(2)
p.layer('base')
p.stroke(rgb=(1, 0, 0))
p.line(150, 150, 300, 300)
p.layer('fg')
p.stroke(hsl=(0, 0.5, 0.8))
p.line(300, 300, 450, 150)
# Go back and add another line to page 1
p.page(1)
p.stroke('#025')
p.line(p.page_min_x, p.page_min_y, p.page_min_x, p.page_max_y)
p.save() # this doesn't work yet
You can also do something like this:
with Press('output2.pdf', size=Press.LETTER,
margin=(0.5*Press.INCH, 1.0*Press.INCH),
inner_margin=0.5*Press.INCH,
outer_margin=1.25*Press.INCH,
bleed=.125*Press.INCH) as p:
p.line(50, 50, 250, 50)
# And so on
(Context manager, inner/outer margin, bleed, built-in paper sizes.)
Up next: adding more primitives, designing the font selection mechanism, getting it to generate an actual PDF, embedding fonts, using arbitrary Unicode code points, integrating HarfBuzz, etc.