Book Chapter Images
 
On Saturday, I looked at Walter's Deal (because that's the only thing I look at currently) and realized I should finally work on the chapter titles.

Since I'm using roman numerals, I thought, hey, maybe I could draw them, so they're in the same style as the font in the cover. No big deal, I'd just have to draw all 98 chapter images. BY HAND.


Nah. I realized I could just leave them as they are. Hmm.


But then my brain said, what if...


What if I wrote a Perl script that would generate images based on the numbers I'd feed it? Say, for example: chapter_images.cgi?numbers=XIV


It would automatically add the letters, adjust the size according to the overall letter width, and I could even create, say, four variations of each letter for the script to choose from, and adjust it so, that each letter variation is used only once per chapter image. That way, I'd have to draw, oh, about 20 tiny images.


Okay, but then what? Do I have to manually insert 98 images by hand? Sure, I can do that. I've done worse, like updating 200+ entities for the chess puzzle in Halfquake Sunrise.


Nightmares.


But what if something's wrong and I want to update the already inserted images? Do I want to do that, knowing that I won't be happy with the images for at least five tries?


Nevermind then. I'll be happy with the current chapter titles, just make them a bit bigger, choose a different font, color them gray...


But what if...


Let's see here. I'm already working in Google Docs. What if there's some kind of search and replace that would allow me to search for "PART (.*)" and replace that with ... some weird code that fetches an image via URL and...


Nevermind. Actually, you know what, brain, these chapter titles in plain text aren't that bad. I'll just publish it like this and...


Hang on... What's this? Tools... Script editor?


Well, hello there, Google Apps Script!


Turns out, I can totally write code that looks very similar to Javascript, and search for the current chapter titles and replace them with images. It even allows me to fetch URLs to insert images on the fly. And I also found a nice little function that romanizes my counter variable, so I can feed these Roman characters to my Perl script that I mentioned earlier.



It worked!


But wait... these hand-drawn chapter images totally clash with the font used for the actual story. As my significant other puts it, they look wobbly.


At this point I redid the chapter letters three times, this time in Flash.


The end result...


... is waiting for you in the finished book. (Coming soon™)


^.^