↑↑↑ Home ↑↑ Hardware ↑ Iliad  

An HTML and plain text serial document reader

Existing reader -- Requirements -- Serialreader

Problems with the existing HTML reader

The Iliad comes with a Firefox port that is used to display HTML files by default. Unfortunately it has a number of problems. Some HTML pages are displayed only partially, with parts off the screen. Worse, when frequently closed and re-opened, this variant of firefox sometimes displays Chineses characters, completely unknown glyphs and what looks like its own symbol table (a sure sign of rogue pointers). In other words, it is comprehensively broken.

Though the firefox port probably works well for most applications, it seems it was included mainly to be able to claim to support another file format. It is far less suitable to a system as small as the Iliad than the text-based and graphical browser links, for example. Besides, viewing serialised documents (as is common in web fiction) comfortably benefits from some dedicated features that ordinary browsers do not have. This led me to write my own reader program (after all, what is open-source technology for if not customising?).

Requirements and design of a serial document reader

The main difference of a HTML viewer for serialised texts and a run-of-the-mill browser is that the former should make it easy to switch between successive files in the series. In fact, it should be (almost) as easy as flipping pages, as successive files are read in sequence. Hyperlinks between files may not be functional after downloading them, so they cannot be relied on and the sorting order of files should be used instead. Slightly more advanced required features are jumping to specific files and to a position in the current file, and a history of positions jumped to. These considerations lead to the following button bindings:

Button Function for short press Function for long press
"Stair" arrow up Quit (standard for all viewers)
Page flips Page up / down within a file To top / bottom of file
Up arrow Previous file To first file
Down arrow Next file To last file
Bullet Jump between lalatt and previous history position Jump between latest and earliest history position

Going forward and backward in the history is handled by the standard icons the icon bar provides for that purpose. This requires the stylus and is therefore less comfortable than the buttons, but this feature is likely to be needed less frequently than flipping pages, as the text is expected to be read sequentially.

Fonts are installed as bitmapped fonts, which is a decision favouring processing power (and therefore battery life) over flash disk space. So as not to fill up the system partition too much, they are installed into /mnt/free, the partition also used for e-books. The fonts were derived from the scalable FreeFonts available under GPL. Italic and bold font faces are supported, and standard icons are used to allow changing the font size.

A further question is how exactly to handle file lists, or how to determine which files are part of a series. The simplest solution is to always include all files in a directory. So the reader can continue where they left off, the current position is saved in a configuration file during program termination. There is a potential problem here: A viewer application is always started by the content lister with a single file name as a command-line argument, so it is not possible to know if the user wanted to read that file or continue from last time. This dilemma is solved in two ways: Normally the file passed on the command line is displayed but the file and position from last time is entered into the history, so that it is only a press of the bullet button away. In addition, the serialreader is associated with another file extension besides .html and .txt. This allows to create a dummy file with which a directory can be associated via its manifest.xml file. If this file type is given on the command line, serialreader does not load that file, but the one from last time instead. A directory containing a sequence of files can then be treated like a compound document, as it should.

The serialreader viewer program

The serialreader was implemented to behave as described above, in the process factoring out a simple API. If you are interested, download this tar archive, which includes instructions for compiling and installing:

Get serialreader sources

TOS / Impressum