Books, Sugar and OLPC

Articles and posts like this (and subsequently this) underline the need for a status report about ebook-reading in Sugar and in the XO laptops. For the past few months, apart from my usual duties, I have been working on the book-reading stack for OLPC and Sugar, and this may be viewed as a progress report of the things I have been doing.
I have been mostly working on the Read Activity in Sugar, which is supposed to do the most heavy lifting as far as book-reading goes – though there is also ReadEtexts by Jim Simmons, which primarily handles plain text files from Project Gutenberg (the latest version of ReadEtexts supports RTF files as well). Currently, the ebook formats that are supported in Sugar include

  • Epub
  • PDF
  • DJVU
  • Plain Text (specifically the format used by Project Gutenberg)
  • Postscript
  • CBZ
  • RTF

There also exists a sugar-ified FBReader, with support for more formats (such as plucker and non DRM’ed mobipocket).
With the last major release of Read (a part of Sugar 0.86), apart from the addition of Epub support, there has been usability improvements and tweaks (particularly for the full-screen mode), as well as support for bookmarks (notes can be associated with each bookmark).

For the next major release, I have started to work on support for highlighting text (at least in Epub files) and better usage of the XO “game-keys” in fullscreen mode (so that the overall experience in tablet mode of the XO laptops become smoother). Interestingly, highlighting text did not work out as I had planned, since the highlights became almost invisible in the grayscale reflective mode of the XO laptops. So instead of highlighting, Read would probably support underlining of text (when I was a kid, we often shared books, especially school books, and I was told it is always better to underline with a pencil than to use a marker pen to highlight ;-) .
Read Highlight
Of course, Read is only one part of the book-reading puzzle. There has to be a system in place for book acquisition as well (from the Internet as well as from a local schoolserver, if available). In a previous blog post, I mentioned Open Publication Distribution System, which is built upon the Atom syndication format to allow online book distributors to publish their catalog. I extended Jim Simmon’s Get Internet Archive Books activity to support OPDS, and now, apart from the Internet Archive, the preview version that I have can also retrieve books from Feedbooks. Here’s a video of the activity in action:

The next major step would be to implement a server side OPDS implementation in the School Server (XS), as well as some kind of caching mechanism to conserve bandwidth (if a copy of a book is found in the school server, it should be downloaded instead of the online version).
To keep up with the progress, you can either subscribe to the sugar-devel list or the more specialized (and low volume) olpc-bookreader list.

Updates..

This blog has not seen much activity in a while, so here goes:

  • Bought a HCL touch-screen based netbook. It’s somewhat ancient hardware, but most of the stuff works out of the box (except for the webcam, which does not even show up in lshal or lsusb). The touchscreen required a binary driver – but a Free/Open Source version seems to exist, though I could not get to calibrate the screen with the FOSS driver variant
    [Update: The webcam works - I had to press Fn-F5 to enable it. It is turned off by default to conserve battery.]
  • Taught myself (this was long overdue – but at least now I can admit that I did not know what I used not to know) how to properly write Python extensions in C. I started out with bindings for Hunspell (I’m reading up a bit on morphology nowadays, and finding it to be tremendously entertaining). There was a Python extension for Hunspell already, but it did not compile for me, and that pushed me to decide to figure out how to do this myself. One thing led to another, and so, as of now, there is (in progress) extensions for handling:
    • Hunspell. Usage instructions here
    • libgettext-po. This should be faster than the existing pure Python based PO file parsers out there. (maybe at some point, I could make Pootle/Translate Toolkit use this, and make the work of OLPC/Sugarlabs translation team members somewhat less frustrating.
    • XKB. I must admit that I took a shortcut for this, and this extension is actually based on the awesome libxklavier. The final plan is to develop a Sugar extension for managing the keyboard options and layouts using this extension. The code in the main git repository, though fairly complete in terms of what is required for Sugar at the moment, is not implemented via (py)gobject. Implementing the pygobject-based wrapper is turning out to be a bit more complicated than I initially thought, but some code for that is also available in this repository (it is somewhat easier now, since I know (at least most of of) what is happening under the hood).
  • Released a newer version of the FBReader activity, which is much more improved in terms of usability (eg: response to the game keys keys while the XO-1 is in tablet mode is much more smoother, and all the keys do something useful). People seem to be happy with the new release.
  • Coming back to the present, right now, among other things, I’m working on a few interesting (and important) enhancements for the book-reader(s). Some of them include support for long keypresses (eg: pressing the “square” game key for two seconds will show the table of contents), notification of critical power events (I realized to my horror during dogfooding, that in tablet mode, while the book reader is open in full screen, there is no way to tell how much battery-charge is left), etc. The bookmark support feature that I came up with a few months back needs a bit of polish, but I think I can make this show up in the next release of Read.