[Sugar-devel] Request to add webkitgtk as a external dependency
Sayamindu Dasgupta
sayamindu at gmail.com
Tue Jul 14 14:11:58 EDT 2009
Hi,
On Tue, Jul 14, 2009 at 7:44 PM, Benjamin M.
Schwartz<bmschwar at fas.harvard.edu> wrote:
> Sayamindu Dasgupta wrote:
>> This mail is a request/proposal to add webkitgtk as an external
>> dependency for either Sugar or Read
>
> I object strongly either way.
>
> The last thing Sugar needs is a hard dependency on _both_ major browser
> engines. Moreover, it's entirely unnecessary in this case. ePub is a
> simple XML format. You can convert it to HTML (or PDF or ...) using
> Calibre [1],
Calbre is QT based, and uses QTWebkit for rendering.
> or view it directly through gecko using an extension like
> OpenBerg Lector [2]. It might even be possible to view it using hulahop
> without any fancy extensions, just by adding an appropriate stylesheet.
>
OpenBerg Lector works only for version 2.x of Firefox, and the last
release happened two years back. I'm not sure if anyone is maintaining
or not.
I initially tried out whatever I wanted to do with Gecko, however, it
looks like performance can be degraded quite a bit with larger books.
To ensure proper pagination (the current form of Read depends on the
document being properly and consistently broken up into pages), I need
to pre-render the entire book beforehands to get an idea of the
dimensions (under a predefined set of graphics settings, so that the
dimensions come out in a device/screen independent manner). However,
with large books like War and Peace (which consists of more than 350
XHTML files), the basic pre-rendering code takes around 18 seconds
with Gecko (using Hulahop) and around 2 seconds with Webkit. This is
on my desktop machine - I did not try the comparison on an XO-1. All
the pages are quite simple, with no images, and minimalistic
formatting.
There are other methods to do "pagination", but I did not find any of
them to be suitable. For example, AFAIK, Calibre uses character count.
This will lead to very short pages for for books with images,
equations and non-latin text like Indic or Arabic. I believe Stanza (a
very popular iPhone application for reading Epubs) uses the concept of
viewport as a page (I maybe wrong here - since I haven't used Stanza
myself). Adobe's Digital Edition (which runs on Windows and OS X and
the Sony PRS series of Ebook Reader) probably does similar to what my
code does, or maybe something even fancier - but the pagecount for
Read and Digital Editions is quite close for all the books I have
tried. It is believed that Digital Edition also uses WebKit.
WebkitGTK seems to fast gaining acceptance among application
developers, and I don't think there are serious distro packaging
issues to be addressed here. There is talk about WebkitGTK becoming a
blessed external dependency for GNOME for the next major release
(2.28). Already, Devhelp and Gwibber are two oft-used applications
which are using webkitgtk, and Epiphany (the GNOME browser) will
switch to it for its next major release. The Moblin folks are also
using Webkit in their email client (Anjal) - though they are sticking
to Gecko for their browser.
I agree that there is a duplication of functionality here, but apart
from an extra space requirement of around 15 MB, I do not see any harm
being done :-).
Thanks,
Sayamindu
--
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
More information about the Sugar-devel
mailing list