Further Thoughts On KF8

Now that I've been working with KF8's fixed-layout awhile, I thought I'd share a trick or two I've learned in case you're interested. Like Apple's iBooks, KF8 has a lot of quirks and peculiarities all its own, but if you learn the way it works then you can often find a way to bend the rules.
ORIENTATION LOCK
Although the Kindle Publishing Guidelines state that the two available options for the "orientation-lock" metadata entry are either portrait or landscape, you can actually enter "none". This disables the lock and allows the content to reorient to the tablet's current position. This would seem most useful with reflowable content since, of course, with fixed layout the aspect ratio is set, and while the content will auto-zoom or shrink to fit the screen, it does so to the longest edge. This makes a page in portrait layout very small in landscape. However...
ZOOMING IMAGES
There are two alternate ways to insert images into KF8, as indicated in the samples provided for Children's Books and Comics. In the former a div element is created with an id that references the image source in the related css. In this mode the image is locked within the div block, and only content inserted into an overlaid region mag element can be zoomed. However, in the comic sample, the background image is simply referenced using standard html img src= tags. This allows for the region zooming feature which magnifies a specific area of the background image within a defined mag target frame. The magnification is actually created by restoring an oversized background image to its actual size (the image on the screen being shrunk to fit), with the frame acting as a window that lets you view only the selected area at full resolution.
But you don't have to create a window to do this at all. If you simply double-tap on an area of the background image that's not covered by a mag target tap zone, the entire image will "zoom" to the only window available: the Kindle Fire screen itself. Any text overlays will disappear, leaving only the selected image, with a circled X in the upper-right corner to facilitate exiting the zoom mode. While in this mode you can use pinch-and-zoom to view the image larger, rotate to either orientation (if the lock has been set to "none" as mentioned above), and drag the image around the screen with your finger. With the image size now upgraded to 800kb, this allows for images of relatively high quality at 1024x1748 - the width of the display screen in landscape orientation, and nearly three times the height. This seems a natural size for the full resolution image, since you can view full width in landscape and scroll up and down to see the rest of the image.
Unfortunately, the Fire is not as advanced as the iPad in having the cool "snap back" feature which keeps the image from being zoomed larger than the chosen viewport size. Still, this provides a way for the user to view and scroll the entire background image at a higher resolution without resorting to smaller cropped sections. Those, of course, can be added as well, so long as an obvious area remains where the background can be double-tapped (and the user knows the feature is available).

TEXT WRAPPING
My primary goal with KF8 fixed layout at the moment (and iBooks as well) is to create text that appears to wrap around images when in fact there is no text wrap feature available in the Kindle code other than around square boxes. To my mind the ability to wrap around complex objects is one of the fundamental advantages of Pages and the new iBooks Author drag-and-drop feature, and one for which I'm nearly will to cave in and buy a Mac. Still, there are ways around it in KF8.
While KF8 does not allow the use of left/right: #px; tags within mag target boxes, you can replace them with margin-left / margin-right tags instead, or text-indent for left indentations only. But in order to do so you will need to wrap each individual line of text in <p> tags and position them each separately. In the image to the right, for example, the first full paragraph is set to text-align: justify, but each line after that is a separate paragraph, positioned using either right-align (plus some word-spacing and/or letter-spacing to adjust the line width to my liking), or the default left alignment with an indent or left margin setting for just that line. This requires separate line entries in the css (i.e. p.line3 {...), each of which can then be individually manipulated.
This is somewhat tedious, to be sure, but the end result appears to be a text wrap function that does not, in fact, exist. In actuality, there is no image to wrap the text around, since the figure is simply part of the background.
TEXT SHADOWS
While KF8 (and iBooks as well) allow for text shadows in the css, they only allow for one. In other words, you cannot create complex, multi-color shadows using multiple, sequential text-shadow entries. Both KF8 and iBooks will only recognize and last entry given, which overrides any others entered above it. For my current project I required both a dark text shadow to offset the text against light areas of background color, as well as a glow layer to lighten darker areas behind the text. This was achieved by using multiple duplicated text layers on a z-index stack. The top layer has a fairly dark green drop shadow (1px 1px 3px #185244), while the bottom (otherwise identical) text layer provides a large light green surrounding glow, centered on the text rather than offset (0px 0px 40px #edffe7). I had already lightened up the text area somewhat in the background image itself, so not all of the lightening seen in the image above is from the text glow, but any stray dark areas are evened out somewhat and the text rendered more easily readable by its higher contrast with the background art.
ZOOMING TEXT
Below is a shot of my current Ring Saga project with the text zoomed in the Kindle Fire on the left and the same page seen in its full two-page spread on the iPad on the right. While you can retain the shape of wrapped text in the zoomed text box, you can also format the mag target separately, which I've done here, using fully justified text over a parchment backdrop. This gives the user the option of reading the text in something closer to a standard book layout, while also being able to view the art layout. Instructions for doing this are in the Guidelines, but I thought I'd offer an example of what I've done. It's certainly not as ideal as the iPad's ability to zoom fixed layouts to any size desired using pinch-and-zoom, but it's better than no option for enlarging text at all.

And while I'm on the subject of text, the function I'm most disappointed with in KF8 fixed layout is not having access to dictionary definitions by tapping words. Without that feature the purpose of embedding live text is virtually rendered null and void, particularly given that the search functionality is disabled as well. The only reason I can see for going to all the trouble of adding live text is in the hopes that Amazon will get its act together and fix these issues at some later date. For the time being, however, KF8 is little more than a PDF that's really frigging hard to make.

Published on February 19, 2012 20:29
No comments have been added yet.