A page layout method, device, equipment and storage medium

By adjusting the display object of the last line of text paragraphs in the page layout, the problem of unsightly page layout was solved, and the page display effect and user experience were improved.

CN115204137BActive Publication Date: 2026-07-14DOUYIN VISION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DOUYIN VISION CO LTD
Filing Date
2022-07-12
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

The large proportion of text in the title and body of the page results in an unattractive layout, negatively impacting the user's reading experience.

Method used

By receiving the object storage unit of the page to be formatted, the target object storage unit is determined to be the last line of the text paragraph, and it is determined whether the number of displayed objects exceeds the threshold. If it does not exceed the threshold, the displayed objects are stored in the object storage unit of the adjacent previous text line or the object storage is adjusted according to the display order.

Benefits of technology

This improved the page's display and enhanced the user's viewing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115204137B_ABST
    Figure CN115204137B_ABST
Patent Text Reader

Abstract

The present disclosure provides a page layout method, device and equipment and storage medium, the method comprises the following steps: first receiving at least one object storage unit corresponding to a page to be laid out and determining a target object storage unit, then determining whether the number of display objects stored in the target object storage unit is greater than a preset number threshold, if it is determined that the number of display objects is not greater than the preset number threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line, or, based on the display order, the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit. It can be seen that the present embodiment can optimize the page layout in the case that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, improve the effect of page display, and thus improve the viewing experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, and more particularly to a page layout method, apparatus, device, and storage medium. Background Technology

[0002] Page layout refers to the process of adjusting the position and size of visual information elements such as text, images, graphics, lines, and colors on a page within a limited space, according to the needs of the content, so as to make the page layout more organized.

[0003] In page layout, titles, body text, and other text constitute a large portion of the page and have a significant impact on the overall layout. Insufficient aesthetic appeal in the layout of text on the page can negatively affect the user's reading experience. Therefore, optimizing page layout to improve the page display effect is a technical problem that urgently needs to be solved. Summary of the Invention

[0004] To address the aforementioned technical problems, this disclosure provides a page layout method.

[0005] Firstly, this disclosure provides a page layout method, the method comprising:

[0006] Receive at least one object storage unit corresponding to the page to be formatted; wherein, the object storage unit has a corresponding relationship with the text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order;

[0007] A target object storage unit is determined from the at least one object storage unit; wherein the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted;

[0008] Determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold;

[0009] If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line; or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit; wherein, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be formatted.

[0010] In one optional implementation, the method further includes:

[0011] Determine whether the first display object in the first object storage unit of the at least one object storage unit belongs to the preset display object;

[0012] If it is determined that the first display object in the first object storage unit belongs to the preset display object, then the first display object in the first object storage unit is stored in the object storage unit of the adjacent previous text line; or, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored in the first object storage unit.

[0013] In one optional implementation, the preset display object includes preset symbols, which include at least preset punctuation marks and / or preset special symbols.

[0014] In an optional implementation, after determining whether the first display object in the first object storage unit of the at least one object storage unit belongs to the preset display object, the method further includes:

[0015] If it is determined that the first display object in the first object storage unit belongs to the preset display object, then it is determined whether the text line corresponding to the first object storage unit is the first line of the text paragraph;

[0016] If it is determined that the text line corresponding to the first object storage unit is the first line of the text paragraph, then the first display object is deleted from the first object storage unit; otherwise, the step of storing the first display object in the first object storage unit into the object storage unit of the adjacent previous text line is executed; or, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored into the first object storage unit.

[0017] In one optional implementation, if it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line; or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit, including:

[0018] After determining that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, if it is determined that the number of display objects is equal to a preset first value, then it is determined whether the display objects stored in the target object storage unit contain punctuation marks.

[0019] If it is determined that the display object contains punctuation marks, then the display object in the target object storage unit is stored in the object storage unit corresponding to the adjacent previous text line; or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

[0020] In one optional implementation, if it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line; or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit, including:

[0021] If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then the distance between the last display object in the object storage unit corresponding to the adjacent previous text line and the preset display boundary of the page to be formatted is obtained;

[0022] If the distance is determined to be not less than a preset distance threshold, the display object in the target object storage unit is stored in the object storage unit corresponding to the adjacent previous text line; otherwise, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

[0023] In an optional implementation, before storing a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line into the target object storage unit based on the display order, the method further includes:

[0024] Determine whether the first display object in the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line belongs to the preset display object;

[0025] If it is determined that the first display object among the preset first number of display objects does not belong to the preset display objects, then the step of storing the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit based on the display order is executed.

[0026] Secondly, this disclosure provides a page layout apparatus, the apparatus comprising:

[0027] A receiving module is used to receive at least one object storage unit corresponding to a page to be formatted; wherein, the object storage unit has a corresponding relationship with a text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order;

[0028] The first determining module is used to determine a target object storage unit from the at least one object storage unit; wherein the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted;

[0029] The second determining module is used to determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold.

[0030] The first storage module is used to store the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line when it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold; or, based on the display order, to store a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit; wherein, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be formatted.

[0031] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the above-described method.

[0032] Fourthly, this disclosure provides a page layout device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0033] Fifthly, this disclosure provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the method described above.

[0034] The technical solution provided in this disclosure has at least the following advantages compared with the prior art:

[0035] This disclosure provides a page layout method. First, at least one object storage unit corresponding to the page to be layout is received. Each object storage unit corresponds to a text line on the page. The object storage unit stores display objects in the text line according to the display order. A target object storage unit is determined from the at least one object storage unit. The target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be layout. Then, it is determined whether the number of display objects stored in the target object storage unit is greater than a preset threshold. If the number of display objects stored in the target object storage unit is not greater than the preset threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line. Alternatively, based on the display order, a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit. Both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used for drawing the page to be layout.

[0036] As can be seen, the embodiments of this disclosure can improve the page display effect by optimizing the page layout when the number of display objects stored in the target object storage unit is no greater than a preset number threshold, thereby improving the user's viewing experience. Attached Figure Description

[0037] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0038] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating a page layout method provided in this embodiment of the disclosure;

[0040] Figure 2 This is a schematic diagram of a page to be formatted, provided as an embodiment of the present disclosure;

[0041] Figure 3 This is a schematic diagram of a typesetting page provided in an embodiment of the present disclosure;

[0042] Figure 4 This is another schematic diagram of a layout page provided in accordance with an embodiment of the present disclosure;

[0043] Figure 5 This is another schematic diagram of a page to be formatted, provided as an embodiment of the present disclosure;

[0044] Figure 6 This is yet another schematic diagram of a typesetting page provided in an embodiment of the present disclosure;

[0045] Figure 7 This is another schematic diagram of a page to be typed, provided as an embodiment of the present disclosure;

[0046] Figure 8 This is yet another schematic diagram of a typesetting page provided in an embodiment of the present disclosure;

[0047] Figure 9 This is yet another schematic diagram of a typesetting page provided in an embodiment of the present disclosure;

[0048] Figure 10 This is a schematic diagram of the structure of a page layout device provided in an embodiment of the present disclosure;

[0049] Figure 11 This is a schematic diagram of the structure of a page layout device provided in an embodiment of this disclosure. Detailed Implementation

[0050] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0051] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0052] Page layout refers to the process of adjusting the position and size of visual information elements such as text, images, graphics, lines, and colors on a page within a limited space, according to the needs of the content, so as to make the page layout more organized.

[0053] In page layout, titles, body text, and other text constitute a large portion of the page and have a significant impact on the overall layout. Insufficient aesthetic appeal in the layout of text on the page can negatively affect the user's reading experience. Therefore, optimizing page layout to improve the page display effect is a technical problem that urgently needs to be solved.

[0054] To address this, this disclosure provides a page layout method. First, at least one object storage unit corresponding to the page to be layout is received. Each object storage unit corresponds to a text line on the page to be layout. The object storage unit stores display objects in the text line according to the display order. A target object storage unit is determined from the at least one object storage unit. The target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be layout. Then, it is determined whether the number of display objects stored in the target object storage unit is greater than a preset threshold. If the number of display objects stored in the target object storage unit is not greater than the preset threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line. Alternatively, based on the display order, a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit. Both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used for drawing the page to be layout.

[0055] As can be seen, the embodiments of this disclosure can improve the page display effect by optimizing the page layout when the number of display objects stored in the target object storage unit is no greater than a preset number threshold, thereby improving the user's viewing experience.

[0056] Based on this, the present disclosure provides a page layout method, referring to... Figure 1 The flowchart below illustrates a page layout method provided in this embodiment of the disclosure. The method includes:

[0057] S101: Receive at least one object storage unit corresponding to the page to be formatted.

[0058] The object storage unit corresponds to the text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order.

[0059] Specifically, the page to be formatted refers to the page that needs to be formatted. It can be a formatted page in the card flow or other types of formatted pages. This disclosure does not impose any restrictions here.

[0060] In this embodiment of the disclosure, the object storage unit refers to the storage unit used to store any text line in the page to be typed, such as an array, queue or other storage structure, and the display objects in the text line are stored in the order of display. The display objects can be text, symbols (punctuation marks, special symbols, etc.), numbers, English words, etc. Specifically, English words as a whole are treated as a display object, such as "what" is a display object, and numbers as a whole are treated as a display object, such as "10000" is a display object.

[0061] For example, assuming the object storage unit is an array, the storage method is shown in Table 1, taking the 10th line of text as an example:

[0062]

[0063] Table 1

[0064] As shown in Table 1, a display object storage table is provided in an embodiment of this disclosure. The 10th text line of the main text has a corresponding relationship with array 10, and the display objects (display object 10-1, display object 10-2, display object 10-3, display object 10-4) of the 10th text line of the main text are stored in array 10, and each display object is stored in array 10 according to the display order.

[0065] It should be noted that the page layout method provided in this embodiment can be applied to a layout engine, that is, the aesthetics of the page layout can be improved by adding a layout engine, and existing layout functions can also be optimized to improve the aesthetics of the page layout.

[0066] S102: Determine the target object storage unit from at least one object storage unit.

[0067] The target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted.

[0068] Specifically, each object storage unit in the page to be typed can be traversed sequentially, and the target object storage unit can be determined based on a preset algorithm.

[0069] S103: Determine whether the number of display objects stored in the target object storage unit is greater than a preset quantity threshold.

[0070] The preset quantity threshold refers to the preset value of the number of display objects stored in the target object storage unit.

[0071] In this embodiment of the disclosure, after receiving at least one object storage unit corresponding to the page to be formatted, the object storage unit corresponding to the last line of the text paragraph on the page to be formatted is determined as the target object storage unit. At the same time, in order to reduce the impact of the display objects displayed at the last line of the text paragraph on the aesthetics of the text display on the page to be formatted, the number of display objects stored in the target object storage unit can be judged to determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold, thereby optimizing the text display effect.

[0072] S104: If it is determined that the number of display objects stored in the target object storage unit is not greater than a preset number threshold, then the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line, or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

[0073] The target object storage unit and the object storage unit corresponding to the adjacent previous text line are both used to draw the page to be typed.

[0074] The preset first quantity can be a pre-set quantity threshold, and this disclosure does not impose any limitations on it.

[0075] In this embodiment of the disclosure, if it is determined that the object storage unit on the page to be typed is the target object storage unit (i.e., the object storage unit corresponding to the last line of the text paragraph on the page to be typed), it is necessary to determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold. If it is determined that the number of display objects stored in the target object storage unit is greater than the preset number threshold, it indicates that the text line corresponding to the target object storage unit has no impact on the display aesthetics of the text on the page to be typed, i.e., no processing is required. If it is determined that the number of display objects stored in the target object storage unit is not greater than (i.e., less than or equal to) the preset number threshold, it indicates that the text line corresponding to the target object storage unit affects the display aesthetics of the text on the page to be typed, and processing is required. Specifically, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line, or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

[0076] In one optional implementation, after determining that the number of display objects stored in the target object storage unit is not greater than a preset number threshold, it can also be determined whether the number of display objects is equal to a preset first value. If it is determined that the number of display objects is equal to the preset first value, it is then determined whether the display objects stored in the target object storage unit contain punctuation marks. If it is determined that the display objects contain punctuation marks, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line. Alternatively, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

[0077] In an embodiment of the present disclosure, if a preset first value is equal to 2, after determining that the number of display objects stored in the target object storage unit is not greater than a preset number threshold, if it is determined that the number of display objects is equal to 2, it is further necessary to determine whether the display objects stored in the target object storage unit include punctuation marks. If it is determined that the display objects include punctuation marks, it indicates that there is a last-line single character in the text line corresponding to the target object storage unit and processing is required. Specifically, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent upper text line, or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent upper text line are stored in the target object storage unit.

[0078] In another embodiment of the present disclosure, if a preset first value is equal to 1, after determining that the number of display objects stored in the target object storage unit is not greater than a preset number threshold, if it is determined that the number of display objects is equal to 1, it indicates that the text line corresponding to the target object storage unit is a last-line single character, and there is no need to further determine whether the display objects stored in the target object storage unit include punctuation marks, and it can be directly processed in the above manner of the last-line single character.

[0079] Specifically, based on the distance between the last display object in the object storage unit corresponding to the adjacent upper text line of the target object storage unit and the preset display boundary of the page to be typeset (such as Figure 2 the distance between the character "shadow" shown and the dotted line 201), it is determined whether to store the display objects in the target object storage unit in the object storage unit corresponding to the adjacent upper text line or, based on the display order, store a preset first number of display objects in the object storage unit corresponding to the adjacent upper text line in the target object storage unit.

[0080] In an optional implementation manner, if it is determined that the number of display objects stored in the target object storage unit is not greater than a preset number threshold, the distance between the last display object in the object storage unit corresponding to the adjacent upper text line and the preset display boundary of the page to be typeset is obtained. If it is determined that the distance is not less than a preset distance threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent upper text line; otherwise, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent upper text line are stored in the target object storage unit.

[0081] Among them, the preset display boundary can be a pre-set boundary, such as can be achieved by setting the right boundary value of the page to be typeset, and the present disclosure does not make any limitation here.

[0082] The preset distance threshold can be set as needed, and the present disclosure does not make any limitation here.

[0083] In an embodiment of the present disclosure, if the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the to-be-typeset page is not less than the preset distance threshold, it indicates that the adjacent previous text line of the target object storage unit can hold the display objects in the target object storage unit. Therefore, the display objects in the target object storage unit can be stored in the object storage unit corresponding to the adjacent previous text line. If the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the to-be-typeset page is less than the preset distance threshold, it indicates that the adjacent previous text line of the target object storage unit cannot hold the display objects in the target object storage unit, and a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line need to be stored in the target object storage unit based on the display order.

[0084] For a clearer understanding of the present disclosure, refer to Figure 2 , which is a schematic diagram of a to-be-typeset page provided by an embodiment of the present disclosure. Assume that the text line corresponding to the target object storage unit is Figure 2 the second line shown, and the number of its corresponding display objects does not exceed the preset number threshold. As Figure 2 shown, the display objects stored in the target object storage unit affect the display aesthetics of the text on the to-be-typeset page. For the display aesthetics of the text on the to-be-typeset page, "响?" can be stored in the object storage unit corresponding to the adjacent previous text line, that is, Figure 3 the effect shown, or, based on the display order, a preset first number of display objects ("影" character) in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit, that is, Figure 4 the effect shown.

[0085] In addition, to avoid when storing a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line in the target object storage unit based on the display order, if the first display object in the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line belongs to the preset display object, it is also necessary to determine whether the first display object in the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line belongs to the preset display object. If it is determined that the first display object in the preset first number of display objects does not belong to the preset display object, then perform the step of storing a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line in the target object storage unit based on the display order.

[0086] Among them, the preset display object refers to a display object set in advance, which can be the first display object of a text line affecting the page layout display effect. For example, the preset display object can be a preset symbol, and the preset symbol can include preset punctuation marks and / or preset special symbols. Specifically, the preset punctuation marks can include ",", ".", and "?", and the preset special symbols can include "¥", "※", etc.

[0087] As Figure 5 shown, assume that the text behavior corresponding to the target object storage unit Figure 5 is the second line shown, and the number of its corresponding display objects does not exceed the preset quantity threshold. It can be seen from Figure 5 that the display objects stored in the target object storage unit affect the display aesthetics of the text on the page to be typeset. To improve the display aesthetics of the text on the page to be typeset, a preset first quantity of display objects ("Ying") in the object storage unit corresponding to the adjacent previous text line can be stored in the target object storage unit. However, since the first display object ("") in the preset first quantity of display objects in the object storage unit corresponding to the adjacent previous text line is a symbol and belongs to the preset display object, it is necessary to judge the previous display object of this first display object until it does not belong to the preset display object. As Figure 5 shown, the previous display object of this first display object is the character "Guo", which does not belong to the preset display object. Therefore, this preset first quantity of display objects ("Ying") and its corresponding previous display object ("Guo") are all stored in the target object storage unit, that is Figure 6 the effect shown.

[0088] In the page layout method provided by the embodiments of the present disclosure, first, at least one object storage unit corresponding to the page to be typeset is received. Among them, the object storage unit has a corresponding relationship with the text lines on the page to be typeset, and the object storage unit is used to store the display objects in the text lines in the display order. The target object storage unit is determined from at least one object storage unit. Among them, the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be typeset. Then, it is determined whether the number of display objects stored in the target object storage unit is greater than the preset quantity threshold. If it is determined that the number of display objects stored in the target object storage unit does not exceed the preset quantity threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line, or, based on the display order, a preset first quantity of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit; among them, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be typeset.

[0089] As can be seen, the embodiments of this disclosure can improve the page display effect by optimizing the page layout when the number of display objects stored in the target object storage unit is no greater than a preset number threshold, thereby improving the user's viewing experience.

[0090] Based on the above implementation, in order to avoid the first display object in the object storage unit of the page to be typed being a preset display object, it is also necessary to detect the first display object in any object storage unit of the page to be typed and determine whether it belongs to the preset display object. Specifically, firstly, it is determined whether the first display object in the first object storage unit of at least one object storage unit belongs to the preset display object. If it is determined that the first display object in the first object storage unit belongs to the preset display object, then the first display object in the first object storage unit is stored in the object storage unit of the adjacent previous text line. Alternatively, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored in the first object storage unit.

[0091] The first object storage unit is any object storage unit in the page to be formatted.

[0092] Preset display objects refer to pre-set display objects, which can be the first display object of a text line that affects the page layout and display effect. For example, preset display objects can be preset symbols, which can include preset punctuation marks and / or preset special symbols. Specifically, preset punctuation marks can include “,”, “.” and “?”, and preset special symbols can include “¥”, “※”, etc.

[0093] The preset second quantity can be set according to needs, and this disclosure does not impose any restrictions here.

[0094] Specifically, the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the first object storage unit and the preset display boundary of the page to be formatted can be processed based on the relationship between the distance and the preset distance threshold. If it is determined that the distance is not less than the preset distance threshold, the first display object in the first object storage unit is stored in the object storage unit of the adjacent previous text line. Otherwise, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored in the first object storage unit.

[0095] For ease of understanding of the embodiments of this disclosure, reference is made to... Figure 7 This is another schematic diagram of a page to be typed, provided by an embodiment of this disclosure. It is assumed that the text behavior corresponding to the first object storage unit... Figure 7 The second row shown is as follows: Figure 7As shown, the first display object in the first object storage unit is a question mark, which is a preset display object and affects the aesthetics of the text display on the page to be formatted. To improve the aesthetics of the text display on the page to be formatted, this question mark can be stored in the object storage unit of the adjacent previous text line, i.e. Figure 8 The effect shown, or, based on the display order, storing a preset second number of display objects ("sound" characters) from the object storage unit of the adjacent previous text line into the first object storage unit, that is... Figure 9 The effect shown.

[0096] To facilitate a further understanding of the embodiments of this disclosure, the following will take the text line corresponding to the first object storage unit as the 12th text line of the main text and the adjacent previous text line of the first object storage unit as the example. Specifically, referring to Table 2, there is another display object storage table provided by the embodiments of this disclosure.

[0097]

[0098] Table 2

[0099] As shown in Table 2 above, the display objects (display object 11-1, display object 11-2, display object 11-3, display object 11-4) in the 11th text line of the main text are stored in array 11, and each display object is stored in array 11 according to the display order; the display objects (display object 12-1, display object 12-2, display object 12-3, display object 12-4) in the 12th text line of the main text are stored in array 12, and each display object is also stored in array 12 according to the display order.

[0100] For example, assuming that the first display object (display object 12-1) of the 12th text line belongs to the preset display object, the distance between the last display object (display object 11-4) of the 11th text line and the preset display boundary of the page to be formatted is obtained. If the distance is less than the preset distance threshold, the first display object (display object 12-1) of the 12th text line is stored in the object storage unit of the 11th text line. Specifically, the first display object (display object 12-1) is obtained from the 12th text line and stored at the end of array 11. Specifically, refer to Table 3, which is another display object storage table provided by the embodiments of this disclosure.

[0101]

[0102] Table 3

[0103] As shown in Table 3, the first display object (display object 12-1) in the 12th text line is stored at the end of array 11, and the remaining display objects in array 12 in the 12th text line are re-stored according to the display order.

[0104] If the distance is greater than or equal to a preset distance threshold, then a preset second number of display objects (display objects 11-4) in the object storage unit of the 11th text line are stored in the 12th text line. Specifically, a preset second number of display objects (display objects 11-4) are obtained from array 11 and stored at the first display object position of array 12. Referring to Table 4, this is another display object storage table provided by the embodiments of this disclosure.

[0105]

[0106] Table 4

[0107] As shown in Table 4, the second number of display objects (display objects 11-4) in the 11th text line are stored in the first display object position of array 12. At the same time, the display objects in the original array 12 in the 12th text line are re-stored according to the display order.

[0108] In addition, to avoid the first line of the text behavior paragraph corresponding to the first object storage unit, when it is determined that the first display object in the first object storage unit belongs to the preset display object, it is also necessary to judge the text line corresponding to the first object storage unit to determine whether it is the first line of the text paragraph. Specifically, if it is determined that the first display object in the first object storage unit belongs to the preset display object, then it is determined whether the text line corresponding to the first object storage unit is the first line of the text paragraph. If it is determined that the text behavior corresponding to the first object storage unit is the first line of the text paragraph, then the first display object is deleted from the first object storage unit. Otherwise, the steps of storing the first display object in the first object storage unit into the object storage unit of the adjacent previous text line, or, based on the display order, storing a preset second number of display objects in the object storage unit of the adjacent previous text line into the first object storage unit.

[0109] In this embodiment of the disclosure, if the text behavior corresponding to the first object storage unit is determined to be the first line of the text paragraph, the first display object can be deleted from the first object storage unit to achieve layout optimization of the page to be formatted.

[0110] In another embodiment of this disclosure, if it is determined that the text line corresponding to the first object storage unit is the first line of the text paragraph, no processing may be performed on the text line corresponding to the first object storage unit.

[0111] Based on the above method embodiments, this disclosure also provides a page layout device, with reference to Figure 10 This is a schematic diagram of a page layout device provided in an embodiment of the present disclosure. The device includes:

[0112] The receiving module 1001 is used to receive at least one object storage unit corresponding to the page to be formatted; wherein, the object storage unit has a corresponding relationship with the text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order;

[0113] The first determining module 1002 is used to determine a target object storage unit from the at least one object storage unit; wherein the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted;

[0114] The second determining module 1003 is used to determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold.

[0115] The first storage module 1004 is used to store the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line when it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold; or, based on the display order, to store a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit; wherein, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be formatted.

[0116] In one optional embodiment, the apparatus further includes:

[0117] The third determining module is used to determine whether the first display object in the first object storage unit of the at least one object storage unit belongs to the preset display object;

[0118] The second storage module is used to determine that when the first display object in the first object storage unit belongs to the preset display object, store the first display object in the first object storage unit into the object storage unit of the adjacent previous text line; or, based on the display order, store a preset second number of display objects in the object storage unit of the adjacent previous text line into the first object storage unit.

[0119] In one optional implementation, the preset display object includes preset symbols, which include at least preset punctuation marks and / or preset special symbols.

[0120] In one optional embodiment, the apparatus further includes:

[0121] The fourth determining module is used to determine whether the text line corresponding to the first object storage unit is the first line of a text paragraph when the first display object in the first object storage unit belongs to the preset display object;

[0122] The deletion module is used to delete the first display object from the first object storage unit when it is determined that the first line of the text paragraph corresponding to the first object storage unit is the first text behavior.

[0123] The third storage module is used to store the first display object in the first object storage unit into the object storage unit of the adjacent previous text line when it is determined that the text line corresponding to the first object storage unit is not the first line of the text paragraph; or, based on the display order, to store a preset second number of display objects in the object storage unit of the adjacent previous text line into the first object storage unit.

[0124] In one optional implementation, the first storage module includes:

[0125] The first determining submodule is used to determine whether the display objects stored in the target object storage unit contain punctuation marks if, after determining that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, the number of display objects is equal to a preset first value.

[0126] The first storage submodule is used to, when it is determined that the display object contains punctuation marks, store the display object in the target object storage unit into the object storage unit corresponding to the adjacent previous text line; or, based on the display order, store a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit.

[0127] In one optional implementation, the first storage module includes:

[0128] The acquisition submodule is used to determine that when the number of display objects stored in the target object storage unit is not greater than the preset number threshold, the distance between the last display object in the object storage unit corresponding to the adjacent previous text line and the preset display boundary of the page to be formatted is obtained.

[0129] The second storage submodule is used to store the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line when the distance is not less than a preset distance threshold; otherwise, based on the display order, it stores a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit.

[0130] In one optional embodiment, the apparatus further includes:

[0131] The fifth determining module is used to determine whether the first display object in the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line belongs to the preset display object;

[0132] The fourth storage module is used to perform the step of storing the first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit when it is determined that the first display object in the preset first number of display objects does not belong to the preset display objects.

[0133] In the page layout apparatus provided in this embodiment, at least one object storage unit corresponding to the page to be layout is first received. The object storage unit corresponds to a text line on the page to be layout. The object storage unit is used to store display objects in the text line according to the display order. A target object storage unit is determined from the at least one object storage unit. The target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be layout. Then, it is determined whether the number of display objects stored in the target object storage unit is greater than a preset number threshold. If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line. Alternatively, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit. Both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be layout.

[0134] As can be seen, the embodiments of this disclosure can improve the page display effect by optimizing the page layout when the number of display objects stored in the target object storage unit is no greater than a preset number threshold, thereby improving the user's viewing experience.

[0135] In addition to the methods and apparatus described above, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the page layout method described in this disclosure.

[0136] This disclosure also provides a computer program product, which includes a computer program / instruction that, when executed by a processor, implements the page layout method described in this disclosure.

[0137] In addition, this disclosure also provides a page layout device, see [link to relevant documentation]. Figure 11 As shown, it may include:

[0138] The page layout device includes a processor 1101, a memory 1102, an input device 1103, and an output device 1104. The number of processors 1101 in the page layout device can be one or more. Figure 11 Taking a processor as an example. In some embodiments of this disclosure, the processor 1101, memory 1102, input device 1103, and output device 1104 can be connected via a bus or other means, wherein, Figure 11 Taking the example of a connection between China and Israel via a bus.

[0139] The memory 1102 can be used to store software programs and modules. The processor 1101 executes various functional applications and page layout of the page layout device by running the software programs and modules stored in the memory 1102. The memory 1102 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 1103 can be used to receive input digital or character information, and generate signal inputs related to user settings and function control of the page layout device.

[0140] Specifically in this embodiment, the processor 1101 will load the executable files corresponding to the processes of one or more applications into the memory 1102 according to the following instructions, and the processor 1101 will run the applications stored in the memory 1102 to realize the various functions of the page layout device described above.

[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0142] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A page layout method, characterized in that, The method includes: Receive at least one object storage unit corresponding to the page to be formatted; wherein, the object storage unit has a corresponding relationship with the text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order; A target object storage unit is determined from the at least one object storage unit; wherein the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted; Determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold; If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then based on the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the page to be formatted, the following steps are performed: the display objects in the target object storage unit are stored in the object storage unit corresponding to the adjacent previous text line; or, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit; wherein, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be formatted.

2. The method according to claim 1, characterized in that, The method further includes: Determine whether the first display object in the first object storage unit of the at least one object storage unit belongs to the preset display object; If it is determined that the first display object in the first object storage unit belongs to the preset display object, then the first display object in the first object storage unit is stored in the object storage unit of the adjacent previous text line; or, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored in the first object storage unit.

3. The method according to claim 2, characterized in that, The preset display objects include preset symbols, which include at least preset punctuation marks and / or preset special symbols.

4. The method according to claim 2, characterized in that, After determining whether the first display object in the first object storage unit of the at least one object storage unit belongs to the preset display object, the method further includes: If it is determined that the first display object in the first object storage unit belongs to the preset display object, then it is determined whether the text line corresponding to the first object storage unit is the first line of the text paragraph; If it is determined that the text line corresponding to the first object storage unit is the first line of the text paragraph, then the first display object is deleted from the first object storage unit; otherwise, the step of storing the first display object in the first object storage unit into the object storage unit of the adjacent previous text line is executed; or, based on the display order, a preset second number of display objects in the object storage unit of the adjacent previous text line are stored into the first object storage unit.

5. The method according to claim 1, characterized in that, If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then based on the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the page to be formatted, the following steps are performed: store the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line; Alternatively, based on the display order, a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line are stored into the target object storage unit, including: After determining that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, if it is determined that the number of display objects is equal to a preset first value, then it is determined whether the display objects stored in the target object storage unit contain punctuation marks. If it is determined that the displayed object contains punctuation marks, then based on the distance between the last displayed object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the page to be formatted, the following steps are performed: store the displayed objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line; or, based on the display order, store a preset first number of displayed objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit.

6. The method according to claim 1 or 5, characterized in that, If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then based on the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the page to be formatted, the following steps are performed: store the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line; Alternatively, based on the display order, a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line are stored into the target object storage unit, including: If it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold, then the distance between the last display object in the object storage unit corresponding to the adjacent previous text line and the preset display boundary of the page to be formatted is obtained; If the distance is determined to be not less than a preset distance threshold, the display object in the target object storage unit is stored in the object storage unit corresponding to the adjacent previous text line; otherwise, based on the display order, a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line are stored in the target object storage unit.

7. The method according to claim 1 or 5, characterized in that, Before storing a preset first number of display objects from the object storage unit corresponding to the adjacent previous text line into the target object storage unit based on the display order, the method further includes: Determine whether the first display object in the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line belongs to the preset display object; If it is determined that the first display object among the preset first number of display objects does not belong to the preset display objects, then the step of storing the preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit based on the display order is executed.

8. A page layout device, characterized in that, The device includes: A receiving module is used to receive at least one object storage unit corresponding to a page to be formatted; wherein, the object storage unit has a corresponding relationship with a text line on the page to be formatted, and the object storage unit is used to store the display objects in the text line in the display order; The first determining module is used to determine a target object storage unit from the at least one object storage unit; wherein the target object storage unit is the object storage unit corresponding to the last line of the text paragraph on the page to be formatted; The second determining module is used to determine whether the number of display objects stored in the target object storage unit is greater than a preset number threshold. The first storage module is used to perform the following steps based on the distance between the last display object in the object storage unit corresponding to the adjacent previous text line of the target object storage unit and the preset display boundary of the page to be formatted, when it is determined that the number of display objects stored in the target object storage unit is not greater than the preset number threshold: storing the display objects in the target object storage unit into the object storage unit corresponding to the adjacent previous text line; or, based on the display order, storing a preset first number of display objects in the object storage unit corresponding to the adjacent previous text line into the target object storage unit; wherein, both the target object storage unit and the object storage unit corresponding to the adjacent previous text line are used to draw the page to be formatted.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-7.

10. A page layout device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-7.

11. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • CN109743613A

  • CN114444438A

  • CN114549701A