New Ebook Reader App


deathterrapin

Still Fresh
Joined
Apr 14, 2003
Messages
48
Age
40
Location
Sheffield, England
Website
Visit site
I've written a new ebook reader app, 'cause I couldn't find one that didn't have fugly text.
Download it here
I'll copy in the readme here, 'cause people are bound to ask stuff thats already in there :D:


CBook - EBook Reader for the GP2X - Written by Chris Cooper
-------------------------------------------------------------

Here's my little ebook reader program. It doesn't do anything fancy, but it does render text in a readable font, which is better than any previous ebook reader for the GP2X has done as far as I've seen.

[CUT]
Controls:
Joystick left & right moves up and down by one full screen.
Joystick up & down moves up and down by one line.
B opens a file on the file selector
Y saves a bookmark

Functionality is currently very basic, bookmarks are just automatically moved to when you next open the file, and there's no getting back to the file selector or exiting. But it does the minimum I need to actually do some reading on it, so I though I'd release it at this point.
I'm defiantly going to add better bookmark navigation, some sort of position indicator, and any other easy stuff I can think of.

I made the default font have only 75% brightness, because I found full white too bright to look at for very long. The original full brightness font is included as well, just rename and replace if you want to use it.
If anyone wants to make any alternate fonts then I think the format is pretty obvious. The background colour comes from pixel (0,1), and the separator pixels can be any colour as long as they're all the same. You don't need to include the full character set, as long as you start with ! and don't miss any out in between.
The 3px width of the space and the 1px separation between characters is hard-coded at the moment; I'll probably make that configurable as some point.

Make sure you copy the dummy bookmarks file along with the program and font, I haven't worked out why, but the program can't create the file for itself yet.
[/CUT]
 
I'll probably get around to adding some sort of auto-scrolling at some point.

I'm not going to add support for any other file formats. Supporting any kind of formatting would be a hell of a lot of work, for minimal usefulness IMO, and without formatting you might as well just convert them into plaintext anyway.
 
big ups deathterrapin!!! great to see someone working on an eBook reader, i used the one i had on my gp32 a *lot*!

the default gp2x text reader is unusable to me because of the way it interprets every newline character. eBooks from project gutenberg and stuff like the klf's manual have linebreaks inserted to read the text at 80char wide screens or something, so it looks a real mess on the gp2x.

could you add a feature to not display line breaks unless there are two in a row, and display both in the case that there are (so that the text is seperated). this is how the gp32 eBook reader i had did it, and that was quite readable. CBook would be my killer app after piggy!

also, a usability/interface request: please make the stick commands (navigation) mirrored on the abxy buttons ... this way you can read with one hand, either hand! ;) ... if you're willing to do this, maybe use the SELECT key for bookmarking, START for file selection .. until you implement a menu or key combinations for more functionality. i've noticed most people use both shoulder buttons and start together to quit back to the launcher, so using select wouldn't interfear there.

again, thanks a lot chris, the font file is nice and easy you're right! exciting release!

oh, one more thing: i renamed the .gpu to .gpe on my own unit because i'm used to going into "game" ... some people might not remember to check in "utillity" :eek:
 
starpause:
Mirroring the controls is something I thought of before, and then I forgot, so I'll definatly be putting that in.
I've download books in formats like that before. I tend to just reformat them on the pc with a regular expression in textpad, but I can see how they'd be annoying for people who dont know about regex.
I'd rather not put specific functionality in for just one particular format, but I might think about adding a configurable pre-processor with some presets for common formats. I'll have to think about that one some more.

Paulo Becker:
It only supports .txt files, I don't plan to support any other because it just isn't worth the effort IMO.
I tried vtex, its certainly much improved on the built in reader, but I still didn't like the font. I tried editing its font file, but It only supports monospaced characters, and has to have a black background.

Eso Rimmer:
It supports all the characters in the standard windows encoding, which should have pretty much anything used in western european languages. Check the font file to see what letters are included.
Of course if a file you try to read uses a different encoding then things could go very wrong, but it should be possible to convert stuff in Word or suchlike if you need to.
 
Thanks for clarifying :) I guess I'll stick with vtex for now, since I really like monospaced fonts and see no reason to have a background color other than black. But keep it up, I'm sure there'll be many people who'll like your prog better ;)
 
So currently there are only text file readers for the GP2X correct? By that I mean if you get ebooks online they are usually in several ebook formats like .pdb, .lit, .prc, etc. Is there anything that reads multiple formats?
 
So currently there are only text file readers for the GP2X correct? By that I mean if you get ebooks online they are usually in several ebook formats like .pdb, .lit, .prc, etc. Is there anything that reads multiple formats?
I think there's a .pdb to .txt converter included with vtex, haven't tested it though.
 
Last edited by a moderator:
Here's my little ebook reader program. It doesn't do anything fancy, but it does render text in a readable font, which is better than any previous ebook reader for the GP2X has done as far as I've seen.
almost! ;)
I hacked some stuff together a few months ago to test my SDL_ttf subpixel patch. I named it 2xBook (yes, how original).
It does sorta what you describe.
features:
  • a very crude autodetection for pre-wrapped ebooks (like gutenberg books)
  • a tiny scrollbar
  • a readable font, like yours, but it's set for white-on-black at the moment
    (and it's Bold and Sans-Serif, never liked Serif'ed fonts on computer screens)
  • extremely slow load times (that is, the first time you open a file)
  • automatic bookmarks
buttons: <R> and <L> for PageUp/PageDown, <Start> to exit.

Oh, and please don't post this on the front page, it didn't get a lot of testing ;)
I'll finish it off in the summer, if CBook doesn't beat me to it.
 
Last edited by a moderator:
Damn, if i'd seen that before I probably wouldn't even have started writing mine :D
Although I prefer mine for now for the black on white colours and the full justification.

I went with pre-rendered fonts on mine for speed, I assume your slow load times are coming from having to render the entire file to work out the line breaks.
I generally like serif fonts when sub-pixel AA is on, although I'm starting to think sub-pixel doesn't actually look very good on the gp2x screen (mk2 at least, never seen the older one) there seems to be too much separation between the pixels, making the AA less effective and colour fringing more apparent. I might change to a sans font with normal greyscale AA.
 
I generally like serif fonts when sub-pixel AA is on, although I'm starting to think sub-pixel doesn't actually look very good on the gp2x screen (mk2 at least, never seen the older one) there seems to be too much separation between the pixels, making the AA less effective and colour fringing more apparent.

yeah, that was apparent to me too.

i'm trying Cbook right now. how do you load a new text file? i'm currently viewing the readme, and pressing B doesn't do anything.
 
Last edited by a moderator:
Damn, if i'd seen that before I probably wouldn't even have started writing mine :D
Although I prefer mine for now for the black on white colours and the full justification.
Full justification is nice, but without hyphenation you often have too much space between words. Also, I'm lazy.
Changing the colors 2xBook uses is quite trivial actually, as everything, including sub-pixel rendering, is done dynamically. That's why I stick to the bloated library method :)
I went with pre-rendered fonts on mine for speed, I assume your slow load times are coming from having to render the entire file to work out the line breaks.
Partly. It doesn't actually render the entire file, but SDL_ttf does some math based on the font. Also, paragraph re-wrapping and other pre-render calculations are done when loading a file the first time. I will implement this real-time in the final version, but as I said, I'm lazy, and saving the wrapped text is a nice solution in the mean time. :)
I generally like serif fonts when sub-pixel AA is on, although I'm starting to think sub-pixel doesn't actually look very good on the gp2x screen (mk2 at least, never seen the older one) there seems to be too much separation between the pixels, making the AA less effective and colour fringing more apparent. I might change to a sans font with normal greyscale AA.
I have one of the oldest models, so I don't know about the mk2 screen, but standard grayscale rendering looks quite horrible on this one. I'm using full white and black for now, because the older models have scanlines shining through everything else :(
 
Last edited by a moderator:
starpause:
Mirroring the controls is something I thought of before, and then I forgot, so I'll definatly be putting that in.
I've download books in formats like that before. I tend to just reformat them on the pc with a regular expression in textpad, but I can see how they'd be annoying for people who dont know about regex.
I'd rather not put specific functionality in for just one particular format, but I might think about adding a configurable pre-processor with some presets for common formats. I'll have to think about that one some more.

great to hear you'll be mirroring controls :)

i've got an MK1 and the font_brite looks much better on my system--the grey one is scanline city. maybe something i could fix w/ the lcd tweaker.

thanks for mentioning regular expressions. i just started reading up on the stuff but i haven't gotten a script down to do exactly as i've said yet. the solution is on the tip of my fingertips :rolleyes:

however, in my quest i found the linux command fmt originally ment for formating emails, and running gutenberg style .txt through it works well enough for the moment. something like:

Code:
fmt -w 54 file.txt > fileFmted.txt

a pre-processor on the gp2x would be nice but i think you're right--spending some time with regular expressions would mean people could format their text however they prefer, and your reader would be compatible with their preference.

2xBook looks good, exciting to see it cleaning up paragraph messes, but then imho it makes a mess of it's own ... i prefer white space between paragraphs over tabbing the first line.

it's too bad everyone working on text readers can't team up and do a killer app, but i see that each of you has a different vision in mind.

anyway, looking forward to your next version chris, thanks again!
 
Last edited by a moderator:
2xBook looks good, exciting to see it cleaning up paragraph messes, but then imho it makes a mess of it's own ... i prefer white space between paragraphs over tabbing the first line.
There used to be command-line flags for all the pre-render settings, but after I added oddbots file selector, I sorta turned everything ON :)
it's too bad everyone working on text readers can't team up and do a killer app, but i see that each of you has a different vision in mind.
If anyone is looking for inspiration, check out FBReader
 
Last edited by a moderator:
however, in my quest i found the linux command fmt originally ment for formating emails, and running gutenberg style .txt through it works well enough for the moment. something like:

Code:
fmt -w 54 file.txt > fileFmted.txt

I find I have to strip out the ^M characters (DOS newline) before doing the fmt with Gutenberg files
 
Last edited by a moderator:
Back
Top