Skip to content

jpakkane/chapterizer

Folders and files

Image for: Folders and files
NameName
Last commit message
Last commit date

Latest commit

Image for: Latest commit
 

History

Image for: History
337 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image for: Repository files navigation

Book PDF creator

This repository contains code to create a print-ready PDF and epub versions of a book written in a custom markdownish syntax called bookdown.

The core algorithm is a global line splitter algorithm (a fairly heavily tweaked Knuth-Plass). 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" ones. The aesthetic requirements for languages that use a 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:

  • mixed-direction texts are obviously not supported

  • the GUI is very utilitarian "engineering UI", it might cause eye bleeding in people sensitive to UI purism

  • hyphenation only supports English and Finnish

  • there are some weird bugs, patches welcome

  • probably only works on Linux because it uses Cairo, GTK 4, Fontconfig et al quite heavily

  • some visual aspects are defined in the code itself rather than the JSON conf file as the current main use case is to generate my own books rather than provide a fully general tool

Building and using

Image for: Building and using

Add dependencies with:

sudo apt install libhyphen-dev libgtk-4-dev libtinyxml2-dev libvoikko-dev

Building is done in the standard Meson way:

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

Then run either the GUI tool:

./guitool

Or process a book json:

./bookmaker ../testdoc/sample.json

About

Image for: About

A book generator

Resources

License

Stars

Watchers

Forks

Releases

Image for: Releases
No releases published

Packages

Image for: Packages 0
No packages published

Languages

Image for: Languages