jpakkane / chapterizer

A book generator
Apache License 2.0
23 stars 0 forks source link

Book PDF creator

This repository contains code to create a print-ready PDF and epub versions of a book written in a custom "markdown-esque" syntax.

The core algorithm is a global line splitter algorithm (like Knuth-Plass but not really). There is also a GUI tool for testing its behaviour with different fonts, chapter widths et al.

The code only works with latin text. This is because the point of the code is to create aesthetically pleasing results rather than "correct". The aesthetic requirements for languages that use totally different writing system like CJK, Arabic and Kannada are such that they would probably require their own custom algorithms. This might even be the case for "latin-like" scripts like Greek. At the very least they would need to be written by a native speaker.

Other limitations include:

Building and using

The program depends on GTK 4 and libhyphen. On debianlike distros they can be installed with:

sudo apt install libhyphen-dev libgtk-4-dev

Building is done in the standard Meson way:

<do a git checkout and cd into it>
mkdir builddir
cd builddir
meson ..
ninja
./guitool