FS#1405 - Text file viewer with word wrap; 12k buffer

Attached to Project: Rockbox
Opened by Garrett Derner (garrettderner) - Saturday, 31 May 2003, 04:05 GMT
Last edited by Daniel Stenberg (bagder) - Thursday, 24 July 2003, 09:44 GMT
Task Type Patches
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Viewer with word wrap. Has controls to handle various
styles of text formatting. Has top-of-file and bottom-of-
file buttons.

F1(recorder) / On-Left(player): toggles Word mode
between Wrap and Chop:
. Wrap breaks lines at white space or hyphen.
. Chop breaks lines at the maximum column limit.

F2(recorder) / On-Menu-Right(player): cycles Line mode
through Normal, Join and Expand:
. Normal breaks lines at newline characters.
. Join ignores unpaired newline charaters (i.e., joins
lines). Useful for adopting the orphans that occur with e-
mail style (i.e., pre-wrapped) text files.
. Expand doubles unpaired newlines (i.e., adds a blank
line). Useful for making the paragraphs clearer in some
book style text files.

F3(recorder) / On-Right(player): toggles View mode
between Narrow and Wide:
. Narrow sets maximum column to the screen width.
. Wide sets maximum column to 940. Useful for
navigating large files.
(Currently, Wide and Join cannot be selected together.)

On-F1 (recorder only): toggles Page mode between
Normal and Overlap:
. Normal sets page-down/page-up to one full screen.
. Overlap tells page-down/page-up to retain one line from
previous screen.

On-F3 (recorder only): toggles Scrollbar mode, for the
current View mode.
. Narrow mode has no scrollbar by default, until toggled.
. Wide mode has a scrollbar by default, until toggled.
. If file fits on one screen, there is no scrollbar and On-
F3 has no effect.

Settings are sticky until power-down.

Up(recorder) / Left(player): Page-up (one screen up)
Down(recorder) / Right(player): Page-down (one screen
Left(recorder) / Menu-Left(player): Top of file (Narrow
mode); One screen left (Wide mode)
Right(recorder)/ Menu-Right(player): Bottom of file
(Narrow mode); One screen right (Wide mode)
On-Up (recorder only): One line up
On-Down (recorder only): One line down
On-Left (recorder only): One column left
On-Right (recorder only): One column right
Off(recorder) / Stop(player): Exit text viewer

Correctly reads plain text files in unix, Win/DOS, or
Macintosh format. Latin-alphabet Unicode files are a l
m o s t r e a d a b l e .
Currently prefers fixed-width fonts. With proportional
fonts, pretends all characters are the width of a lower-
case 'o'.
Currently messages are in English [please help with
translations!] Does not currently support right-to-left
This task depends upon

Closed by  Daniel Stenberg (bagder)
Thursday, 24 July 2003, 09:44 GMT
Reason for closing:  Duplicate
Comment by Eric Linenberg (elinenbe) - Thursday, 05 June 2003, 03:53 GMT

Okay, I love this patch and I have been playing around with it
for a while. just a few suggestions:

1) make the ability to load another font on the system when
you enter the text viewer. I know if I am reading text on the
archos, then I am looking at it closely. Therefore, I would like
the smallest font possilbe (to fit the most info on the screen)
but, I still want a normal sized font in the dir browser.

2) If I change the views in F2 and I press down once, and
then I go to wide view (F3) the scrollbar ALWAYS appears.

3) A help text would be nice (I know it is here with this
patch, but it would be nice on the recorder)

4) I love this patch. I just finished reading Harry Potter on
the Archos!
Comment by Björn Stenberg (zagor) - Thursday, 05 June 2003, 11:39 GMT

Please resubmit a patch against CVS. 1.4 is ancient.
Comment by Eric Linenberg (elinenbe) - Thursday, 05 June 2003, 11:57 GMT

This patch only modifies viewer.c -- it does not touch any
other file. This file has not changed since 1.0 or something
like that :)
Comment by Garrett Derner (garrettderner) - Friday, 06 June 2003, 01:14 GMT

This is a patch against CVS. When I said "against ver 1.4", I
forgot to say, I meant viewer.c 1.4 (the current one in CVS),
not Rockbox 1.4!
Comment by Björn Stenberg (zagor) - Friday, 06 June 2003, 10:04 GMT

My apologies for barking without looking properly.
Comment by Anonymous Submitter - Monday, 16 June 2003, 01:21 GMT

add it, add it :D:D:D
Comment by Anonymous Submitter - Monday, 16 June 2003, 21:02 GMT

also make it the default viewer for .nfo's
Comment by Garrett Derner (garrettderner) - Friday, 27 June 2003, 15:28 GMT

I did builds which include both my text viewer patch and Ben
Metzler's bookmarking patch:
Comment by Björn Stenberg (zagor) - Friday, 04 July 2003, 08:35 GMT

Could you make this a plugin? Thanks.
Comment by Garrett Derner (garrettderner) - Friday, 04 July 2003, 20:02 GMT

> Could you make this a plugin? Thanks.

Ok! Get patches 766096 and 766098.