Image data creation method and program

The information processing apparatus adjusts font size and line breaks to fit text within a specified drawing area, addressing the issue of text exceeding the number of lines, thereby achieving a tailored display.

JP7580195B2Active Publication Date: 2024-11-11CANON FINETECH NISCA INC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2020026442
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-02-19
Publication Date
2024-11-11
Estimated Expiration
2040-02-19

AI Technical Summary

Technical Problem

Existing methods fail to ensure that text data fits within a specified drawing area and adheres to a predetermined number of lines, leading to improper text display.

Method used

An information processing apparatus that sets a maximum number of lines and adjusts font size and line breaks to ensure text fits within the specified area, using automatic line feed insertion, text division, and font reduction.

Benefits of technology

Enables a tailored display that respects the maximum number of lines and font size, ensuring text fits within the drawing area without exceeding the specified limits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007580195000001
    Figure 0007580195000001
  • Figure 0007580195000002
    Figure 0007580195000002
  • Figure 0007580195000003
    Figure 0007580195000003
Patent Text Reader

Abstract

To provide an information processing device that realizes a display suitable for a text object having a defined maximum number of lines.SOLUTION: When a drawing result of text data input to a text object in which the maximum number of lines is defined exceeds the maximum number of lines, an information processing device reduces a character string included in the text data and displays on the text object the text data in which the character string is reduced. The character string is reduced based on the drawing width of one line of the text data when the input text data is assigned to the maximum number of lines.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention displays text data Image data creation method, and regarding the program. [Background technology]

[0002] When an application draws and displays text data within a text object, the size of the drawing area and the type and size of the font used for drawing may be specified in advance. The text data is drawn by inputting it into the text object from the keyboard or by referencing a database.

[0003] In this drawing process, depending on the combination of the input contents of the text data and the type and size of the font set in the text object, the result of drawing the text may not fit in the drawing area set in the text object. In such cases, a technique is known for fitting the drawing of the text within the drawing area by breaking the text data into a new line or reducing the font used for drawing (Patent Document 1).

[0004] On the other hand, depending on the application's purpose, there may be a maximum number of lines preset for a text object. For example, when printing text on paper with an area with four lines of pre-printed ruled lines, not only must the drawn text fit within the drawing area, but the number of lines in the drawing result must be within four lines. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] JP 2005-193433 A Summary of the Invention [Problem to be solved by the invention]

[0006] Patent document 1 does not allow the maximum number of lines to be specified in the drawing area, and therefore does not mention how to achieve a display that is compatible with the maximum number of lines when drawing and displaying text data within a text object.

[0007] The object of the present invention is to solve the above-mentioned problems in the conventional art. In number Achieving a compliant display Image data creation method, and programs. [Means for solving the problem]

[0008] In order to solve the above-mentioned problems, the present invention provides an image data creation method that is executed in an information processing device that creates image data including a character string, the image data being recorded on a recording medium on which a region to be printed of a predetermined number of lines has been printed in advance, the information processing device including: The number of lines does not exceed the predetermined number of lines. a display step in which the information processing device displays the character string input in the input step; and a setting step in which the information processing device sets the number of lines of the character string to be displayed in the display step to be equal to the maximum number of lines. and the printing of the character string based on the image data does not exceed the area to be printed. and a font reducing step of reducing the font of the character string so that the font size does not exceed . Effect of the Invention

[0009] According to the present invention, it is possible to realize a display suitable for a text object having a defined maximum number of lines. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 is a diagram illustrating a schematic configuration of a printing system. [Diagram 2] FIG. 13 is a diagram showing a text object. [Diagram 3]11 is a flowchart showing the process from inputting text to drawing. [Figure 4] 13 is a flowchart showing the automatic line feed insertion process in step S301. [Diagram 5] 13 is a flowchart showing the text division process in S303. [Figure 6] 13 is a flowchart showing the font size update process in S304. [Figure 7] 13 is a flowchart showing the text division process in S303. [Figure 8] FIG. 11 is a diagram for explaining a process from inputting text to drawing. [Figure 9] FIG. 11 is a diagram for explaining a process from inputting text to drawing. [Figure 10] FIG. 13 is a diagram for explaining an effect. [Figure 11] FIG. 13 is a diagram for explaining a process from inputting English text to drawing it. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the invention according to the claims, and not all combinations of features described in the embodiments are essential to the invention. Two or more features among the multiple features described in the embodiments may be arbitrarily combined. In addition, the same reference numbers are used for the same or similar configurations, and duplicated descriptions are omitted.

[0012] [First embodiment] 1 is a diagram showing a schematic configuration of a printing system including an information processing apparatus according to the present embodiment. The printing system includes an information processing apparatus 101 and a printer 107, which are connected to each other so as to be able to communicate with each other via a wired network, a wireless network, or a network including both.

[0013] The information processing device 101 transmits print data to the printer 107. The CPU 102 controls the information processing device 101 in an overall manner, and controls the creation and editing of print data to be transmitted to the printer 107 via a communication interface (IF) unit 105 based on a control program stored in the ROM 104, for example. The RAM 103 is a memory that mainly provides a work area for the CPU 102. The operation unit 106 includes a display unit such as a monitor for displaying or inputting various information, and a keyboard and mouse capable of accepting user operations. The printer 107 is a printing device that records on a recording medium by a recording method such as an inkjet recording method or an electrophotographic method, and, for example, receives print data transmitted from the communication IF unit 105 and records an image on a recording medium based on the received print data.

[0014] The application program of this embodiment operates as one of the control programs stored in, for example, ROM 104, creates and edits print data, transmits it to printer 107 via communication IF unit 106, and causes printing to be performed.

[0015] In this embodiment, the information processing device 101 draws text in a text object in which the number of lines, font, font size, and drawing area width are preset. When the information processing device 101 accepts input of text, it first automatically inserts line breaks in the text according to the drawing area width, and attempts to draw the text in a specified font size within the drawing area width. If the number of lines of text exceeds the set number of lines by automatically inserting line breaks, the information processing device 101 once deletes all line breaks and divides the text into the same number of lines as the set number according to the number of characters in the character string included in the text. For example, when drawing 30 characters of text in a drawing area of ​​3 lines with a drawing area width of 9 characters in a specified font size, the entire text is divided into three equal parts, each of which is divided into 10 characters. That is, each divided part corresponds to one line of the set number of lines. Then, the information processing device 101 combines the divided text again with a line break code, compares the drawing width when the resulting text is drawn with the drawing area width preset in the text object, and determines the font reduction ratio. Then, the information processing apparatus 101 updates the font size based on the determined reduction ratio and draws the text in the text object.

[0016] FIG. 2 is a diagram showing an example of a text object for which the number of lines can be set. A text object 201 is an object on which input text is to be drawn, for example, a text box defined in document data to be printed. A maximum number of lines 202 is the number of lines set in the text object 201. A font type 203 is the type of font set in the text object 201. A font size 204 is the font size set in the text object 201. A drawing area width 205 represents the drawing area width set in the text object 201. FIG. 2 shows, as an example, a text object in which the maximum number of lines is set to 4, the font type is Meiryo, the font size is 36 points, and the drawing area width is 16.5 cm.

[0017] In this embodiment, text is drawn in a text object 201 using a font type 203 and a font size 204. If the drawing width of the text to be drawn exceeds a drawing area width 205, a line feed code is inserted into the text to prevent the text from being drawn beyond the drawing area width. If the number of lines obtained as a result of the line feed exceeds the maximum number of lines 202, the font size is changed to a value smaller than the font size 204 and the line feed position is changed to prevent the text from being drawn beyond the maximum number of lines 202.

[0018] Fig. 3 is a flowchart showing the process from when text is input to when the text is drawn. The process in Fig. 3 is realized, for example, by CPU 102 reading a program stored in ROM 104 into RAM 103 and executing it. The process in Fig. 3 is started, for example, when text is input into text object 201 on an editing screen for document data to be printed, which is displayed on the display unit of operation unit 106.

[0019] In S301, when the CPU 102 accepts text input, it performs automatic line feed insertion processing, which will be described later. Here, line feeds are inserted based on the drawing area width of the text object. Note that up to S304, no drawing is performed to be displayed on the display unit, but drawing is performed within a virtual area on the RAM 103, and in S305, only the final result is displayed on the display unit so that the user can view it.

[0020] In S302, CPU 102 determines whether the number of lines Y of the text resulting from line breaks is greater than a preset maximum number of lines X. If it is determined that the number of lines Y of the text is greater than the maximum number of lines X, the process proceeds to S303. On the other hand, if it is determined that the number of lines Y of the text is equal to or less than the maximum number of lines X, the process proceeds to S305.

[0021] Fig. 8 is a diagram for explaining the process from when text is input to when the text is drawn. Fig. 8(a) shows a virtual area 801 in the case where it is determined in S302 that the number of lines Y of the text is greater than the maximum number of lines X. As shown in Fig. 8(a), as a result of inserting a line break in S301 using a preset drawing area width 802, the number of lines becomes 4, which is greater than the maximum number of lines 3, and protrudes from the area of ​​the text object. Note that in Fig. 8(a), the font size used for drawing is 36 points, and the preset drawing area width is shown as 12 cm.

[0022] In S303, the CPU 102 performs a text division process, which will be described later. Here, line feed codes are temporarily deleted, and the entire text is divided into the maximum number of lines X so that the text fits within the maximum number of lines X.

[0023] In S304, the CPU 102 performs a font size update process, which will be described later. Here, the font size of the divided text is changed to fit the width of the drawing area for one line.

[0024] In S305, CPU 102 draws text on the display unit using the font size updated in S304. If it is determined in S302 that the number of lines Y of the text is equal to or smaller than the maximum number of lines X, then in S305, the text is drawn using a preset font size. After S305, the process in FIG. 3 ends.

[0025] 4 is a flowchart showing the automatic line feed insertion process of S301. In S401, the CPU 102 draws text using a preset font type and font size. At this time, drawing is performed in a virtual area as an internal process so that the user cannot see the progress of the drawing process. However, drawing may be performed so as to be displayed so as to be visible to the user, rather than in a virtual area.

[0026] In S402, CPU 102 compares the drawing width of the drawing result in S401 with the drawing area width set for the text object. If it is determined that the drawing width is larger, the process proceeds to S403. On the other hand, if it is determined that the drawing area width is larger, the process in FIG. 4 ends. In S403, CPU 102 uses the drawing result in S403 and the drawing area width previously set for the text object to identify characters that overlap the boundary line of the drawing area at the time of drawing.

[0027] In S404, CPU 102 inserts a line feed code immediately before the character specified in S403. Then, the process returns to S401, and CPU 102 draws text in the virtual area for the subsequent lines. The processes of S401 to S404 are repeated until it is determined in S402 that the drawing area width is larger than the drawing width, thereby automatically inserting a line feed into the input text.

[0028] 5 is a flowchart showing the text division process of S303. In S501, the CPU 102 deletes all the line feed codes inserted in S301. In S502, the CPU 102 counts the number of characters in the input text.

[0029] In S503, CPU 102 divides the number of characters counted in S502 by a preset maximum number of lines X. CPU 102 stores the quotient of the division result in a storage area such as RAM 103 as the number of divided characters to be used in a subsequent process. In S504, CPU 102 defines a loop counter N to be used in a loop for text division processing in a storage area such as RAM 103. Here, the initial value of loop counter N is set to 1.

[0030] In S505, the CPU 102 determines whether the loop counter N is equal to the maximum number of rows X. If it is determined that the loop counter N is equal to the maximum number of rows X, the loop process ends and the process proceeds to S509. On the other hand, if it is determined that the loop counter N is not equal to the maximum number of rows X, that is, is smaller than the maximum number of rows X, the process proceeds to S506.

[0031] In S506, CPU 102 stores the text, starting from the beginning of the text, by the number of divided characters calculated in S503 as the Nth text in a storage area such as RAM 103. In S507, CPU 102 excludes the text stored in S506 from the original text in order to divide the remaining text in the next loop processing. In S508, CPU 102 increments loop counter N by 1. Thereafter, the processing is repeated from S505.

[0032] When the loop process of S505 to S508 ends, in S509, CPU 102 stores the text remaining as a result of S507 in a storage area such as RAM 103 as the text of the final line. In S510, CPU 102 combines the text for each line divided in S505 to S509 with a line feed code. Then, the process of FIG. 5 ends.

[0033] 6 is a flowchart showing the font size update process of S304. In S601, the CPU 102 draws text in a virtual area using a preset font type and font size. At this time, the text to be drawn is the text that has been divided in S303, i.e., the process of FIG. 5.

[0034] Fig. 8(b) shows a virtual area 803 showing an example of the rendering result of S601. Fig. 8(b) shows an example in which the number of characters of the input text is 29, and therefore, in order to render the text with the maximum number of lines of 3, the text is divided into 10 characters as a result of division performed in S303, i.e., the process of Fig. 5.

[0035] In S602, CPU 102 calculates a value obtained by dividing the preset drawing area width by the drawing width resulting from drawing in S601. Before reaching this step, the number of characters (=drawing width) of text to be drawn in one line in the text division process in S303 has increased compared to before division, so the calculation result in S602 is a value smaller than 1.0. CPU 102 stores the calculation result in a storage area such as RAM 103 as a reduction ratio to be used in a subsequent step. In FIG. 8(b), the reduction ratio is calculated as 12 / 12.7=0.945, which is the value obtained by dividing the preset drawing area width of 12 cm by the drawing width of 12.7 cm (36 points x 10 characters) resulting from drawing in S601.

[0036] In S603, the CPU 102 updates the font size by multiplying the preset font size by the reduction rate calculated in S602. Since the calculation result in S602 is smaller than 1.0, the font size becomes smaller than the preset font size. FIG. 8(c) shows a virtual area 805 showing an example of the drawing result in S603. As shown in FIG. 8(c), the font size used for drawing is 34 points, which is the preset font size of 36 points multiplied by the reduction rate of 0.945. As a result, the text can be drawn using as large a font size as possible while fitting within the drawing area and with the number of lines not exceeding the preset maximum number of lines. After S603, the process in FIG. 6 ends.

[0037] FIG. 10 is a diagram for explaining the effect of this embodiment. The text objects 1001, 1002, and 1003 in FIG. 10 each have a drawing area for four lines of text. That is, the number of lines uniquely determined for each of the text objects 1001, 1002, and 1003 is four lines. FIG. 10(a) shows a text object 1001 that is drawn according to the maximum number of lines 1004, which is an item that the user can set on the user interface screen displayed on the display unit, being set to "4". As shown in FIG. 10(a), the text with line breaks is three lines, which does not meet the maximum number of lines 1004 of "4", so the font size is drawn at the specified 36 points without being reduced. In FIG. 10(a), the maximum number of lines set by the user is equal to the number of lines in the drawing area of ​​the text object 1001. Also, if the user does not particularly set the maximum number of lines, the number of lines in the drawing area of ​​the text object 1001 is equal to the maximum number of lines.

[0038] FIG. 10(b) shows a text object 1002 that is drawn according to "2" of the maximum number of lines 1005, which is an item that the user can set on the user interface screen displayed on the display unit. As shown in FIG. 10(b), the text is drawn after being reduced to a font size smaller than that of the text object 1001 so as to fit within "2" of the maximum number of lines 1005. In this way, by allowing the user to change the maximum number of lines, the user can set the number of lines into which text can be input within a range that does not exceed the number of lines in the drawing area, for example, within a range that does not exceed four lines in the example of FIG. 10. Also, FIG. 10(b) shows an example of setting the maximum number of lines when drawing text from the top left of the drawing area, but the range in which text can be input may be, for example, the third to fourth lines based on the bottom right of the drawing area. Also, it may be possible to input two lines at the vertical center of the drawing area. The font size field in FIG. 10(b) displays the set font size, but it may also be configured to display the reduced font size that is actually drawn.

[0039] FIG. 10(c) shows a text object 1003 drawn according to the maximum number of lines 1006 being "1". As shown in FIG. 10(c), the text is drawn after being reduced to a font size smaller than that of the text object 1002 so as to fit within the maximum number of lines 1006 being "1". FIG. 10(c) shows an example of setting the maximum number of lines when drawing text from the top left of the drawing area, but it is also possible to set the range in which only the fourth line can be input, for example, based on the bottom right of the drawing area. It is also possible to set it so that one line can be input at the vertical center of the drawing area. The font size field in FIG. 10(c) also displays the set font size, but it is also possible to display the reduced font size that is actually drawn.

[0040] As described above, according to this embodiment, when drawing text in a text object with a set number of lines, it is possible to draw using as large a font size as possible that fits within the drawing area and has a number of lines that is less than or equal to the set number of lines.

[0041] [Second embodiment] In the first embodiment, text in which each character has the same width has been described. In this embodiment, automatic line break insertion, text division, and font size update are performed in the same manner as in the first embodiment, but in the text division process, division is performed according to the drawing width of the text, not the number of characters in the text. With such a configuration, for example, even when a proportional font in which each character has a different width is used, it is possible to obtain the same effect as in the first embodiment. Below, the differences between the first embodiment and the second embodiment will be described.

[0042] Fig. 7 is a flowchart showing the text segmentation process of S303 in Fig. 3 in this embodiment. In S701, the CPU 102 deletes all line feed codes inserted in S301. In S702, the CPU 102 draws text in a virtual area using a preset font type and font size.

[0043] In S703, CPU 102 calculates a value obtained by dividing the drawing width of the result of drawing in S702 by a preset maximum number of lines X. CPU 102 stores the calculation result in a storage area such as RAM 103 as a division width number to be used in a subsequent process. In S704, CPU 102 defines a loop counter N to be used in a loop for dividing the text in a storage area such as RAM 103. Here, the initial value of loop counter N is set to 1.

[0044] In S705, the CPU 102 determines whether the loop counter N is equal to the maximum number of rows X. If it is determined that the loop counter N is equal to the maximum number of rows X, the loop process ends and the process proceeds to S710. On the other hand, if it is determined that the loop counter N is not equal to the maximum number of rows X, that is, is smaller than the maximum number of rows X, the process proceeds to S706.

[0045] In S706, CPU 102 identifies a character that is located at a position equivalent to the division width calculated in S703 from the beginning of the text. In S707, CPU 102 stores the text from the beginning of the text to the character identified in S706 as the Nth text in a storage area such as RAM 103. In S708, CPU 102 excludes the text stored in S707 from the original text in order to divide the remaining text in the next loop processing. In S709, CPU 102 increments loop counter N by 1. Thereafter, the processing is repeated from S705.

[0046] When the loop process of S705 to S709 ends, in S710, CPU 102 stores the text remaining as a result of S708 as the text of the last line in a storage area such as RAM 103. In S711, CPU 102 combines the text for each line divided in S705 to S710 with a line feed code. Then, the process of FIG. 7 ends.

[0047] FIG. 9 is a diagram for explaining the processing from when text is input to when the text is drawn in this embodiment.

[0048] Fig. 9(a) shows a virtual area 901 when it is determined in S302 that the number of lines Y of the text is greater than the maximum number of lines X. As shown in Fig. 9(a) , as a result of inserting line breaks in S301 using the preset value of the drawing area width 902, the number of lines becomes 4, which is greater than the maximum number of lines, 3, and extends beyond the area of ​​the text object. Note that in Fig. 9(a) , the font size used for drawing is 36 points, and the preset drawing area width is shown as 10 cm.

[0049] Fig. 9(b) shows a virtual area 903 showing an example of the drawing result of S702. The division width 905 is the drawing width 904 divided by the preset maximum number of lines "3", that is, 32.4 cm÷3=10.8 cm. In Fig. 9(b), the first line of text is from the first "a" to the "shi" 10.8 cm away.

[0050] 9C shows a virtual area 906 that shows an example of the rendering result of S706 and S707. That is, the text on the second line is from the first "su" of the text excluding the first line to the "nu" at a position 10.8 cm away.

[0051] 9D shows a virtual area 907 that shows an example of the rendering result of S601. The rendering width 908 is 12 cm, which is the largest rendering width among the three lines of text. The value obtained by dividing the preset rendering area width 902 by the rendering width 908 is the font reduction ratio, so the reduction ratio is 10÷12=0.833. Note that the rendering width 908 should be equal to or larger than the largest rendering width among the three lines of text, and as a result, all lines will fit within the rendering area width 902. The reduction ratio may also be calculated for each line.

[0052] 9(e) shows a text object 909 showing an example of the final drawing result. The font size used for drawing is 36pt x 0.833 = 30pt, which is the preset font size multiplied by the reduction ratio. As a result, it is possible to draw using as large a font size as possible while still fitting within the drawing area and with the number of lines not exceeding the preset maximum number of lines.

[0053] [Third embodiment] The third embodiment will be described below with respect to the differences from the first and second embodiments. In the first and second embodiments, the case of a language such as Japanese in which the meaning can be understood even if a line break is inserted for each character is described. In this embodiment, the case of a language such as English in which the meaning is difficult to understand if a line break is inserted in the middle of a word is described.

[0054] Fig. 11 is a diagram for explaining the process from input of English text to drawing of the text. Fig. 11(a) shows a virtual area when it is determined in S302 of Fig. 3 that the number of lines Y of the text is greater than the maximum number of lines X. As shown in Fig. 11(a), as a result of inserting a line break in S301 using a preset drawing area width 1101, the number of lines becomes 5, which is greater than the maximum number of lines 4, and extends beyond the area of ​​the text object.

[0055] In the case of a language such as English that separates words with spaces, it is not desirable to automatically insert a line break in the middle of a word. Therefore, as shown in FIG. 11(b), the virtual area in FIG. 11(a) is expanded in the character string direction so that the text fits within the maximum number of lines and line break positions are inserted on a word-by-word basis. For example, in FIG. 11(a), the end of the line is separated by "card", whereas in FIG. 11(b), as a result of inserting line break positions on a word-by-word basis, the end of the line is separated by "printers". Then, the drawing width 1102 and the automatic line break insertion position when the text fits within the maximum number of lines 4 are stored in a storage area such as the RAM 103. Then, the font size update process of S304 is executed using the result of dividing the previously set drawing area width 1101 by the drawing width 1102 stored in the storage area such as the RAM 103 as the font reduction rate. FIG. 11(c) shows the text displayed on the display unit as a result of executing the font size update process. In this way, in the case of English, the line break position is reset for each word, the font size is reduced so that it fits within the maximum number of lines, and the text is drawn and displayed. Note that this embodiment can also be applied to languages ​​such as Japanese, where the meaning can be conveyed even if the line break is made for each character.

[0056] The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.

[0057] The invention is not limited to the above-described embodiment, and various modifications and variations are possible within the scope of the gist of the invention. [Explanation of symbols]

[0058] 101 information processing device: 102 CPU: 103 RAM: 104 ROM: 107 printer

Claims

1. 1. An image data creation method executed in an information processing device that creates image data including a character string, the image data being recorded on a recording medium on which a predetermined number of lines of a print area have been printed in advance, comprising the steps of: a maximum line number setting step of accepting a number of lines not exceeding the predetermined number of lines as a setting of the maximum line number of the character string by a user, by the information processing device; an input step of the information processing device accepting an input of the character string by a user; a display step in which the information processing device displays the character string input in the input step; a font reduction step of reducing a font of the character string by the information processing device so that the number of lines of the character string displayed in the display step does not exceed the maximum number of lines and so that printing of the character string based on the image data does not exceed the area to be printed; 1. An image data creating method comprising:

2. 2. The image data creating method according to claim 1, wherein an initial value of the maximum number of rows is set in advance.

3. A program for causing a computer to execute each step of the image data creating method according to claim 1.

Citation Information

Patent Citations

  • Document processor, and computer-readable recording medium where document processing program is recorded

    JP1999096157A

  • JP2005‐193433A

  • Print data editing device, print data editing program, and recording medium with the program recorded thereon

    JP2006309706A

  • Business form design system and line pitch automatic adjustment device

    JP2009070214A

  • Automated markup language layout

    US20100131839A1