Basic Editing and Formatting

This chapter covers basic issues in word processing, such as moving around the document, formatting the document, and locating text within the document.

  • Moving Around the Document
  • Text Display and Line Width
  • Formatting Text
  • Character Placement and the Tab Key
  • Formatting Paragraphs
  • New Paragraphs and Splitting Paragraphs
  • Selecting Text
  • Using the Clipboard
  • Clipboard Encoding
  • Undo and Redo
  • Search and Replace

  • INDEX: Contents
  • PREV: Entering Text
  • NEXT: Working with Kanji

  • Moving Around the Document

    On opening JPWce, you will see two cursors; there is a flashing vertical bar at the beginning of the blank page, and an arrow cursor somewhere in the page. The bar cursor indicates the text entry point, while the arrow cursor allows you to reposition the entry point when there is text on the page. When you move to a new location and click, the bar appears to the left of the selected character.

    You can also use the following keyboard commands to move around the document:

    keyaction
    Homebeginning of line
    Ctrl+Homebeginning of document
    Endend of line
    Ctrl+Endend of document
    Leftmove one character left
    Ctrl+Leftmove one word to the left*
    Rightmove one character right
    Ctrl+Rightmove one word right*
    Upmove up one line**
    Downmove down one line**
    PageUpmove up one screen worth of lines
    PageDownmove down one screen worth of lines
    DeleteDelete character to the cursor right
    BackSpaceDelete character to the cursor left(When entering kana, this will delete the current kana.)

    * JWPce defines a word in Japanese text (including JASCII) as a string of characters of the same type (hiragana, katakana, JASCII, kanji, punctuation. etc.). ** It is possible on PPC systems to have the up and down keys move a page at a time instead of a line at a time. This can be more convenient in cases when you are using JWPce as a referenced or as a file viewer. This option can be set on the General page of the Options dialog.


    Text Display and Line Width

    Before the issue of formatting text (next section) can be discussed, the way text is displayed needs to be examined. JWPce has three basic ways to control the line width of text displayed on the screen. These can be changed from the General page of the Options dialog box (Utilities/Options... or Ctrl+O).

    When formatting Japanese text, each character normally occupies a space that is exactly the same width. When the end of the line is reached, you simply start a new line. This makes formatting text easy, but can lead to some odd results. For example, you can get a line that begins with punctuation. JWPce can achieve more appealing results when the formatting is relaxed. The following options allow JWPce to extend a line into the right margin for some punctuation and for small kana. These options can be controlled from the Font/Format page of the Options dialog box (Ctrl+O or Utilities/Options...), and are on by default.

    Related Topics


    * If you are using a dynamic display and print the text, JWPce automatically reformats the text for the printer, prints the document, then reformats the text back to dynamic mode.

    ** On Windows CE machines, this option formats the document as if it were printing on an 8.5"x11" sheet of paper.


    Formatting Text

    Formatting text consists of two parts: formatting of the entire paragraph, and of character placement. Another part aspect of formatting is the issue of
    page layout, which refers to how the text is printed on the page:
    1. Character Placement and the Tab key
    2. Formatting Paragraphs
    3. Page Layout Considerations


    Character Placement and the Tab Key

    In Japanese text every character occupies the same space, and the paragraph is broken into lines whenever the line is full, even in the middle of a word. In English, characters are proportionally spaced, and the text is broken into lines so that words are generally not broken. When you edit text that contains both Japanese and ASCII (English) text, adjustment of character spacing in the transitions (Japanese<->English) becomes an issue.

    As an example, consider the following text:

    The "I" character in the first sentence interferes with the spacing of the Japanese characters that follow it, and the upper line does not align with the lower line. To correct situations like this, the Tab character can be used to realign the text with Japanese character spacing:

    In this example, pressing Tab after the "I" causes the upper line of Japanese text to align correctly with the lower line.

    Printing Concerns

    In order to keep the display rate fast, JWPce does not adjust the spacing of English characters on the screen, thus the second example above looks odd (with the "I" character way over to the left). By default, when printing, however, characters such as the "I" above are centered in the space, resulting in printer output that would look something like:

    By default, when printing, English text that is followed by a Tab character is justified during printing if the Justify ASCII Text options is selected on the Advanced page of the Page Layout dialog box (Utilities/Page Layout... or Alt+L).


    Formatting Paragraphs

    Each paragraph of text has its own characteristics, such as margins, and line spacing. These parameters are set by the Format Paragraph dialog box.

    Depending on how you start this dialog box, you can format a single paragraph, a range of paragraphs, or the entire file:

    The formatting parameters are in two sections, Indentation and Line Spacing. Indentation parameters are measured in units of kanji character width (the amount of horizontal space a single kanji character takes up). The Left parameter is the amount of space between the left margin and the selected paragraph(s). The Right parameter is the amount of space between the right margin and the selected paragraph(s). The First parameter is the extra amount of space added to the first line of the paragraph. Using this parameter, you can create a normal indented paragraph (enter a positive value), or a hanging paragraph (enter a negative value).*

    The Line Spacing parameter determines the spacing of lines in the paragraph. A value of 1 is normal spacing. A value of 1 is normal spacing, 2 is double spacing, and 1.5 is space-and-a-half.


    * The Indentation parameters have limits to their size. Left and Right, must be in the range 0 to 255, and First must be in the range -127 to 127.


    New Paragraphs and Splitting Paragraphs

    A new paragraph can be generated by pressing the Enter key when the cursor is at the end or beginning of a paragraph. If the cursor was at the beginning of the paragraph, the new paragraph will be generated before this one. If the cursor was at the end, the new paragraph will be generated after this one.

    You can divide a paragraph into two by pressing the Enter key with the cursor located where you want to divide the paragraph. (In reality, starting a new paragraph above is just a special case of dividing a paragraph.)

    When you generate a new paragraph, it inherits the Paragraph Format from the paragraph the cursor was in when you pressed Enter. Thus if you divide a paragraph, both halves will have the same Paragraph Format.

    This makes a slight difference in generating new paragraphs. If you place the cursor at the end of a paragraph and press Enter, a new paragraph is generated following the current one, and with the same format. If you do the same thing at the beginning of a paragraph, the format for the new paragraph comes from the following paragraph.


    Selecting Text

    Selected text is used for a number of things within JWPce. You can select text in one of five ways:

    1. Keyboard Press and hold the shift key while using any of the cursor control commands. This will select (highlight) text as you move the cursor.
    2. Mouse Press and hold the left mouse button and drag across the display (pen drag). This will highlight the text as the pointer is moved. If you drag to the upper or bottom edge of the display, or to the right or left edge of the display, JWPce will automatically scroll the display for you.
    3. Double Click If you double click the mouse on the text the word containing the mouse will be highlighted*.
    4. Menu Selecting the Edit/Select All (Ctrl+Shift+A) command from the menu will select all text in the file.
    5. Kana to kanji conversion By generating an inline kana-to-kanji-conversion (section 4.6.2).**

    Once you have selected text, the next character you type will replace the selected text**. If you wish to cancel the selection, this can be done simply by moving the cursor with any of the standard cursor controls or by clicking with the mouse.


    Tip: If you select text before entering a dialog box, that text will usually be inserted into the first edit control in the dialog box.

    * JWPce defines a word in Japanese text (including JASCII) as a string of characters of the same type (hiragana, katakana, JASCII, kanji, punctuation. Etc.).

    ** The selected text generated by an inline kana-to-kanji conversion is slightly different than the normal selected text. This can be seen when you type another character - that character does not replace the selected text.


    Using the Clipboard

    The Windows clipboard allows you to pass data from one program to another, as well as within a given program. The following clipboard commands are supported:

    A number of system clipboard formats are supported. These can be used to transfer data to different types of programs:

    TEXT Clipboard Format

    The TEXT clipboard format normally stores text as ASCII information. This works well for English, but does not work well for Japanese text, since ASCII can hold only 256 distinct characters. To get around this, a number of Japanese encoding systems have been developed. All of these work by inserting the Japanese characters in some unusual way that tricks most programs into accepting them as normal text. If you ever see text that looks something like:

    @"߂Âɂ‚A

    you may be seeing Japanese text that has not been decoded properly.

    This format is not supported under Windows CE. When working in TEXT format you will need to deal with encoding and decoding issues.

    UNICODETEXT Clipboard Format

    The UNICODETEXT clipboard format generally passes data in the form of UNICODE data. UNICODE is a computer system of storing characters that provides for all languages of the world. This simplifies the job of writing software that can be used in more than one language. This system appears to be winning out over other encoding systems.

    If UNICODETEXT data is available, JWPce will use this format as the preferred clipboard format. This allows seamless communication between JWPce and other UNICODE capable programs (including Microsoft Word, Internet Explorer, and Outlook).

    Only Windows ME/NT/2000/XP support both TEXT and UNICODETEXT data, which allows JWPce to easily detect UNICODE data. All other systems really only support one format; because of this, determination of the correct encoding format can be difficult.

    On Windows, JWPce generally exports UNICODE data to the UNICODETEXT format regardless of the export format you have chosen (which will be exported to TEXT format, see below). Under Windows 95/98, however, very few programs support the UNICODETEXT format.

    Windows CE supports the UNICODETEXT format only, so all data must be exported though this format. If one of the encoding systems other than UNICODE is selected, the clipboard will actually contain UNICODE values for the ASCII characters in the encoded text.


    Technical Tip: The UNICODETEXT format can be disabled on Windows machines by using the No UNICODETEXT format checkbox on the File/Clipboard page of the Options dialog box. Generally, this is not necessary, but under some circumstances it may be useful. For example, when trying to insert shift-JIS formatted text into some NT programs, that don't have a Paste/Special... option, they may only ready the UNICODETEXT data and not the TEXT data. In such cases disabling the UNICODETEXT format may be necessary

    BITMAP Clipboard Format

    The BITMAP clipboard places a bitmap on the clipboard that contains the image of the selected text. The bitmap can then be imported into a word processor, allowing almost any word processor to contain Japanese text but not to edit it; this technique was use in this manual.

    The font used to render the bitmap image can be set separately from the font used to render main text. You can even have JWPce render the clipboard bitmap using vertical writing by setting the font as vertical. These can be set on the Font/Format page of the Options dialog.


    Tip: If you use this method you can the best quality of text by changing the clipboard font to a larger font (Font/Format page of the Options dialog), and then reducing the font size in the word processor. This allows the word processor to print the Japanese characters at a much higher resolution.

    If you are using the color-kanji you can choose whether or not the bitmap exported to the clipboard should be in color. This is controlled by the Clipboard BITMAP checkbox on the Misc page of the Options dialog (Utilities/Options... or Ctrl+O). If you do not use color, JWPce generates a 1 bit-plane black and white bitmap. If you use color, the bitmap depth matches your screen resolution.


    Tip: If you are using Microsoft Word, there are better ways to display Japanese. In particular you can get Microsoft's Japanese support kit for Word (as of this writing this was free). You can then export UNICODE data from JWPce and import it directly into Word. You can manipulate the data in Word, and you can print the data in good quality.

    Depending on the version of Word you are using and the document you are editing (in Word), you may have to select the text that you just pasted into the document and change the font to a Japanese font to view the text correctly. This problem can usually be clearly identified when the text you just inserted shows up only as a sequence of boxes.



    Technical Tip: The BITMAP format can be disabled on Windows machines by using the No BITMAP format checkbox on the File/Clipboard page of the Options dialog box. Generally, this is not necessary, but under some circumstances it may be useful. For example, some programs have been known to try to import the bitmap image instead of the text. In such cases disabling the BITMAP format may be necessary.

    Related Topics


    Clipboard Encoding

    When exporting or importing from the clipboard in TEXT format (or UNICODETEXT on Windows CE) you have to deal with the Japanese encoding methods. (A more comprehensive discussion of encoding systems is presented later.) JWPce supports the following encoding systems: EUC, Shift-JIS, New JIS, Old JIS, NEC JIS, UTF-7, UTF-8 and UNICODE. These are all methods for encoding Japanese characters into normal ASCII encoding space (except UNICODE, which is a completely new encoding system).

    Export Encoding

    When exporting data you simply choose the format you want to export the data as (File/Clipboard page of the Options dialog box, Utilities/Options... or Ctrl+O). The default format is Shift-JIS. You need to choose a format that is compatible with the application you are going to import the data to.


    Tip: Until recently Shift-JIS was the most common format, but you must use UNICODE format if you want to import into most Microsoft applications. If you need to send data through some old style e-mail systems you should probably try New JIS format, since it does not use extended ASCII codes.

    Import Encoding

    Importing data is somewhat more difficult, because you may not know the format of the data. Generally, however, you can allow JWPce to attempt to determine the type of data on the clipboard. This is activated by setting the Import option to Auto-Detect on the File/Clipboard page of the Options dialog box (Utilities/Options..., Ctrl+O).

    Most of the time you should leave the clipboard import set to Auto-Detect. It is not always possible to determine without doubt which of the Japanese encoding formats is being used. When JWPce cannot determine the format, it will default to Shift-JIS. In these cases, you may need to force the encoding system to EUC or UNICODE to correctly decode the data. This is more likely to be a problem on very short text sequences. (A more comprehensive discussion of encoding systems is presented later.)


    WARNING! Because UTF-7 format was designed to be indistinguishable from simple ASCII text, JWPce auto-detect cannot identify UTF-7 encoded files.

    Related Topics


    Undo and Redo

    Because mistakes happen, you can undo the most recent changes you made to your document. Instead of saving every individual change to your document, changes are grouped together and thus can be undone in a block. For example, if you delete a number of characters all in a row, these deletions will be grouped together into one undo operation.

    To undo actions, you can execute the Edit/Undo command (Ctrl+Z), or Undo from the popup menu. Each time you execute the undo command, one undo level is undone until you run out of stored changes. You can also use the File/Revert (Alt+R) command to undo all changes to the file since you last saved it.

    If you accidentally undo more than you wanted to you can redo your last changes (Edit/Redo, Redo from the popup menu, or Ctrl+Y). You can redo anything you have undone until you make an editing change to the file, at which time the redo actions are disposed of. You can, for example, use the cursor commands to move around the document without loosing your ability to redo changes.

    By default JWPce keeps the last 50 changes per file. You can adjust the number of changes on the Advanced page of the Options dialog (Utilities/Options... or Ctrl+O).


    Search and Replace

    JWPce has a number of search features that are designed to allow you to find text, and/or to replace text within your file(s). The search commands are the following:

    When you start a search or replace operation, JWPce displays the appropriate dialog box (the Search for Text dialog lacks the Replace by: box and the No Confirmation check box shown in the illustrated Search and Replace dialog):

    The main contents of the dialog box are: the Search for string, which is what we will search for; the Replace by string, which is what it is to be replaced with; an input mode selection button (K->A->J); and a number of check boxes for flags. Note that both the Search for and Replace by string have history buffer associated with them, thus you can recall previous entries. The check boxes have the following actions:

    Ignore CaseTreats upper case and lower case ASCII and JASCII characters as the same.
    JASCII = ASCIITreats JASCII and ASCII characters as the same.
    BackwardSearches backward through the file (this flag is always cleared when you enter the dialog).
    Wrap AroundWhen the search is complete, this flag allows it to start over again at the beginning of the file.
    All Open FilesSearches through all open files, going on to the next file after it is done with the current file.
    No Confirmation Performs replacements without asking for confirmation (this flag is always cleared on entering the Search and Replace Text dialog box.).

    When you execute a search or replace, JWPce searches until it finds the string. The found string is shown highlighted when the search ends.

    When you execute a replace command, you can either have the replace operations performed automatically, or JWPce will confirm each change with you. When confirming a change you can choose to replace the text, not replace the text, abort the search or replace all occurrences of the text (same as choosing the No Confirmation option above). After doing a search and replace with the No Confirmation option, a dialog box indicating the number of changes will be displayed.

    The Edit/Find Next command (Ctrl+N or F9) can be used to continue the last search or replace operation. The direction of the search can be reversed using the Edit/Reverse Search command (Ctrl+B or F7). This can be used to backup if you have missed something you were lookup for.

    Normally, JWPce keeps the Search or Replace dialog boxes open during the search so you can search again. You can disable this behavior by clearing the Keep Search Dialogs Open checkbox on the Advanced page of the Options dialog.


    Tip: If you select text before executing the search or replace command, JWPce will automatically load the Search for string with the text you selected.


    Next Chapter: Working with Kanji