Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : A little about the FictionBook 2.0 format


rsperberg
01-21-2006, 05:02 PM
I guess I'm kind of slow, but it was only a couple days ago that I realized that the FictionBook 2.0 authoring format is also the format that the e-readers use for rendering.

Marking up text is similar to putting it into HTML, except the tags are XML, they only overlap html partially, not wholly, and there are very specific ways you need to treat your footnotes. And of course being XML, the order of tags and what can go where is very strictly regimented in the W3C XML schema file (which probably makes things easier to construct an FB2 e-reader).

I won't go into the nature of the FB2 file here -- you can find a pretty complete description at haali.cs.msu.ru/pocketpc/FictionBook_description.html (http://haali.cs.msu.ru/pocketpc/FictionBook_description.html), written by the author of one of the Windows FB2 e-readers (the Haali e-reader), who also is in some part responsible for the FB2 format. The biggest difference is in how much metadata you can/should put into the file, and in the strict fashion that titles are handled.

I had assumed that for an e-book reader, the marked-up text was converted to a binary file -- the way Microsoft .lit, RocketBook .rb, and Plucker .pdb files are, to mention three formats I've worked with. And so I assumed that "conversion tools" meant "conversion to FB2 reading format." Instead they mean "conversion from html or iSilo or Word doc or .lit" formats to FB2 xml format, or the other direction (to rtf instead of .doc, plus to .rb).

Thus most of the burden on rendering a file and creating a linked table of contents is put on the e-readers.

With compiled binary reading formats, you can have many html and image files, and the conversion program puts them all into a single file. With FB2, all the text and metadata must be joined into a single file, and all the images are put there as well, after first being converted to base64 format. So there is only a single file, but it is the author who must put it all together.

To make the file smaller, put it into a zip archive. I haven't tested all the readers, but FBReader on the Nokia 770 (and Linux desktop and Sharp Zaurus) reads the zip file without your needing to extract the e-book. And, of course, if you notice something that has to be changed or corrected (I for one can't let any typo slide by), you simply go in and edit the FB2 file in any text editor.

I've mentioned FBReader (home page: only.mawhrin.net/fbreader/ (http://only.mawhrin.net/fbreader/) ) and the platforms it runs on. Haali Reader (home (http://haali.cs.msu.ru/pocketpc/index.html.en)) runs on Windows, WinCE and PocketPC. Athenaeum (home: sourceforge.net/projects/athenaeum (http://sourceforge.net/projects/athenaeum) runs on Windows 2000 and Windows XP.

I should mention that two pages linking to various tools can be found at haali.cs.msu.ru/pocketpc/scripts.html.en (http://haali.cs.msu.ru/pocketpc/scripts.html.en)
and at www.fictionbook.org/en/programs/redact.html (http://www.fictionbook.org/en/programs/redact.html) .
I found a fair amount of information at FictionBook.org and a link there led me to several book repositories, some with English titles..

I'll report further details as I master them.

-- Roger

Laurens
01-21-2006, 05:18 PM
That's a warez site you're mentioning there. (fictionbook.ru) You can download all sorts of recent, copyrighted content from it.

Laurens
01-21-2006, 05:28 PM
My first impressions of the Haali reader are quite good. How come it has never been mentioned here on MobileRead?

Might even consider adding Fictionbook support to Sunrise XP. The format seems to be clearly defined XML. Surely it's much easier to support than Plucker.

Colin Dunstan
01-21-2006, 05:55 PM
It's been a long time since Haali reader was last updated.

http://haali.cs.msu.ru/pocketpc/
Last version: 2.0b249
Last modified: 2003/12/04 11:43

rsperberg
01-21-2006, 07:50 PM
That's a warez site you're mentioning there. You can download all sorts of recent, copyrighted content from it.It would seem so. Certainly titles are there that are still in copyright in the U.S. (and elsewhere). Non-Russian language titles seem to follow different rules in Russia, however, as far as I can tell -- they may not be breaking any criminal laws there. I didn't see any frontlist titles, and books listed all identify their 'maintainers.' Not exactly the equivalent of offering Windows 98 but definitely you don't see books on the NY Times bestseller list, if I may use that comparison to warez sites offering the latest Microsoft or Adobe software.

So, as PG sites say, better check the laws of where you live (and follow those).

rsperberg
01-21-2006, 08:14 PM
Might even consider adding Fictionbook support to Sunrise XP. The format seems to be clearly defined XML. Surely it's much easier to support than Plucker.While FictionBook 2.0 has its flaws, at least it uses a structure that actually comes from books rather than web pages. An e-reading program can at least tell what is a title at any level in the book. And by formalizing the structure in an XML schema, FB2 enables e-readers to eliminate a lot of error-handling code to process bad markup.

I'm just now working up a few titles in this format. When I've found the time to finish them up, I'll post them in various public venues and let people know here.

I think it would neat to add this support. For one thing, it would provide a way to read feed-based titles on a Windows laptop, which isn't possible with the Plucker pdb format.

I didn't mention all the metadata that's collected -- you might locate FBTools and look over the dialogs in its FBEditor to see them all; I suspect you'd have to add some similar ones to Sunrise.

And as I think about it while writing this post, I agree with you pretty strongly. The support for FB2 ought to be really straightforward, given its straightforward nature.

Does Sunrise include an XML parser/validator? (I guess I should look in the other forum and ask that question there, shouldn't I? :) )

Laurens
01-22-2006, 05:39 AM
Fictionbook support is only an idea. I have no actual plans to support it as of yet. It all depends on how many people might actually use it and how good the support for the FB format in the readers actually is. (In other words: if it's actually worth the effort.) For instance, the FBReader page states that there it has no support for styles yet. Does that mean it cannot render boldfaced and italic text? If so, that would be quite a limitation.

I do like the support for PNG and JPEG images and the fact that you can just stream them as base64. I also like the fact that FB supports real links. (You wouldn't want to know how complicated link handling in Plucker is.)

rsperberg
01-22-2006, 07:12 AM
I can't say how widespread the usage is yet -- it's a new e-reader and FB2 originated in Russia, so it still needs to set its roots in the West.

But the spread of the Nokia 770 will, I think, bring it to a position of significance. I speak, of course, as an adherent and an optimist. But when you compare its features to those of the Sony Reader, I think it will benefit from Sony's push into the e-reader area. (See for instance pieces I wrote at Teleread, "Nokia 770 compared to dedicated e-readers, http://www.teleread.org/blog/?p=3994, and "Sony's ereader: the good news and the bad news," http://www.teleread.org/blog/?p=4058, and many earlier pieces about FBReader on the 770.)

FBReader has really great support for formatting and styles. Here's a screen capture showing italic within text --

http://only.mawhrin.net/fbreader/maemo/thumb-start-default.png

This is from one of two pages full of screen captures showing its features and controls, at http://only.mawhrin.net/fbreader/maemo/screenshots.html and http://only.mawhrin.net/fbreader/maemo/fonts.html