Abstract:
Method and apparatus, including computer program products, implementing and using techniques for controlling leading. A region including a plurality of lines in data being typeset and displayed on a display device is specified. One of the lines in the plurality of lines is selected, and a user input is received to set a new leading value (S 11 , S 12 ). The current leading value of the selected line is determined (S 13 ). The difference between the new leading value and the current leading value is determined (S 14 ). The spacing amount of the selected line based on the difference is adjusted. A desktop publishing system for controlling leading is also described.

Description:
TECHNICAL FIELD 
   The invention relates to desktop publishing (DTP) technology, and more and more particularly to a typesetting technology for DTP. 
   BACKGROUND 
   In DTP using computers, data to be edited is displayed on a display device, and layout and typesetting operations (i.e., character typesetting) are performed on this data based on user input. In typesetting operations, “gyookuri” (leading in European-language typesetting), which is the relative positional relationship between a plurality of lines, is set. Leading is the distance between a line and the next line when the line is displayed or printed, and thus corresponds to the distance from one line&#39;s reference point to the next line&#39;s reference point. Therefore, leading includes one line&#39;s “line height” and the “spacing amount” (i.e., interline spacing) between that line and the next line. 
   However, there are situations in which the character data to be edited is not just Japanese but also a European language, and there are situations in which the two are mixed together. Therefore a DTP system needs to be capable of processing European languages as well as Japanese, and to handle documents containing a mixture of European languages and Japanese. When doing so, there are a number of points in which the typesetting rules for European language typesetting and Japanese typesetting differ, so automating DTP typesetting operations has proven to be difficult, and conventional DTP using computers must be processed by many manual user operations. Leading in typesetting operations is an example of a situation in which manual intervention by the user at present is unavoidable, thus making the typesetting operation difficult and complicated. 
   For example, in European language typesetting and conventional DTP, leading (i.e. “gyookuri” in Japanese) is set as a distance from a current line&#39;s baseline to a previous line&#39;s baseline. That is, as shown in  FIG. 7A , in European-language typesetting two lines included in text frame  31  on the screen of a display device displaying data that is undergoing typesetting are coordinated and positioned on their respective baselines  29  and  30 , and distance  32  between the first line&#39;s baseline and the next line&#39;s baseline corresponds to the leading. Therefore the top side of text frame  31 , i.e. the top side of the first line, is offset downward by exactly gap  33  from reference line  28  set in the page. 
   On the other hand,  FIG. 7B  shows a case in which Japanese text is assigned inside text frame  35 . As in  FIG. 7A , this is a case in which the text is positioned according to the European-language baseline. Both examples are 24-point characters, and show a situation in which the result of automatic leading setting is leading (e.g. leading  32  and  36 ) set to a 29-point dimension. Both text frame  31  and  35  are coordinated on the European-language baseline. Nevertheless, the top side and the bottom side of the text frame  35  in  FIG. 7B  are vertically offset (e.g. gap  37  and  38 ) from the top side and bottom side of the text frame in  FIG. 7A . In  FIG. 7B , unlike the case in  FIG. 7A , the top side of the text frame, i.e. the top side of the first line, is coordinated with reference line  34  set in the page. 
   In nearly all electronic typesetting today leading is set with reference to a baseline, so when the leading value of a current line is increased, for example, that line moves downward inside the text frame and is positioned more distantly from the previous line. Nevertheless, changing the current line&#39;s position by changing the leading value setting in this manner is not desirable, particularly in Japanese typesetting, so the user needs to manually correct the vertical position of one or more lines each time the set leading value changes. 
   SUMMARY 
   In general, in one aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for controlling leading. A region including a plurality of lines of data being typeset and displayed on a display device is selected. One of the lines in the plurality of lines is selected, and a user input is received to set a new leading value. The current leading value of the selected line is determined. The difference between the new leading value and the current leading value is determined and the spacing amount of the selected line is adjusted based on the difference. 
   Implementations can include one or more of the following features. Lines below the selected line can be processed sequentially and continuously, subsequent to processing the selected line, until the next to last line in the plurality of lines. The leading value can be the distance between the maximum height position of one line and the maximum height position of the next line. The maximum height can be the maximum point dimension among the plurality of data point dimensions included in a line. The leading value can be the sum of the height and spacing amount for one line, the line height can be the maximum height of the line, and the spacing amount can be the distance between the bottom part of the line and the maximum height position of the next line. 
   In general, in another aspect, the invention provides a desktop publishing system implementing and using techniques for controlling leading. The desktop publishing system includes a desktop publishing processing control device that is provided with typesetting control means, a display device displaying data being typeset and input means for user input. The typesetting control means have a leading control means that is arranged to receive a user specification of a region including a plurality of lines in the data being typeset, select one of the lines in the plurality of lines and set a new leading value for the selected line. Furthermore, the leading control means is arranged to determine a consecutive line height and spacing amount for the selected line and the next line, determine a current leading value and adjust a current spacing amount based on the new leading value and the current leading value. 
   In general, in another aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for controlling leading. A user specification of a region including a plurality of lines in the data being typeset is received. One of the lines in the plurality of lines is selected. A new leading value for the selected line is set. A consecutive line height and spacing amount for the selected line and the next line is determined. A current leading value is determined and a current spacing amount is adjusted based on the new leading value and the current leading value. 
   Potential advantages of the invention may include one or more of the following. The aforesaid defects of prior art may be eliminated in and leading control in electronic typesetting may be improved. A leading control technology for electronic typesetting can be provided that may make it possible to automatically change all leading without requiring manual adjustment by the user. A DTP system may be provided that can appropriately and swiftly set and change leading for text comprising English or Japanese or a mixture thereof. An improved leading control method for electronic typesetting and a recording medium storing a leading control program may be provided. 
   The details of one or more implementations of the invention are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the invention will be apparent from the description and drawings, and from the claims. 

   
     DESCRIPTION OF DRAWINGS 
       FIG. 1  is a schematic block diagram showing a DTP system capable of controlling leading in accordance with one implementation of the invention. 
       FIG. 2  is a schematic block diagram showing a DTP system capable of controlling leading in accordance with another implementation of the invention. 
       FIG. 3  is a schematic diagram explaining various parameters that are used when setting leading in the invention. 
       FIGS. 4A-4D  are schematic diagrams showing a plurality of lines, to be set with new leading, arranged in a text frame displayed on the screen of a display device. 
       FIGS. 5A and 5B  are flowcharts showing the leading control sequence in electronic typesetting in accordance with one implementation of the invention. 
       FIG. 6  is a schematic diagram showing embox  30  that is used when controlling leading in one implementation of the invention. 
       FIGS. 7A and 7B  are schematic diagrams comparing the differences in European language and Japanese when leading is set automatically in conventional electronic typesetting. 
   

   Like reference symbols in the various drawings indicate like elements. 
   DETAILED DESCRIPTION 
     FIG. 1  shows an electronic DTP processing system  1  in accordance with one implementation of the invention. DTP processing system  1  shown in  FIG. 1  has a DTP processing control device  2 , which can perform electronic typesetting and layout editing and so forth; a display device  3  for displaying the data being processed; an input means  5  for inputting various types of data such as graphics, text, control instructions, etc.; and an output means  6  for outputting processed data. DTP processing control device  2  has typesetting control means  2   a , which controls typesetting, and layout control means  2   b , which controls layout editing. Typesetting control means  2   a  has leading control means  8 , which automatically sets and changes leading for a plurality of lines in a region specified in the data being typeset in electronic typesetting. 
   Display device  3  can comprise various types of display devices such as a CRT or LCD, etc. Input means  5  can include a keyboard, pointing device (mouse, track ball, track point, etc.), scanner, communication interface, etc. In addition, output means  6  can comprise a printer, external memory device, etc. DTP processing control device  2  can consist of a processor such as a CPU, etc., or a memory, or an electronic typesetting processing program, etc. that includes a leading control routine that is loaded into memory and processed by a processor. On the other hand, DTP processing control device  2  can also be constituted in part or in whole as hardware or firmware. 
     FIG. 2  is a block diagram showing a DTP system  10  provided with the leading processing function in accordance with the invention, constituted by applying the invention to a general-purpose computer system. That is, system  10  shown in  FIG. 2  has a CPU  11 , a memory  12 , a CRT  13 , a hard disk  14 , a keyboard  15 , a mouse  16 , a CD-ROM drive  17 , a FD drive  18 , and a printer  19 . These units are connected and work together via a bus  9 . In electronic typesetting in accordance with the invention, a leading control program  8  is installed in system  10  via CD-ROM drive  17  or FD drive  18 , and stored on hard disk  14 , for example. Then, when this leading control program  8  or an electronic typesetting program containing the leading control program are started by a user operating keyboard  15  or mouse  16 , the leading control program is loaded into memory  12  as shown in the diagram. Therefore the leading control means is constituted as CPU  11  and layout editing program  8  loaded into memory  12 . Therefore, in accordance with one aspect of the invention a computer-readable recording medium (for example, CD-ROM, FD, tape, semiconductor memory, etc.) storing a leading control program is provided so that a general-purpose computer system can be converted into a DTP system providing the leading control function in accordance with the invention. 
     FIG. 3  shows two lines to be set with the desired leading value in accordance with the invention. The lines constitute part of data being electronically typeset that is displayed on the screen of display device  3 . Each line  20  is displayed on the page of an electronic document displayed on the screen. Each line  20  has a plurality of cells  20   a , with each cell  20   a  containing one character. Each line  20  has a top part (top side)  20   b  and a bottom part (bottom side)  20   c , and the distance  23  in the vertical direction between the top part  20   b  and the bottom part  20   c  is the height of the line. The vertical distance  21  between the first line&#39;s top part  20   b  and the second line&#39;s top part is the leading value for these lines. In addition, vertical distance  22  between the first line&#39;s bottom part  20   c  and the second line&#39;s top part is the spacing (interline spacing) amount. Therefore leading value  21  is defined as the sum of line height  23  and spacing amount  22 . Furthermore, one feature of the invention is that line height  23  and spacing amount  22  are handled as two different quantities. 
   Furthermore, it should be noted that each line does not always contain characters having the same font or dimensions; there are instances in which different fonts, particularly fonts including characters with different dimensions, are included in a line. In such a situation the invention determines the top part  20   b  and the bottom part  20   c  of a line according to the maximum height position and the minimum height position of the line, respectively. In this case one implementation of the invention uses the “embox” concept to regulate character arrangement within each line. As shown in  FIG. 6 , an embox is frame  40  surrounding glyph  42  (the character “a” in this case), and corresponds to a so-called “imaginary body.” Embox  40  is square in shape and the length of one side of the embox corresponds to the character&#39;s point dimension H. Furthermore,  FIG. 6  shows bounding box (surrounding box)  41  surrounding glyph  42 . The bounding box is defined by a pair of parallel horizontal lines and a pair of parallel vertical lines that touch the outermost points of glyph  42  in the vertical and horizontal directions. Bounding box  41  corresponds to the so-called “character face.” The height of embox  40  is the point dimension, and the point dimension is one of the attributes of glyph  42 , so the height of a line can be determined by checking the point dimensions of all of the characters to be included in the line. Also, in one implementation of the invention, the plurality of characters included within a line is arranged by aligning the bottom sides of the characters&#39; emboxes  40  so in this case the embox  40  of the character with the largest point dimension within the line projects upward compared to the others. 
   Next, the leading control function in accordance with one implementation of the invention will be explained with reference to  FIGS. 4 and 5 . 
     FIG. 4  schematically shows (a) through (d), which are within a plurality of lines displayed within rectangular text frames on the page of an electronic document that is undergoing electronic typesetting and is displayed on the screen of display device  3  (CRT  13 ). Furthermore, a text frame can be created as a rectangular region by the user selecting a text tool for text input from a tool box (not shown in drawings) displayed on the screen, for example, and moving the cursor on the screen and determining the position of the cursor. Text can then be arranged within this text frame by typing and inputting the text directly into the text frame or by flowing the text in from another file. In addition, part of text already present on the electronic page can be selected and inserted into the text frame. Values such as line length and leading within the text frame are set as defaults or by user settings. Therefore, when character data is input into a text frame, characters are arranged in each line and the separation between lines is set according to the set leading value as shown in  FIG. 4  for the respective lines. 
   However, as described previously, each line does not always contain characters that all have the same size (point dimension), and in this implementation the characters in each line are arranged with all of their embox bottom parts (bottom sides) aligned on a reference line (for example, a horizontal line on a grid in the text frame), so for large characters have large emboxes, the emboxes project upwards compared to the other emboxes for small characters. Therefore, in current line (a) in  FIG. 4  the largest character is arranged near the end of the line, and the embox for that character projects upward compared to the emboxes for the other characters, and the embox determines the line height Hi, and thus the maximum height position for that line. In addition, in the next line (b) the largest character is positioned near the center of the line, and the embox for this character projects upward compared to the emboxes of the other characters, and the dimensions of this embox regulates line height Hi, and thus the maximum height position of that line. The spacing (i.e. interline spacing) Ai is determined between the position of the bottom part of current line (a) and the maximum height position of the next line (b). The distance between the maximum height position of current line (a) and the maximum height position of next line (b) is leading Li. As shown in  FIG. 4 , the largest character in last line (d) is positioned near the end of that line, but in second line from last (c) all of the characters in the line are the same size. 
   Next, an example of setting leading according to an electronic typesetting leading control procedure in accordance with an implementation of the invention will be explained with reference to  FIGS. 5A and 5B . First, assume that the user operates input means  5 , which is mouse  16 , keyboard  15  or the like, and uses mouse  16  or keyboard  15  to select (step S 1 ) current line (a) (this does not always have to be the first line in a text frame) shown in  FIG. 4 , among a plurality of lines displayed in a text frame, and sets a new leading value for the plurality of lines from current line (a) through last line (d) (step S 2 ). When this happens, the leading control means executes the “spacing calculation procedure” (step S 3 ) shown in  FIG. 5B  and determines leading value Li set for the selected current line (a). 
   That is, as shown in the process in  FIG. 5B , the leading control means finds the maximum size—for example, the maximum point dimension—within selected current line (a), and determines the line&#39;s height Hi and the position for the maximum height of the line (step S 11 ). Next, the process finds the maximum size—for example, the maximum point dimension—within the next line (b), and determines the height Hi+1 of that line and the position of the maximum height for that line (step S 12 ). The process then determines the leading value Li set for current line (a) as the difference between the maximum height position of current line (a) and the maximum height position of next line (b) determined in this manner (step S 13 ). Next, the process calculates spacing amount Ai for current line (a) using the formula Ai=Li-Hi, from thus determined leading value Li and previously determined line height Hi (step S 14 ). Furthermore, if the process knows that the same leading value was set for all of the lines, or if the leading value set for each line can be input, a subroutine can be added to step S 11  to branch to step S 14  after determining the line height Hi of the current line (a). 
   When the spacing amount Ai for the current line is determined as described above, next, the leading value Li set for current line (a) and the new leading value Ln are compared (step S 4 ), and if the new leading value Ln is larger, the difference ΔL between the new leading value Ln and the leading value Li is added to the spacing amount Ai for the current line (step S 5 ), while if the new leading value Ln is smaller, the difference ΔL between the leading value Li and the new leading value Ln is subtracted from the current spacing amount Ai for the current line (step S 6 ), and as a result, a new leading value Ln is set for current line (a). 
   Next, the processing is executed sequentially for the line following line (b), and processing is continuously executed until line (c), the second line from (d), the last line in the frame. In this case, when the preset leading value for all of the lines is already known, or when it is already known that all of the lines have the same leading value, only the height Hi for each line is determined, and a branch routine to adjust the spacing amount for each line by adding or subtracting Hi and the already known leading value can be provided. 
   Therefore, the leading control mechanism in accordance with the invention described above can set a new leading value and move only the lines following the selected line without moving the selected current line. Leading can therefore be automatically set in electronic typesetting, which conventionally is done manually for Japanese, and the efficiency of typesetting operations can be increased. In addition, the position of the selected current line does not change regardless of whether the leading value for the line is increased or decreased. 
   In addition, in another implementation of the invention the spacing amount Ai obtained at the top can be arranged for each line calculated as described above or for appropriately selected lines. In this case, the current line moves upward or downward according to the size of spacing amount Ai, which makes it possible to provide a function that is the same as leading control referenced upon a baseline in European-language typesetting. 
   A number of implementations of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. Accordingly, other implementations are within the scope of the following claims.