View Single Post
Old 12-19-2009, 06:45 PM   #5
Jim Chapman
Addict
Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.Jim Chapman ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 2025434
Join Date: Oct 2009
Device: Lumia 950 Phone
Quote:
Originally Posted by Jack Tingle View Post
Well, except for Freda which uses .NET components like ... the Majestic-12 HTMLParser
Yep, I just use the free Majestic-12 parser to give me the tag types and contents, and decode the content into a simplistic (by design) format of 'lightly decorated text'. Then I have written a (once again, simplistic) renderer that puts that text onto bitmaps.
Advantages of this approach:
- since I wrote the renderer myself I have complete control over how it works (so animated page turning etc. is doable);
- it can be quick to run and light on memory usage.
Disadvantages:
- it's never going to produce beautifully laid out text that looks 'just like the author intended'. But then the author probably didn't intend their book to be read on a screen that was only 4cm wide ...

Anyhow, if you want to see how it was done, this is the source code.
Jim Chapman is offline   Reply With Quote