Sudoku Book Layout Generator is Almost Done
April 13, 2006 7:45 pm Gaming, My Stores, SudokuI’m looking for beta participants for my PC client! See http://blog.sc.tri-bit.com/archives/151.
So I’ve been writing a small app to eat my puzzles and spit out a preformatted book. That way I can just make puzzles, test them, dump them in a directory and have them automatically rolled into a book for me.
The basic version of the app has actually been working for quite a while; it was almost the first thing I did when I decided to make sudoku books. However, there are a lot of things that needed to be done, which had not yet been done; I’ve been working on them, and now the book generator is very nearly done. The books may in fact be up tonight or tomorrow.
The things that were already working:
- Accept page layout engines
- Place puzzles within page layouts
- Draw puzzles as normal or solution (removes the background color from givens and changes line thicknesses)
- Select puzzle type from book script
- Select page type from book script
- Set page layout from book script
- Accept page shape metrics from book script
- Draw normal sudokus (arbitrary size)
- Draw puzzle titles
- Best-fit puzzles to page
- The cover art
Things I got done yesterday:
- The Instructions Page
- The Copyright/ISBN Page
- The Title Page (artist)
- The Chapter Title Pages (artist)
- A 6×10 puzzle layout for compact solutions pages (still readable, surprisingly, and you can find things by title just fine)
- The actual book layout
Things that are newly working as of today:
- Placeholder page support, so that gutters will be correct even for pages where generation isn’t expected
- Support for various placeholder types with slightly different rendering behaviors
- Support for arbitrary text rendering within placeholder pages
- Automatic solution page generation including walking the existing puzzle stack without changing the puzzle draw pointer
- Support for passing alternating page states around
- The required trailing blank page (huhu yeah that was real hard)
Things that I need to finish in order to have a usable result:
- Automatic gutter support. The page metrics are in place for this; I just need to do a little boring API update stuff to get a page handler to be able to tell whether it’s on an even or odd page. I’m gonna try to get this done tonight.
- Chapter title page generation. I have the template done, but I need to work out some stuff about fonts and placement, then go through the process of converting my artist’s design into procedural behavior. This is going to suck, and I will probably skip this and do it manually on the first few books.
- Suppress page numbers on certain pages (title pages, special pages, solution pages.) I’m gonna try to get this done tonight too.
- Reset page number to 1 for first chapter title page, to skip numbering for front matter (copyright page, etc.) Another thing for tonight.
- Support for multiple puzzle stacks, to remove title and endcap puzzles from the primary puzzle stack, to unify solution pages (this is going to suck badly, and I’m certainly putting this off for later books. My god am I putting this off.
- The Other Products Page. Not entirely sure about this one.
- The Site Promo Page. Not entirely sure about this one either.
Anyway, not long yet. Closer and closer.
