TextReader Help




Home



TextReader


Description

Read plain text files like books.

You can't run at the same time more than one instance of the program. This is because the options file must be protected: each instance of the program writes its own data (like bookmarks) in it, so certain problems might occur (like missing bookmarks). Because it's unlikely you'll read more than one book at a time, this shouldn't be a problem.



How does it work?

The biggest book you can open can contain 20 million characters. If you need more, send a request.

The original file is not changed in any way, unless you overwrite it; changes are made on a copy in the working memory.

Tab characters are displayed as fixed 15 millimeters white spaces, relative to the indentation of the first line of a paragraph. Therefore, different strings of characters separated by tabs are equally spaced throughout a paragraph. All tabs in a paragraph, on each line of the paragraph, have the same spacing relative to the Left margin.



Command-line parameters

A file tile can be sent as parameter to the program, to be opened.



Enhanced text

If Enhance text check-box is checked then the text is enhanced:

The text is reformatted to look better: the undesirable line-breaks are deleted, and the hyphenation is also deleted (but only if both characters from each side of the hyphen are small letters).

The text between quotes is highlighted (= the color of text is set) with the Empha color. If the second quote is missing from a paragraph, then the first one is ignored and the color remains unchanged.

The text between apostrophes is highlighted with the Second empha color. If the second apostrophe is missing from a paragraph, or a quote occurs before the apostrophe, then the first one is ignored and the color remains unchanged.

The Chapters menu is filled with chapter titles within the book. You can click on an item from this menu to go to that chapter.

Text enhancing doesn't work well on poorly written texts.



Dictionary

You can integrate a dictionary with the program. There are two ways to do this: to copy the word (you want to look for) into the system's clipboard, or to send the word as command-line parameter to a program. Depending on the dictionary program you use, you have to choose one of these methods, and check (for the first case) and uncheck (for the second case) the Use clipboard for dictionary check-box.

The Dictionary program edit-box must target the dictionary program. If the dictionary has an Auto lookup option (in the options dialog, or in the menus), select it.

The first case:

  • If you double-click on a word within the rich-box, the word is selected and copied to the clipboard, then the dictionary program is started. You might have to close the dictionary program each time after you read about a word, in order for the next word to be displayed.

  • The dictionary program must accept words from the clipboard.

The second case:

  • If you double-click on a word within the rich-box, the word is selected and the dictionary program is started. You might have to close (or minimize) the dictionary program each time after you read about a word, in order for the next word to be displayed.

  • The dictionary program must accept words from the command-line.

This function works only if the text to be sent to the dictionary is shorter (or equal) than 20 characters.



Dealing with slow opening

Big plain text books are opened slowly. In order to decrease the opening time for a book, you can:

  • Check the Open in pieces check-box.

  • Decrease the Piece size value.

  • Deactivate the text enhancing function (= clear the Enhance text check-box).

  • Set the Empha color with the same color as the Fore color.

  • Set the Second empha color with the same color as the Empha color.

  • Hide the program during opening.

  • Open once the book, format it as you like, and save it as formatted text (in a ".rtf" file). Formatted text books are opened much faster than plain text books, but most formatting options from the program (including text enhancing) will not work when such a book is opened, though you can apply them manually after the book is opened.

  • Split the book in smaller parts.



Opening in pieces

If you want to read a big plain text book (not a formatted text book), it is recommended to choose this method. The book is automatically split in small parts (but only logical, not physical –the original file is not modified). You can choose what piece you want to open, from the Pieces drop-list.

The disadvantages of this method are:

The end of each piece is usually very abrupt. To compensate for this, each piece contains a small part (20 characters) from the end of the previous piece.

The chapter titles are limited only to the ones within the current piece.

In order for this function to be activated, check the Open in pieces check-box.



Tips



Reading books

Here are some advices on how to make it easier on your body, to read books.

If you read in a low environmental light, you should either deactivate the background images, or set the background images with some dark colored images, and set the "Low light" color scheme. You might want to save this as a profile (let's say you name it "Night Owl").

If you sit in front of the monitor, at a desk, keep your hands off the desk. This will help with your blood circulation as you might read for hours.

Take some breaks (from reading), like 10 minutes at every hour, and move around. You should avoid looking at the monitor during this time.

When you need to read the next page, press the "Spacebar". Don't use the mouse because (in time) it will strain you hand. The "Spacebar" offers you a large base for your fingers, so think at this like you are turning the page of a paper book.

You should sit far from the monitor. If you see you tend to get closer to the monitor, increase the font size (let's say to 18).

Don't increase the size of the rich-box (indirectly using the screen "Screen size" options) too much because this would force you to move your eyes too much at extremes. Think that the rich-box should be about the size of a page from a usual book (12 * 17 centimeters, 5 * 7 inches). Also think how much easier is to read a newspaper as it is organized in columns, instead of reading the text as long lines, from the left margin to the right one; if the text would be in long lines, you would loose track of where you were reading.

You might want to use "font-smoothing", to make the edges of the characters look smoother. In WindowsXP you can do it this way: right-click on the desktop, "Properties" menu, "Appearance" tab, "Effects" button, and check the font smoothing option (preferably "Clear type").



Weird looking things

It is possible to meet a case when a character dialog should be emphasized but it's not. This happens because there is a quote missing or, if they both seem to be in place, one of them is actually made from two apostrophes that only look like a quote (like in this example: ''Some text in between.").



Input

If you want to temporarily change the zoom (of the font's size) then press the "LMB" in the rich-box and rotate the mouse wheel (upward to increase the size, downward to decrease the size).

To select a whole line, click on its left side.

To select a whole paragraph:

Double-click on its left side.

Triple-click at its end.

To select the whole text:

Triple-click on the left side of a paragraph.

Press "Ctrl + A".

To copy the selected text to clipboard:

Press "Ctrl + C". The copied text can be pasted with formatting options into a word-processor program, or pasted as plain text into a text-editor program.



Editing books

Let's say you want to modify a book that is poorly written. Do the following (to simplify things, let's consider that all options are set with their default values):

If the book is really poorly written, like when paragraphs don't have indentation in front of the first line, check the Text is poorly written check-box.

Set the Paragraph prefix with the Tab value.

Uncheck the Open in pieces check-box so that the book is opened in one piece.

Check the Allow editing check-box.

Modify the book any way you want.

Save the book, either as formatted or plain text. A plain text book doesn't retain the visual aspect (colors, font name and size, etc.) of the book, but only its content. A book saved as formatted text looks exactly as it in the program (except the rich-box's Window back color).

After editing a book, you can view it or process it further with a word-processing program (or even just a basic text-editor program).

Please understand that the purpose of this program is not to edit books, but to read plain text files in the best conditions, whether or not the (initial) files are well or poorly written.

During the editing process, items from Chapters menu might become invalid because the positions of the chapter titles change.



Profiles

When a profile is saved, all options from the profile tabs are saved in it.

When a book is opened, a profile file with the same name and path (as the opened book) but with a ".trp" extension is loaded. If there is no such file, the program tries to load the profile file in the same directory (then in the parent directory) but with the name "TextReaderProfile.trp". If no profile is found then the default profile is loaded.

If you want to have the same profile for all books in a directory, you have to save a profile, in that directory (or its parent directory), with the name "TextReaderProfile.trp".

A profile contains relative file titles for the images. Relative titles are searched first relative to the parent directory of the current profile (if the profile is the default then the title is relative to the parent directory of the currently opened book), and then relative to the images default directory.



Sounds

Though the program's user interface allows you to set only one background sound, it is possible to have more. To do this you have to change the profile file you want to contain the sounds, the "[Profile_BackSounds]" section.

Properties:

  • "Count" is the number of sounds (between 1 and 20).

  • "File?" is the title of the file used as sound (with an empty text as default, in which case they are played as silence).

  • "Vol?" is the volume (between 0 and 1000, with 50 as default).

  • "Dur?" is the duration (between 1 and 500, with 5 as default).

  • "Prob?" is the probability (between 1 and 1000, with 100 as default).

If you want some properties to have the default value, you don't have to write them; for example, there is no need to write "File0=", "Vol0=50", "Dur0=5", "Prob0=100". The "?" is the index of the sound, and can be between 0 and 19; you have to use as maximum the value "Count" - 1. The sound with the index 0 is always played first (regardless of the "Random" option).

If you want the probabilities to be proportional in time (that is, as you write them), you must use the same duration for all sounds.



Example

Change in a profile file the content of the "[Profile_BackSounds]" section with the following lines:

  • Use=TRUE

  • Random=TRUE

  • Count=2

  • File0=C:\Sounds\Ocean.wav

  • Vol0=50

  • Dur0=3

  • Prob0=100

  • File1=C:\Sounds\Thunder.wav

  • Vol1=50

  • Dur1=3

  • Prob1=5

Of course, the sound files must exist, or you have to change their titles. The probability of the "Thunder" sound to occur is 5 / 105 (note that both sounds have the same duration).



Writing books

If you want to write books for this program, read this section.

Please keep in mind that this program was specially created for books, not for any fancy looking text. Most plain text books follow the same standards, standards that are used by this program. This way, the program can be used with the same success for both already written books and books you write.

Create a plain text file (a ".txt" file). Write text in it, just as you would write a book.



Paragraphs

Begin a paragraph with at least 2 blanks or a tab or a special character (*, ·, -, = ), then a capital letter or a quote ( " « » “ ” ) or an apostrophe ( ', ` ). You can use white spaces (blank spaces, and tabs) in front of the special characters. A special character always marks the beginning of a paragraph, regardless of what characters end the previous line and follow on the same line. Note that the beginning of a paragraph is also marked by special structures: chapter titles, manual formatting commands.

Mark the ending of a paragraph with one of the following characters: ., ?, !, ), quote, apostrophe. After it use a line-break character. You can use white spaces after the special characters.

If you write a paragraph that extends on more than just a line, there is no need for line-break characters. However, you can use line-breaks, simply because this program will check to see if each line is (or not) a part of the same paragraph, and if so, it concatenates the lines in a single paragraph.

If you can't fulfill the requirements for paragraph delimitation, but you still need to have two lines as separate paragraphs then insert an empty line between them.



Separator-lines

Separator-lines are lines consisting of 1, 2 or at least (first) 3 special characters (*, ·, -, = ). These lines are not concatenated with other lines, they are separators.



Character dialogs highlighting

In order to take advantage of the text highlight function, dialog between book characters should be included between quotes, like this: "some dialog between book characters". Note that a dialog can't contain more than one paragraph; if there is only one quotation mark in a paragraph, the text after the quote is not considered dialog, and thus is not highlighted.

If there is any need for nested dialogs, use apostrophes to mark the beginning and ending of the dialog inside the dialog, like this: "some dialog between book characters, having 'some nested dialog' about their previous actions".

Nested dialogs can't be mixed, like this: "some dialog between book characters, having 'some nested dialog" about their previous actions'. Quotes have priority.

The text between apostrophes is highlighted even if the apostrophes are not between quotes. The first apostrophe must not be preceded by a letter or a digit; the second apostrophe must not be followed by a letter or a digit.



Chapters

Most books have chapters. If you want the reader to be able to move quickly inside a book, from chapter to chapter, you have to mark the beginning of each chapter.

You can use words to mark the beginning of a chapter. The word you choose must the first word on the line; there can be white spaces in front of it; there must be a blank space after the word. A chapter title is parsed until the first line-break character. Words are case-insensitive (= you can use both big and small letters), but the first letter must be capital. Recognized words are: Chapter, Part, Section, Book.

You can also use one of the following characters to mark the beginning of a chapter: #, § . The character you choose must be at the beginning of a line; there can be white spaces in front of it. The advantage of this method is that is available for any kind of mark (chapter, section, part, or a simple mark) and any language, but the disadvantage is that most books that are already written don't use this method (so you have to manually edit them).

The whole text from the same line as the chapter delimiter is the title of the chapter. Chapter titles will appear in the Chapters menu, maximum 30 items.

Chapter titles (only those that are in the Chapters menu) are underlined.



Beginning of books

If you write a comment before the beginning of the book, it is strongly recommended to mark the beginning of the book as a chapter, particularly by using "Book - Title".



URLs

The book can contain URLs (Uniform Resource Locators – links on the Internet). They are highlighted as they are in any Internet browser.

For a text to be recognized as URL it must have one of the following forms: "mailto:text", "www.text", "http://text", "https://text", "ftp://text", "file://text" ("text" must contain an absolute path). A URL between quotes or apostrophes is still recognized as URL. "text" can't contain spaces.

The reader can click any URL to open it.



Manual formatting commands

If you want the program to format a paragraph in a special way then use manual formatting commands.

Automatic formatting commands = all the formatting options from the program's user-interface.

For a manual formatting command to be recognized it must be the first text on a line. There can be white spaces in front of the command. A command is parsed from the "^" character, after which comes the name of the command, then the "=" character can be used to separate command parameters, until a "*", "+", "/" or "~" character (called operator). Command names are case-insensitive.

The area of effect for a command depends on the operator of that command:

  • "*": The command will be applied on all following paragraphs.

  • "+": The command will be applied only on the following paragraph. After the paragraph, the previous (= before the command was used) value of the command is restored.

  • "/": This command is equivalent with the "*" operator and the default value as parameter.

  • "~": The previous (= before the last "*" or "+" command was used) value of the command is restored.

The "=" character delimitates the parameters of a command. If this is missing it means the parameter has the value "true", and the default value of that command is "false".

All commands have effect on the whole text of the paragraphs they apply onto. No command affects empty lines.

Commands are cumulated, that is, if there are multiple consecutive commands, all commands are applied; specifying the same command multiple times has the same effect as if it were just once.

Restoration, for each command, can happen only for the last 100 uses of "*" and "/" operators. If you use each command more than the maximum number, the restoration stack is cleared (and only the default value will be in it).

Applying commands on many paragraphs takes a significant amount of time. However, if the parameter of the command has the default value, the command is not applied (so there is no performance penalty for it).

Lines containing commands (recognized or not) are not displayed, so don't put on such lines any text you want to display. You can use such lines for comments.

Legend:

  • In the following commands, the "text" text stands as parameter and must be replaced with the value you want. The limits of the parameters are just like the limits of the parameters of the automatic formatting commands with the same names.

  • If the parameter represents a color then "text" must be: an integer decimal (from 0 to 16777215) or hexadecimal number (with the form 0xBBGGRR - blue, green, red; from 0x0 to 0xFFFFFF), or a color identifier (as defined in C++Builder); you can also use the names of colors from the Stock colors dialog. Colors have no effect on: character dialogs highlighting (except the specific command: "EC"), and URLs.

Recognized commands for character formatting:

  • "U": Underline the text.

  • "I": Bend the upper part of the text to the right.

  • "B": Make the text bold. This command has no effect for URLs.

  • "F=text": Set the font name with "text".

  • "S=text": Set the text size with "text".

  • "Z=text": Set the text size with "text" percent from the text size from the automatic formatting commands. "text" must be an integer number, from 10 to 500. This command does not modify the zoom as the automatic formatting command does; instead it is applied to the font size.

  • "CS=text": Set the character spacing with "text".

  • "BC=text": Set the text background color with "text". By default, this color is transparent (= the same as the paragraph's background color).

  • "FC=text": Set the text foreground color with "text".

  • "EC=text": Set the empha color with "text". Note that this command affects only the character dialogs (not the whole text of the paragraph).

  • "SEC=text": Set the second empha color with "text". Note that this command affects only the character dialogs (not the whole text of the paragraph).

Recognized commands for paragraph formatting:

  • "AL": Align to left.

  • "AR": Align to right.

  • "AC": Align to center.

  • "AJ": Align with justification.

  • "LPI=text": Indent the left side of the paragraph to the right with "text" millimeters.

  • "RPI=text": Indent the right side of the paragraph to the left with "text" millimeters.

  • "FLI=text": Indent (relative to the paragraph's indentation) the first line of the paragraph to the right with "text" millimeters.

  • "LS=text": Set the line spacing with "text".

Recognized predefined styles:

  • "PS_T": Title.

  • "PS_H": Header.

  • "PS_N": Note.

Recognized predefined color schemes (only the "Window back", "Fore", "Empha" and "Second empha" colors are modified):

  • "PCS_HL": High light.

  • "PCS_LS": Low strain.

  • "PCS_LL": Low light.

All command names associated with the "/" and "~" operators are the same as in the list above, except for:

  • Align commands, "A?*" and "A?+": "A/", "A~". The default value of the command is "align to left".

  • Color schemes, "PCS?*" and "PCS?+": "PCS/", "PCS~".

Special commands:

  • "CAD": Set the default values of all (character and paragraph) formatting commands with the current values. It is the same thing if you use "*" or "+". If there is any text before this command, the following text will have weird formatting (= not match the new default formatting).

  • "All/": This command is equivalent with "/" operator for all character and paragraph formatting commands.

  • "All~": This command is equivalent with "~" operator for all character and paragraph formatting commands.

  • "": The empty command does nothing. You can use it to specify comments. It is the same thing if you use "*", "+", "/" or "~".

The opened text is first formatted with the automatic formatting commands, then with the manual formatting commands, and then character dialogs are highlighted (first the ones with quotes then the ones with apostrophes); some formatting commands are overridden by the same formatting commands from the next step.

Some manual formatting commands are overridden by the automatic formatting commands with the same names if you change those automatic formatting commands after you open a book. For example, the bold manual formatting command is overridden by the Bold font automatic formatting command if you change Bold font after the book is opened, and the whole text will have the same bold effect.

When books are opened in pieces, only formatting commands from the current piece are used.

If you save a book all manual formatting commands from the original book will not be in the saved book (they are lost).

For examples on how to use the formatting commands, see the "Welcome.txt" file from the program's installation directory. You can open it using the Open example menu.

Example:

  • ^PCS_LS* Set the colors in the rich-box.

  • ^CAD* Make the specified colors be default. If you don't use this, the enhancing speed would be lower.







License | Contact