Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Rendering

Dave Cramer edited this page May 18, 2017 · 26 revisions

Rendering

Image Bleeds

A common request for reflowable EPUBs is for images to "bleed"—extend to the edge of the screen, analogous to how images in print can extend to the very edge of the paper. This is possible in FXL EPUBs, where content is absolutely positions, and reading systems historically haven't reserved as much space for reading system "chrome".

A few use cases could be supported simply by mixing FXL and reflowable content in the same EPUB, which is allowed by the specs. Most reading systems don't support this. But many more use cases involve images in reflowable EPUBs.

Designing such a feature is quite complicated, because we're asking that our content display in space that's historically been reserved to the reading system. Would bleeding images obscure reading system controls?

Even the technical design of such a feature is not obvious. We're asking images to be positioned at the top or bottom of a page, which is defined in the (unimplemented) CSS Page Floats spec. This seems like a good starting point, although the spec currently doesn't support floating to page corners (top+left). But the "bleed" aspect isn't necessarily a good fit for CSS, given that this isn't an issue for the larger web platform. In some ways it's like a processing instruction, but those don't seem to have survived the transition from SGML to HTML. Custom attribute, perhaps?

Implementation would be challenging, as well. EPUB reading systems typically display author content inside a div or frame, with unknown styling applied both outside and inside the frame.

Use cases

  1. Full-page image, extends to the edge of the screen on all four sides.
  • what happens when the image doesn't exactly fit the screen? Aspect ratio must be preserved (always?)
  • controls for both vertical and horizontal alignment?
  • control over background color for where image doesn't fit?

Mathematics

(placeholder for interoperable, accessible solution. The pressure is on, Benetech! 😀)