Appearance and positioning annotation text string and base text string specifying a rule that relates the formatting annotation, base text characters

A computer-implemented method to embellish text in a document by setting composite text properties for formatting an annotation text string and a base text string in a composite text unit, selecting text in a displayed text document as the base text string for a composite text unit, generating text as an annotation text string for the composite text unit, and displaying the composite text unit in the text document in accordance with the composite text properties.

DETAILED DESCRIPTION
 FIG. 1 shows an example of a sentence in a document that can be created and
 edited using an interactive word processing program. As shown, the
 sentence includes both standard text (without annotation text) (such as
 word 110) and composite text (such as unit 120), which is a combination of
 base text 120a and associated annotation text 120b. Base text 120a of
 composite text unit 120 is formatted in the same way as is standard text
 110, and can be generated from standard text.
 FIG. 2 describes a method for generating a composite text unit from a
 standard text string. A string of standard text is selected as the base
 text string of a composite text unit (step 210). An appropriate user
 interface can be provided to enable this designation.
 In general, any string may be designated for a composite text unit, subject
 to application specific constraints. For example, guidelines set forth by
 a Japanese Industry Standard (JIS) for Japanese typography (annotation
 text of rubi text; base text of oyamoji text) require that a single
 composite text unit not extend beyond a single line when rendered. To
 comply with the JIS standard, therefore, text selection extending beyond a
 single line may be compressed to fit within a line or an appropriate
 warning or error dialog box may be displayed. Applications not having to
 comply with the JIS guidelines may be implemented to handle this situation
 as desired.
 Step 220 sets the properties of the composite text unit. In some
 applications, once the composite text properties for a document are
 initially set by a user, those properties are applied in step 220 when
 composite text units are subsequently created in the document until the
 properties are specifically changed. Alternatively, an application may
 require the user to set the properties for the composite text unit each
 time a composite text unit is created. Some applications may apply
 predetermined default composite text properties until specifically changed
 by a user.
 The composite text properties define the formatting of a composite text
 unit, affecting the appearance and positioning of the annotation and base
 text strings. Examples of such properties include character set (e.g.,
 Roman, Arabic, Japanese), font, font size, and alignment.
 Composite text properties may be defined in various ways. FIG. 3 shows an
 example of a dialog box 300 for setting composite text properties,
 allowing font size 310 to be specified as a percentage of the font size of
 the base text. Font size options may alternatively be specified as metric
 point sizes.
 The options for a property such as font size may vary depending on the
 particular application. For example, the font size may be limited by
 external constraints, such as specification in the JIS guidelines of a
 permissible font size range. Font size may also be limited by internal
 practical constraints based on, for example, the character set of the
 annotation text or the line spacing of the text document.
 Dialog box 300 also allows a user to choose from a variety of alignment
 options 320 for the annotation text string with base text string, taking
 into consideration the character sets of both the annotation and base text
 strings. For example, FIG. 3 provides alignment options for an annotation
 text string of rubi text with a base text string comprised of Japanese
 oyamoji characters as well as an annotation text string of rubi text with
 a base text string comprised of "other" oyamoji characters, which may be,
 for example, Roman characters. This allows the user to handle combinations
 of different texts differently.
 Although FIG. 3 shows the same alignment options for both Japanese oyamoji
 and Other oyamwji, the specific alignment options may vary for different
 combinations of base and annotation character sets.
 For the alignment sets 330, 335, 340, 345, if the natural width (the width
 of a text string as it would appear without additional spacing inserted)
 of the annotation text string and base text string are equal, the
 annotation text string will simply be printed above the base text string
 and no alignment rule is applied.
 When the annotation text string and base text string are of different
 widths, the dialog box 300 of FIG. 3 provides two sets of options in two
 columns: the left column (330, 340) presents options when the natural
 width of the annotation text string is less than the natural width of the
 base text string; the right column (335, 345) presents options when the
 natural width of the annotation text string is greater than the natural
 width of the base text string.
 Referring to sets 330 and 335 (which are respectively identical to sets 340
 and 345) the first option of each set inserts preceding, inter-character,
 and trailing spaces in the text string of narrower width, in the
 proportions of 1:2:1, illustrated in greater detail in FIG. 4. The
 specific size of a standard spacing unit will depend on the widths of the
 annotation and base text strings and the widths of individual characters
 within the text strings.
 For example, assume the following variables for a composite text unit:

W.sub.a total natural width of annotation text
 string
 W.sub.b total natural width of base text string
 W.sub.s = .linevert split.W.sub.a = W.sub.b.linevert split. total
 width of space to be inserted
 n.sub.a number of characters in annotation text
 string
 n.sub.b number of characters in base text string
 n.sub.s total number of spacing units to be
 inserted
 w.sub.s = W.sub.s /n.sub.s width occupied by a single spacing unit
 If the annotation text string has a greater width than the base text
 string, W.sub.a &gt;W.sub.b and space is inserted in the base text string.
 The number of spacing units n.sub.s (one spacing unit in a preceding
 space, two spacing units in each inter-character space, and one spacing
 unit in a trailing space) is equal to 2*n.sub.b.
 If the annotation text string has a smaller width than the base text
 string, W.sub.a &lt;W.sub.b and space is inserted in the annotation text
 string. n.sub.s is equal to 2*n.sub.a.
 In either case, the width of a standard spacing unit w.sub.s is calculated,
 and spaces of appropriate widths can be calculated and inserted.
 The second option of each set is center justified, centering the text
 string of narrower width without inserting inter-character spaces.
 The third option of each set is full justified, aligning the ends of the
 base and annotation text strings. Spaces of equal width are calculated and
 inserted between the characters of the narrower text string.
 Dialog box 300 also provides an overhang feature 350 used when the
 annotation text string has a greater width than the base text string. The
 overhang feature 350 inserts less space into the base text string and
 allows the annotation text string to slightly extend beyond (or overhang)
 the ends of the base text string.
 FIG. 5 illustrates possible modifications to alignment options when the
 annotation text string is wider than the base text string (335', 345'),
 resulting from selection of the overhang feature 350. As shown, if the
 annotation text string is not wider than the base text string (330',
 340'), selection of the overhang feature 350 has no effect.
 In this example, the annotation text string overhangs the text surrounding
 the base text string by half the width of the left-most and right-most
 characters of the annotation text string. The amount of overhang may vary.
 For example, rules may be provided to vary the overhang based on the
 difference in widths of the annotation and base text strings. Different
 rules may be provided to apply when the composite text unit falls at a
 line boundary (discussed below), or, for example, when the text is written
 vertically rather than horizontally.
 Dialog box 300 of FIG. 3 also provides a line boundary alignment option
 360, which varies the alignment options when a composite text unit occurs
 at a line boundary (i.e., the beginning or end of a line). The variations
 may simply be modifications of the general options 330, 335, 340, 345. For
 example, FIG. 6 illustrates possible variations for the second options of
 sets 330 and 335 with the line boundary alignment option 360 set.
 Alternatively, the variations may use a different spacing method. For
 example, rather than the 1:2:1 spacing described above and illustrated in
 FIG. 4, FIG. 7a shows left justification of the narrower text string when
 the composite text unit occurs at the beginning of a line, inserting equal
 spaces for inter-character and trailing spaces. FIG. 7b shows a
 corresponding option, right justifying the narrower text string when the
 composite text unit occurs at the end of a line.
 Additional options may be provided for composite text units occurring at a
 line boundary. For example, a rule may be that when the overhang feature
 350 and line boundary alignment option 360 are both selected, overhang is
 not used on the side of the composite aligned with the line boundary.
 In addition to the composite text properties set by a user, other
 formatting rules may be implemented. For example, the JIS guideline
 requirement discussed above, requiring that a composite text unit occur on
 a single line may be implemented. Additional formatting rules may include,
 for example, rules for handling tabs imbedded in either the base or
 annotation text strings of a composite text unit, rules for handling tabs
 occurring just prior to the composite text unit, handling superscript and
 subscript text, and handling footnotes within a composite text unit. FIG.
 8 illustrates examples showing how a composite text unit immediately
 following different types of tabs may be handled.
 As a user inputs characters of an annotation text string (step 230), the
 characters appear directly in the screen display of the document in
 accordance with the set composite text properties and other predefined
 formatting rules (step 240). This provides real time feedback to enable
 the user to view the annotation text string as it will appear in the
 document when rendered or output. Alternative viewing options, such as
 providing a dialog box with an enlarged view of the composite text unit,
 may also be provided.
 The appearance of a composite text unit may be modified as desired. In the
 examples provided, an annotation text string is displayed in a smaller
 font size directly above its corresponding base text string. As an example
 of an alternative, in traditional Japanese text in which the base text
 string is displayed vertically, annotation text string may be displayed
 vertically on either side of the base text string.
 FIG. 9a illustrates a composite text unit 910 within a sentence, and FIG.
 9b illustrates a possible internal representation of the sentence. FIG. 9b
 represents the beginning and end of composite and annotation text strings
 using formatting codes 920a, 920b, 930a, 930b. Specifically, 920a and 920b
 respectively designate the beginning and end of a composite text unit 910,
 and 930a and 930b respectively designate the beginning and end of an
 annotation text string 910b.
 FIG. 9a also illustrates that segments within a composite text unit may be
 formatted. The bold word in the base text string and italic word in the
 annotation text string may be represented using an implementation such as
 that illustrated in FIG. 9b by inserting formatting codes at appropriate
 positions within the sentence. In this example, charformat1 (940a, 940b)
 specifies bold and charformat2 (950a, 950b) specifies italic. Similar
 formatting codes may be inserted for other formatting variations such as
 size, angle weight, color, spread, subscript, superscript, and pair
 kerning.
 Once generated, a composite text unit may be freely edited. Edits are also
 displayed as they are entered in accordance with the composite text
 properties and applicable formatting rules.
 Editing methods may vary. Word processing programs generally have a
 user-positioned insertion point in the text displayed as a cursor position
 1010, as shown in FIGS. 10a-10c. To edit a composite text unit, the cursor
 position may be positioned within either the base or annotation text
 strings. Using the implementation shown in FIGS. 9a and 9b, the composite
 text unit may be edited when the cursor is positioned after the format
 code marking the beginning of the composite text unit 920a and before
 corresponding format code 920b. As the user forwards the cursor, the
 cursor position moves through the base text string 910a of the composite
 text unit, and after passing the last character in the base text string
 910a, moves to the first character of the annotation text string 910b
 rather to the text 960 following the composite text unit 910.
 FIG. 10 illustrates text as it appears using a user interface that displays
 a bounding box 1020 around a composite text unit when the cursor position
 1010 is within the composite text unit. Displaying the bounding box 1020
 avoids user ambiguity as to whether the text to be edited is standard or
 composite text. While the cursor position 1010 is outside the composite
 text unit as in FIG. 10a, the bounding box is not displayed. Only when the
 cursor position 1010 moves within the composite text unit, either within
 the base text string as shown in FIG. 10b or the annotation text string as
 shown in FIG. 10c, is the bounding box 1020 displayed. Referring to the
 example of FIG. 9b, the bounding box is displayed while the cursor is
 positioned between format codes 920a and 920b.
 As a composite text unit is modified, its display maintains previously set
 composite text properties.
 Instead of providing a bounding box, other methods of emphasizing the
 composite text unit, such as highlighting, may be used. Further, a dialog
 box may be provided for editing an annotation text string. For example, if
 the font of the annotation text string is very small and difficult to
 display or view, the application may provide a viewing option to the user
 to open a dialog box for editing the annotation text string, providing an
 enlarged display of the composite text unit.
 As an alternative to editing or formatting a composite text unit character
 by character, a user may select a portion of the annotation or base text
 strings and reformat the selected portion. Word processing applications
 generally allow a user to select a string of text, as shown in FIG. 11a,
 for editing. In FIG. 11a, the selection is outside the composite text
 unit. The user may also select a string of text within the composite text
 unit, either within the base text string as shown in FIG. 11b, or within
 the annotation text string as shown in FIG. 11c. Selection may be used,
 for example, to reformat a word to be in bold or italics, as shown in the
 composite text unit 910 of FIGS. 9a and 9b.
 The invention may be implemented in hardware or software, or a combination
 of both. Preferably, the invention is implemented in a software program
 executing on a programmable processing system comprising a processor, a
 data storage system, an input device, and an output device.
 FIG. 12 illustrates one such programmable processing system 1200, including
 a CPU 1210, a RAM 1220, and an I/O controller 1230 coupled by a CPU bus
 1240. The I/O controller 1230 is also coupled by an I/O bus 1250 to input
 devices such as a keyboard 1260 and mouse 1270, and output devices such as
 a display 1280.
 Other embodiments are within the scope of the following claims. For
 example, a user may reset the composite text properties each time a new
 composite text unit is created. Alternatively, the user may set the
 composite text properties once, and those properties will be applied to
 each composite text unit created thereafter until the properties are
 changed.
 As another variation, various character sets may be used for characters of
 the base and annotation text. The annotation text string may be printed in
 a different position relative to the base text string. For example,
 instead of being printed above the base text string, the annotation text
 string may be printed below the base text string. Or, if the base text
 string is written vertically, the annotation text string would more
 naturally be printed vertically alongside the base text string.
 Various formatting rules may be provided as needed for specific
 applications. For example, the rule that composite text unit must be
 printed on the same line may not hold true for text not subject to the JIS
 guidelines. Similarly, the precise spacing rules may vary depending on the
 character set.