CN107066435B - Typesetting method and typesetting device - Google Patents

Typesetting method and typesetting device Download PDF

Info

Publication number
CN107066435B
CN107066435B CN201611121335.4A CN201611121335A CN107066435B CN 107066435 B CN107066435 B CN 107066435B CN 201611121335 A CN201611121335 A CN 201611121335A CN 107066435 B CN107066435 B CN 107066435B
Authority
CN
China
Prior art keywords
information
typeset
typesetting
length
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611121335.4A
Other languages
Chinese (zh)
Other versions
CN107066435A (en
Inventor
李晨希
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201611121335.4A priority Critical patent/CN107066435B/en
Publication of CN107066435A publication Critical patent/CN107066435A/en
Application granted granted Critical
Publication of CN107066435B publication Critical patent/CN107066435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification

Abstract

The invention provides a typesetting method and a typesetting device, wherein the method comprises the following steps: acquiring information to be typeset and determining the length of each information to be typeset; grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset for the typesetting line; determining the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group; and typesetting the multiple groups of information to be typeset aiming at the typesetting lines based on the extension length. The technical scheme of the invention solves the problem of disordered visual effect caused by irregular information typesetting and improves the readability of the information.

Description

Typesetting method and typesetting device
Technical Field
The invention relates to the field of typesetting, in particular to a typesetting method and a typesetting device.
Background
With the development of the new media age, people pay more and more attention to new visual media. The new visual media is a new type of propagation media which is developed by using digital technology, network technology, mobile technology and the like after traditional media such as newspapers and magazines and provides information services for users through networks and terminals.
The new visual media provides information service for users through words and pictures; therefore, the typesetting format of the characters and the pictures can directly influence the quality of the information service provided by the new visual media to the users. In the prior art, various problems exist in a mode of providing information services for users through a scattered typesetting format or a centered typesetting format. For example, the new visual media provides the user with information services of the text contents such as hot book recommendation and hot movie recommendation according to the layout format, but the text contents laid out according to the layout format are not neat and beautiful enough in visual effect, and readability of the text contents is affected, so that higher information service quality cannot be achieved. In order to improve the quality of the information service, the position of the information should be reasonably typeset, so how to reasonably typeset the position of the information is an important problem to be solved when the new visual media provides high-quality service for users.
Disclosure of Invention
In order to overcome the above technical problems or at least partially solve the above technical problems, the following technical solutions are proposed:
the embodiment of the invention provides a typesetting method, which comprises the following steps:
acquiring information to be typeset and determining the length of each information to be typeset;
grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset for the typesetting line;
determining the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group;
and typesetting the multiple groups of information to be typeset aiming at the typesetting lines based on the extension length.
Preferably, the grouping of the information to be typeset based on the length of the information to be typeset and the preset length of the typesetting line to generate a plurality of groups of information to be typeset for the typesetting line includes:
sequencing the plurality of information to be typeset based on the length of the information to be typeset;
selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line;
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping of all the information to be typeset is completed.
Preferably, the grouping of the information to be typeset based on the length of the information to be typeset and the preset length of the typesetting line to generate a plurality of groups of information to be typeset for the typesetting line includes:
sequencing the plurality of information to be typeset based on the length of the information to be typeset;
grouping the sorted information to be typeset based on the preset length of the typesetting line and the number of the typesetting lines to generate a plurality of groups of information to be typeset for the typesetting line;
the step of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a grouping for one typesetting line until all the information to be typeset are grouped is completed, specifically comprising:
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and completing the grouping.
Preferably, the sorting the plurality of information to be laid out based on the length of the information to be laid out includes:
and sequencing the plurality of information to be typeset based on the sequence of the lengths of the information to be typeset from large to small.
Preferably, the determining the extension length of each information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group comprises:
calculating the difference between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group to determine the supplementary length for each typesetting line;
and calculating the ratio of the supplement length aiming at each typesetting line to the number of the information to be typeset in the corresponding group aiming at the typesetting line so as to determine the extension length of each information to be typeset in each typesetting line.
Preferably, based on the extended length, typesetting the multiple sets of information to be typeset for the typesetting line, including:
based on the sequence of the supplement length of each typesetting line from small to large, carrying out group sequencing on a plurality of groups of information to be typeset aiming at the typesetting lines, and carrying out uplink and downlink typesetting on each typesetting line according to the group sequencing;
and expanding the length of the information to be typeset in each group aiming at the typesetting lines based on the expansion length of each information to be typeset in each typesetting line so as to finish the typesetting of the left and right alignment of each typesetting line.
Preferably, the length of the information to be typeset is the display length of the information; the length of the typesetting line is the display length of the typesetting line.
The information to be typeset comprises any one of the following items:
and the text information or the picture information to be typeset.
Another embodiment of the present invention provides a typesetting apparatus, including:
the obtaining module is used for obtaining the information to be typeset and determining the length of each information to be typeset;
the grouping module is used for grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset aiming at the typesetting line;
the extension length determining module is used for determining the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group;
and the typesetting module is used for typesetting the plurality of groups of information to be typeset aiming at the typesetting rows based on the extension length.
Preferably, the grouping module is configured to sort the plurality of pieces of information to be typeset based on the length of the pieces of information to be typeset;
selecting a plurality of pieces of character information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line;
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping of all the information to be typeset is completed.
Preferably, the grouping module is configured to sort the plurality of pieces of information to be typeset based on a sequence of lengths of the pieces of information to be typeset from large to small;
grouping the sorted information to be typeset based on the preset length of the typesetting line and the number of the typesetting lines to generate a plurality of groups of information to be typeset for the typesetting line;
the method comprises the following steps of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line until all the information to be typeset is completely grouped, and specifically comprises the following steps:
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and completing the grouping.
Preferably, the grouping module is configured to sort the plurality of pieces of information to be typeset based on a sequence of lengths of the pieces of information to be typeset from large to small.
Preferably, the extended length determining module includes:
the first calculation unit is used for calculating the difference value between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group so as to determine the supplement length aiming at each typesetting line;
and the second calculating unit is used for calculating the ratio of the supplement length aiming at each typesetting line to the number of the information to be typeset in the corresponding group aiming at the typesetting line so as to determine the extension length of each information to be typeset in each typesetting line.
Preferably, the layout module includes:
the group sorting unit is used for carrying out group sorting on a plurality of groups of information to be typeset aiming at the typesetting lines based on the sequence of the supplement lengths aiming at the typesetting lines from small to large and carrying out uplink and downlink typesetting on the typesetting lines according to the group sorting;
and the left-right alignment typesetting unit is used for expanding the length of the information to be typeset in each group aiming at the typesetting lines based on the expansion length of each information to be typeset in each typesetting line so as to finish the typesetting of the left-right alignment of each typesetting line.
Preferably, the length of the information to be typeset is the display length of the information; the length of the typesetting line is the display length of the typesetting line.
The information to be typeset comprises any one of the following items:
and the text information or the picture information to be typeset.
In the technical scheme, the extension length of each piece of information to be typeset in each typesetting line is determined based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group; typesetting the multiple groups of information to be typeset aiming at the typesetting line based on the extension length; the typesetting effect obtained by the scheme meets the aesthetic standard of tidiness and beauty of users, the readability of information is improved, the browsing experience effect of the users is improved, and the quality of information service provided by the new visual media to the users is improved; further, guarantees are provided for the visual new media to accurately convey its intentions and ideas to the user.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating a typesetting method according to an embodiment of the invention;
FIG. 2 is a schematic diagram illustrating a process of grouping sorted information to be typeset according to a preferred embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating the process of determining the extended length of each information to be laid out in each layout row according to still another preferred embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a process of typesetting for a plurality of sets of information to be typeset of typeset lines according to another preferred embodiment of the invention;
FIG. 5 is a schematic structural framework diagram of a typesetting device according to another embodiment of the invention;
FIG. 6 is a block diagram of the extended length determination module according to a preferred embodiment of the present invention;
FIG. 7 is a schematic structural framework diagram of a typesetting module according to still another preferred embodiment of the invention;
fig. 8 is a schematic diagram of the layout of left and right alignments in a practical application scenario according to another preferred embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Fig. 1 is a flowchart illustrating a layout method according to an embodiment of the present invention.
Step S101: acquiring information to be typeset and determining the length of each information to be typeset; step S102: grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset for the typesetting line; step S103: determining the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group; step S104: and typesetting the multiple groups of information to be typeset aiming at the typesetting lines based on the extension length.
In the technical scheme, the extension length of each piece of information to be typeset in each typesetting line is determined based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group; typesetting the multiple groups of information to be typeset aiming at the typesetting line based on the extension length; the typesetting effect obtained by the scheme meets the aesthetic standard of tidiness and beauty of users, the readability of information is improved, the browsing experience effect of the users is improved, and the quality of information service provided by the new visual media to the users is improved; further, guarantees are provided for the visual new media to accurately convey its intentions and ideas to the user.
The following further explains the specific implementation of each step:
step S101: and acquiring the information to be typeset and determining the length of each information to be typeset.
The information to be typeset comprises any one of the following items: the information of the characters to be typeset or the information of the pictures to be typeset, such as the character blocks to be typeset and the videos to be typeset.
Specifically, a plurality of recommended words sent by a server are obtained in a mode that a terminal device pulls or issues the recommended words to the server, each recommended word is converted into a recommended word block which can be displayed on a screen of the terminal device according to a preset word block processing format, wherein the preset word block processing format comprises information such as recommended word fonts, recommended word numbers and word block sizes, and each recommended word block is used as picture information to be typeset.
And the length of the picture information to be typeset is the display length of the recommended word text block on the screen of the terminal equipment.
Specifically, the display length of each recommended word text block on the screen of the terminal equipment is calculated through a display length algorithm. Since the algorithm for displaying the length is a mature technology in the field, the specific calculation process is not described in detail herein.
It should be noted that, in the case that the number of recommended words acquired from the server does not exceed the display length threshold of the predetermined recommended word text block on the terminal device screen, recommended words including various lengths should be acquired, and the more recommended words with short lengths, the better.
The video to be typeset takes any frame of the video or any screenshot of the video as the content to be typeset of the video to be typeset, so that the video to be typeset is actually the picture to be typeset.
Step S102: and grouping the information to be typeset based on the length of the information to be typeset and the preset typesetting line length to generate a plurality of groups of information to be typeset for the typesetting line.
Specifically, the step of grouping the sorted text information to be typeset based on the length of the information to be typeset and the preset length of the typesetting line to generate a plurality of groups of text information to be typeset for the typesetting line further includes the steps as shown in fig. 2: step S201: sequencing the plurality of information to be typeset based on the length of the information to be typeset; step S202: selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line; step S203: and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping of all the information to be typeset is completed.
Preferably, the sorted information to be typeset is grouped based on the preset length of the typesetting line and the number of the typesetting lines, and a plurality of groups of information to be typeset for the typesetting lines are generated;
the method comprises the following steps of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line until all the information to be typeset is completely grouped, and specifically comprises the following steps: and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and completing the grouping.
Specifically, the recommended word character blocks are sorted based on the display length of the recommended word character blocks on a screen of the terminal equipment; traversing the recommended word text block queue according to the sequence, if the ith recommended word text block is placed in the 1 st typesetting line and the sum of the display lengths of all the recommended word text blocks in the 1 st typesetting line on the screen of the terminal equipment is not more than the display length of the typesetting line on the screen of the terminal equipment, placing the ith recommended word text block in the 1 st typesetting line, and if the sum of the display lengths of all the recommended word text blocks in the 1 st typesetting line on the screen of the terminal equipment is more than the display length of the typesetting line on the screen of the terminal equipment, placing the ith recommended word text block in the 2 nd typesetting line. And (3) placing the N recommended word character blocks in K typesetting lines one by one, wherein the 1 st typesetting line comprises Count1 recommended word character blocks, the 2 nd typesetting line comprises Count2 recommended word character blocks, and so on, and the K typesetting line comprises Count K recommended word character blocks.
For example, 3 layout lines are set and each layout line has a display length of 40 pixels on the screen of the terminal device. Selecting from the sorted recommended word text blocks according to the sequence and placing in the 1 st typesetting line, and then placing in the 1 st typesetting line: the recommended word text block 'full-direction self-expression of spoken English', the recommended word text block '1988 i want to talk with the world', because the recommended word text block 'puzzle of world celebrities' is placed in the 1 st typesetting line, the display length of the typesetting line on the screen of the terminal device is exceeded, the recommended word text block is placed in the 2 nd typesetting line, and other recommended word text blocks cannot be placed in the residual display length of the 1 st typesetting line on the screen of the terminal device, the 2 nd typesetting line is placed: the recommended word text block 'puzzle of world famous people' is unresolved ', the recommended word text block' five thousand years up and down 'of china', the recommended word text block 'three-wool work set', because the recommended word text block 'Dongyouwu' is put in the 2 nd typesetting line, the display length of the 2 nd typesetting line on the screen of the terminal equipment is exceeded, then the recommended word text block is put in the 3 rd typesetting line, and the residual display length of the 2 nd typesetting line on the screen of the terminal equipment can not put down other recommended word text blocks, then the 3 rd typesetting line is put in: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", the recommended word text block "great wall", because the recommended word text block "fairway" is put in the 3 rd typesetting line, can cause the display length of the 3 rd typesetting line on the terminal equipment screen to be exceeded, and no other recommended word text block can be put yet, then the 3 rd typesetting line finishes discharging. Meanwhile, as the discharge of all typesetting lines is finished, the recommendation word character block 'fairway' which is not put in any typesetting line is omitted.
Finally, the emissions results were as follows:
the 1 st typesetting line: the recommended word text block "spoken English all-round self-expression", and the recommended word text block "1988 i want to talk to this world".
The 2 nd typesetting line: the word-recommending character block ' the puzzle of the world famous people ' is ' a character block ', a word-recommending character block ' five thousand years up and down ' of China ' and a word-recommending character block ' a three-hair work set '.
The 3 rd typesetting line: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", and the recommended word text block "city.
Specifically, the step of sorting the plurality of pieces of information to be typeset based on the length of the pieces of information to be typeset includes: and sequencing the plurality of information to be typeset based on the sequence of the lengths of the information to be typeset from large to small.
And sequencing the recommended word character blocks based on the display length of the recommended word character blocks on the screen of the terminal equipment, wherein the recommended word character blocks are displayed before the terminal equipment screen in a large length, and the recommended word character blocks are displayed after the terminal equipment screen in a small length to form a recommended word character block queue with ordered length.
And the length of the typesetting line is the display length of the typesetting line on the screen of the terminal equipment.
For example, the obtained picture information to be typeset is as follows: a recommended word text block "fairway", the display length of the recommended word text block on the screen of the terminal device being 6 pixels, the recommended word text block "city fence", the display length of the recommended word text block on the screen of the terminal device being 6 pixels, the recommended word text block "liuchufeng", the display length of the recommended word text block on the screen of the terminal device being 7.5 pixels, the recommended word text block "lanlingwang", the display length of the recommended word text block on the screen of the terminal device being 7.5 pixels, the recommended word text block "harry baud", the display length of the recommended word text block on the screen of the terminal device being 8.9 pixels, the recommended word text block "euyu", the display length of the recommended word text block on the screen of the terminal device being 8.9 pixels, the recommended word text block "trigo album", the display length of the recommended word text block on the screen of the terminal device being 10.7 pixels, "five thousand years ago in the Chinese of the recommended word text block", the display length of the recommended word text block on the screen of the terminal equipment is 13.5 pixels, the recommended word text block "the world celebrity is not solved riddle", the display length of the recommended word text block on the screen of the terminal equipment is 15 pixels, the recommended word text block "1988I wants to talk with the world", the display length of the recommended word text block on the screen of the terminal equipment is 19.5 pixels, the recommended word text block "English spoken language omnibearing self-expression", and the display length of the recommended word text block on the screen of the terminal equipment is 19.5 pixels; according to the sequence of the length of the character information to be typeset from big to small, the character information to be typeset is sequenced as follows: the recommendation word text block "all-directional self expression of spoken English", the recommendation word text block "1988 i want to talk to the world", the recommendation word text block "puzzle of unknown world famous people", the recommendation word text block "five thousand years up and down" Chinese ", the recommendation word text block" three-wool works set ", the recommendation word text block" east Yeyu ", the recommendation word text block" Harry potter ", the recommendation word text block" Lanling king ", the recommendation word text block" Lichuan maple ", the recommendation word text block" city enclosing ", and the recommendation word text block" fairway ".
It should be noted that, in the implementation and application process of the technical solution of the present invention, the number of the word blocks of the recommended word needs to be greater than 20, but the preferred embodiment is only an example for those skilled in the art to understand the technical solution of the present invention, and therefore, the number of the word blocks in the preferred embodiment does not exceed 20, but does not affect the implementation and application of the technical solution of the present invention.
Step S103: and determining the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group.
Specifically, the method for determining the extended length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group further includes the steps as shown in fig. 3: step S301: calculating the difference between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group to determine the supplementary length for each typesetting line; step S302: and calculating the ratio of the supplement length aiming at each typesetting line to the number of the information to be typeset in the corresponding group aiming at the typesetting line so as to determine the extension length of each information to be typeset in each typesetting line.
Setting the display length of each typesetting line on the screen of the terminal equipment as Screen width, setting the display length of the recommended word text block on the screen of the terminal equipment as ItemWidth, and calculating the sum of the display lengths of all the recommended word text blocks in each typesetting line on the screen of the terminal equipment: RealWidth1, RealWidth2, … … RealWidth k; the extension length of each recommended word text block in each typesetting line on the screen of the terminal equipment is as follows: (ScreenWidth-RealWidthK)/CountK.
For example, the 1 st typesetting line: the recommended word text block "full-directional self-expression of spoken English", and the recommended word text block "1988 i want to talk to this world"; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-19.5-19.5-)/2 ═ 0.5 pixel. The 2 nd typesetting line: the recommended word character block ' puzzle undecided by world celebrities ', the recommended word character block ' five thousand years up and down ' of China ' and the recommended word character block ' three-hair work set '; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-15-13.5-10.7)/2 ═ 0.4 pixel. The 3 rd typesetting line: a recommended word text block "east wild yuwu", a recommended word text block "harybot", a recommended word text block "lanling king", a recommended word text block "liuchuanfeng", and a recommended word text block "great wall"; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-8.9-8.9-7.5-7.5-6)/2 ═ 0.6 pixel.
Step S104: and typesetting the multiple groups of information to be typeset aiming at the typesetting lines based on the extension length.
Specifically, based on the extended length, typesetting is performed on the multiple sets of information to be typeset for the typesetting line, which further includes as shown in fig. 4: step S401: based on the sequence of the supplement length of each typesetting line from small to large, carrying out group sequencing on a plurality of groups of information to be typeset aiming at the typesetting lines, and carrying out uplink and downlink typesetting on each typesetting line according to the group sequencing; step S402: and expanding the length of the information to be typeset in each group aiming at the typesetting lines based on the expansion length of each information to be typeset in each typesetting line so as to finish the typesetting of the left and right alignment of each typesetting line.
And carrying out group sequencing on a plurality of groups of information to be typeset aiming at the typesetting lines based on the supplement length of each typesetting line on the screen of the terminal equipment, namely sequencing the typesetting lines which are completely arranged, and carrying out up-down typesetting on each typesetting line according to the group sequencing to form relatively tidy typesetting.
For example, the extension length of each recommended word text block on the terminal device screen in the 1 st layout line is 0.5 pixel, the extension length of each recommended word text block on the terminal device screen in the 2 nd layout line is 0.4 pixel, and the extension length of each recommended word text block on the terminal device screen in the 3 rd layout line is 0.6 pixel. The result of sorting the typesetting lines which are completely discharged is as follows:
the 2 nd typesetting line: the recommended word character block 'puzzle undecided by world celebrities', the recommended word character block 'five thousand years above and below China' and the recommended word character block 'three-hair work set'.
The 1 st typesetting line: the recommended word text block "spoken English all-round self-expression", and the recommended word text block "1988 i want to talk to this world".
The 3 rd typesetting line: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", and the recommended word text block "city.
Expanding the display length of the recommended word text block of the sequencing result on the screen of the terminal equipment, and finally completing the typesetting of each typesetting line in a left-right alignment way, namely:
the 1 st typesetting line: the expanded recommended word text block "puzzle unblended by world celebrities", the expanded recommended word text block "five thousand years above and below china", and the expanded recommended word text block "three-hair work set".
The 2 nd typesetting line: the expanded recommended word block "spoken English full-direction self-expression", the expanded recommended word block "1988 i want to talk to this world".
The 3 rd typesetting line: the expanded recommended word text block "dongyouwu", the expanded recommended word text block "harlybaud", the expanded recommended word text block "lanlingwang", the expanded recommended word text block "suanchuan maple", and the expanded recommended word text block "great wall".
In the implementation application scenario, according to the steps of the above technical solution, the actual effect of the implemented right-left aligned typesetting is as shown in fig. 8. It should be noted here that, in practical applications, the extended length of the recommended word text block on the terminal device screen is between 0.33 pixel and 0.66 pixel, and the extended recommended word text block looks slightly changed and is not easily perceived, and is more in line with the visual aesthetic of the user.
FIG. 5 is a schematic structural framework diagram of a typesetting device according to another embodiment of the invention.
An obtaining module 501, configured to obtain information to be typeset and determine the length of each information to be typeset; a grouping module 502, which groups the information to be typeset based on the length of the information to be typeset and the length of the preset typesetting line, and generates a plurality of groups of information to be typeset for the typesetting line; an extension length determining module 503, configured to determine an extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the pieces of information to be typeset in each group of the typesetting lines, and the number of the pieces of information to be typeset in the corresponding group; the layout module 504, based on the extended length, lays out the multiple sets of information to be laid out for the layout row.
The following further explains the specific implementation of each module:
the obtaining module 501 obtains the information to be typeset and determines the length of each information to be typeset.
The information to be typeset comprises any one of the following items: the information of the characters to be typeset or the information of the pictures to be typeset, such as the character blocks to be typeset and the videos to be typeset.
Specifically, the obtaining module 501 obtains a plurality of recommended words sent by the server in a manner that the terminal device pulls or issues the recommended words to the server, converts each recommended word into a recommended word block that can be displayed on a screen of the terminal device according to a predetermined word block processing format, where the predetermined word block processing format includes information such as a font of the recommended word, a word size of the recommended word, and a size of the word block, and uses each recommended word block as information of a picture to be typeset.
And the length of the information to be typeset is the display length of the character block of the recommended word on the screen of the terminal equipment.
Specifically, the display length of each recommended word text block on the screen of the terminal equipment is calculated through a display length algorithm. Since the algorithm for displaying the length is a mature technology in the field, the specific calculation process is not described in detail herein.
It should be noted that, in the case that the number of recommended words acquired from the server does not exceed the display length threshold of the predetermined recommended word text block on the terminal device screen, recommended words including various lengths should be acquired, and the more recommended words with short lengths, the better.
The video to be typeset takes any frame of the video or any screenshot of the video as the content to be typeset of the video to be typeset, so that the video to be typeset is actually the picture to be typeset.
The grouping module 502 groups the information to be typeset based on the length of the information to be typeset and the preset length of the typesetting line, and generates a plurality of groups of information to be typeset for the typesetting line.
Specifically, the grouping module 502 sorts a plurality of pieces of information to be typeset based on the length of the information to be typeset; selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line;
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping of all the information to be typeset is completed.
Preferably, the grouping module 502 groups the information to be typeset based on the preset length of the typesetting line and the number of the typesetting lines, and generates a plurality of groups of information to be typeset for the typesetting lines;
the method comprises the following steps of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line until all the information to be typeset is completely grouped, and specifically comprises the following steps:
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and completing the grouping.
Specifically, the grouping module 502 sequences the recommended word character blocks based on the display length of the recommended word character blocks on the screen of the terminal device; traversing the recommended word text block queue according to the sequence, if the ith recommended word text block is placed in the 1 st typesetting line and the sum of the display lengths of all the recommended word text blocks in the 1 st typesetting line on the screen of the terminal equipment is not more than the display length of the typesetting line on the screen of the terminal equipment, placing the ith recommended word text block in the 1 st typesetting line, and if the sum of the display lengths of all the recommended word text blocks in the 1 st typesetting line on the screen of the terminal equipment is more than the display length of the typesetting line on the screen of the terminal equipment, placing the ith recommended word text block in the 2 nd typesetting line. And (3) placing the N recommended word character blocks in K typesetting lines one by one, wherein the 1 st typesetting line comprises Count1 recommended word character blocks, the 2 nd typesetting line comprises Count2 recommended word character blocks, and so on, and the K typesetting line comprises Count K recommended word character blocks.
For example, 3 layout lines are set and each layout line has a display length of 40 pixels on the screen of the terminal device. The grouping module 502 selects from the sorted recommended word text blocks according to the sequence and puts the selected recommended word text blocks in the 1 st typesetting line, and then the 1 st typesetting line puts: the recommended word text block 'full-direction self-expression of spoken English', the recommended word text block '1988 i want to talk with the world', because the recommended word text block 'puzzle of world celebrities' is placed in the 1 st typesetting line, the display length of the typesetting line on the screen of the terminal device is exceeded, the recommended word text block is placed in the 2 nd typesetting line, and other recommended word text blocks cannot be placed in the residual display length of the 1 st typesetting line on the screen of the terminal device, the 2 nd typesetting line is placed: the recommended word text block 'puzzle of world famous people' is unresolved ', the recommended word text block' five thousand years up and down 'of china', the recommended word text block 'three-wool work set', because the recommended word text block 'Dongyouwu' is put in the 2 nd typesetting line, the display length of the 2 nd typesetting line on the screen of the terminal equipment is exceeded, then the recommended word text block is put in the 3 rd typesetting line, and the residual display length of the 2 nd typesetting line on the screen of the terminal equipment can not put down other recommended word text blocks, then the 3 rd typesetting line is put in: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", the recommended word text block "great wall", because the recommended word text block "fairway" is put in the 3 rd typesetting line, can cause the display length of the 3 rd typesetting line on the terminal equipment screen to be exceeded, and no other recommended word text block can be put yet, then the 3 rd typesetting line finishes discharging. Meanwhile, as the discharge of all typesetting lines is finished, the recommendation word character block 'fairway' which is not put in any typesetting line is omitted.
Finally, the emissions results were as follows:
the 1 st typesetting line: the recommended word text block "spoken English all-round self-expression", and the recommended word text block "1988 i want to talk to this world".
The 2 nd typesetting line: the word-recommending character block ' the puzzle of the world famous people ' is ' a character block ', a word-recommending character block ' five thousand years up and down ' of China ' and a word-recommending character block ' a three-hair work set '.
The 3 rd typesetting line: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", and the recommended word text block "city.
Specifically, the grouping module 502 sorts a plurality of pieces of information to be typeset based on the order of the lengths of the pieces of information to be typeset from large to small.
The grouping module 502 sorts the recommended word character blocks based on the display length of the recommended word character blocks on the screen of the terminal device, wherein the recommended word character blocks are displayed before the recommended word character blocks are displayed on the screen of the terminal device in a large length, and the recommended word character blocks are displayed after the recommended word character blocks are displayed on the screen of the terminal device in a small length to form a recommended word character block queue with ordered length.
And the length of the typesetting line is the display length of the typesetting line on the screen of the terminal equipment.
For example, the obtained picture information to be typeset is as follows: a recommended word text block "fairway", the display length of the recommended word text block on the screen of the terminal device being 6 pixels, the recommended word text block "city fence", the display length of the recommended word text block on the screen of the terminal device being 6 pixels, the recommended word text block "liuchufeng", the display length of the recommended word text block on the screen of the terminal device being 7.5 pixels, the recommended word text block "lanlingwang", the display length of the recommended word text block on the screen of the terminal device being 7.5 pixels, the recommended word text block "harry baud", the display length of the recommended word text block on the screen of the terminal device being 8.9 pixels, the recommended word text block "euyu", the display length of the recommended word text block on the screen of the terminal device being 8.9 pixels, the recommended word text block "trigo album", the display length of the recommended word text block on the screen of the terminal device being 10.7 pixels, "five thousand years ago in the Chinese of the recommended word text block", the display length of the recommended word text block on the screen of the terminal equipment is 13.5 pixels, the recommended word text block "the world celebrity is not solved riddle", the display length of the recommended word text block on the screen of the terminal equipment is 15 pixels, the recommended word text block "1988I wants to talk with the world", the display length of the recommended word text block on the screen of the terminal equipment is 19.5 pixels, the recommended word text block "English spoken language omnibearing self-expression", and the display length of the recommended word text block on the screen of the terminal equipment is 19.5 pixels; according to the sequence of the length of the character information to be typeset from big to small, the character information to be typeset is sequenced as follows: the recommendation word text block "all-directional self expression of spoken English", the recommendation word text block "1988 i want to talk to the world", the recommendation word text block "puzzle of unknown world famous people", the recommendation word text block "five thousand years up and down" Chinese ", the recommendation word text block" three-wool works set ", the recommendation word text block" east Yeyu ", the recommendation word text block" Harry potter ", the recommendation word text block" Lanling king ", the recommendation word text block" Lichuan maple ", the recommendation word text block" city enclosing ", and the recommendation word text block" fairway ".
It should be noted that, in the implementation and application process of the technical solution of the present invention, the number of the word blocks of the recommended word needs to be greater than 20, but the preferred embodiment is only an example for those skilled in the art to understand the technical solution of the present invention, and therefore, the number of the word blocks in the preferred embodiment does not exceed 20, but does not affect the implementation and application of the technical solution of the present invention.
The extension length determining module 503 determines the extension length of each piece of information to be typeset in each typesetting line based on the length of the typesetting line, the sum of the lengths of the information to be typeset in each group of the typesetting lines and the number of the information to be typeset in the corresponding group.
Specifically, the extended length determining module 503 specifically includes, as shown in fig. 6: a first calculating unit 601, which calculates the difference between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group to determine the supplementary length for each typesetting line; the second calculating unit 602 calculates a ratio of the supplemental length for each layout line to the number of information to be laid out in the corresponding group for the layout line to determine the extended length of each information to be laid out in each layout line.
Setting the display length of each typesetting line on the screen of the terminal equipment as Screen width, setting the display length of the recommended word text block on the screen of the terminal equipment as ItemWidth, and calculating the sum of the display lengths of all the recommended word text blocks in each typesetting line on the screen of the terminal equipment: RealWidth1, RealWidth2, … … RealWidth k; the extension length of each recommended word text block in each typesetting line on the screen of the terminal equipment is as follows: (ScreenWidth-RealWidthK)/CountK.
For example, the 1 st typesetting line: the recommended word text block "full-directional self-expression of spoken English", and the recommended word text block "1988 i want to talk to this world"; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-19.5-19.5-)/2 ═ 0.5 pixel. The 2 nd typesetting line: the recommended word character block ' puzzle undecided by world celebrities ', the recommended word character block ' five thousand years up and down ' of China ' and the recommended word character block ' three-hair work set '; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-15-13.5-10.7)/2 ═ 0.4 pixel. The 3 rd typesetting line: a recommended word text block "east wild yuwu", a recommended word text block "harybot", a recommended word text block "lanling king", a recommended word text block "liuchuanfeng", and a recommended word text block "great wall"; the extension length of each recommended word text block in the typesetting line on the screen of the terminal equipment is as follows: (40-8.9-8.9-7.5-7.5-6)/2 ═ 0.6 pixel. The layout module 504, based on the extended length, lays out the multiple sets of information to be laid out for the layout row.
Specifically, the typesetting module 504 specifically includes as shown in fig. 7: a group sorting unit 701 for performing group sorting of a plurality of groups of information to be typeset for the typesetting lines based on the sequence of the supplement lengths for the typesetting lines from small to large, and performing uplink and downlink typesetting for the typesetting lines according to the group sorting; the left-right alignment typesetting unit 702 expands the length of the information to be typeset in each group of the typesetting lines based on the expansion length of each information to be typeset in each typesetting line, so as to complete the typesetting of each typesetting line in left-right alignment.
The layout module 505 performs group sorting on the multiple sets of information to be laid out for each layout line based on the supplemental length of each layout line on the terminal device screen, that is, sorts the layout lines that have finished the layout, and performs up-down layout on each layout line according to the group sorting to form a relatively neat layout.
For example, the extension length of each recommended word text block on the terminal device screen in the 1 st layout line is 0.5 pixel, the extension length of each recommended word text block on the terminal device screen in the 2 nd layout line is 0.4 pixel, and the extension length of each recommended word text block on the terminal device screen in the 3 rd layout line is 0.6 pixel. The result of sorting the typesetting lines which are completely discharged is as follows:
the 2 nd typesetting line: the recommended word character block 'puzzle undecided by world celebrities', the recommended word character block 'five thousand years above and below China' and the recommended word character block 'three-hair work set'.
The 1 st typesetting line: the recommended word text block "spoken English all-round self-expression", and the recommended word text block "1988 i want to talk to this world".
The 3 rd typesetting line: the recommended word text block "east wild yuwu", the recommended word text block "harry baud", the recommended word text block "lanling king", the recommended word text block "liuchuanfeng", and the recommended word text block "city.
Expanding the display length of the recommended word text block of the sequencing result on the screen of the terminal equipment, and finally completing the typesetting of each typesetting line in a left-right alignment way, namely:
the 1 st typesetting line: the expanded recommended word text block "puzzle unblended by world celebrities", the expanded recommended word text block "five thousand years above and below china", and the expanded recommended word text block "three-hair work set".
The 2 nd typesetting line: the expanded recommended word block "spoken English full-direction self-expression", the expanded recommended word block "1988 i want to talk to this world".
The 3 rd typesetting line: the expanded recommended word text block "dongyouwu", the expanded recommended word text block "harlybaud", the expanded recommended word text block "lanlingwang", the expanded recommended word text block "suanchuan maple", and the expanded recommended word text block "great wall".
In an application implementation scenario, according to the modules in the above technical solution, an actual effect of the implemented right-left aligned typesetting is as shown in fig. 8. It should be noted here that, in practical applications, the extended length of the recommended word text block on the terminal device screen is between 0.33 pixel and 0.66 pixel, and the extended recommended word text block looks slightly changed and is not easily perceived, and is more in line with the visual aesthetic of the user.
Those skilled in the art will appreciate that the present invention includes apparatus directed to performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable programmable Read-Only memories), EEPROMs (Electrically Erasable programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (14)

1. A method of composition, comprising:
acquiring information to be typeset and determining the length of each information to be typeset;
grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset for the typesetting line;
calculating the difference between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group to determine the supplementary length for each typesetting line; calculating the ratio of the supplement length for each typesetting line to the number of the information to be typeset in the corresponding group for the typesetting line so as to determine the extension length of each information to be typeset in each typesetting line;
and typesetting the multiple groups of information to be typeset aiming at the typesetting lines based on the extension length.
2. The method according to claim 1, wherein grouping the information to be typeset based on the length of the information to be typeset and a preset typesetting line length to generate a plurality of groups of information to be typeset for typesetting lines comprises:
sequencing the information to be typeset based on the length of the information to be typeset;
selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line;
and repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until all the information to be typeset is completely grouped.
3. The method according to claim 2, wherein grouping the information to be typeset based on the length of the information to be typeset and a preset typesetting line length to generate a plurality of groups of information to be typeset for typesetting lines comprises:
sequencing the plurality of information to be typeset based on the length of the information to be typeset;
grouping the sorted information to be typeset based on the preset length of the typesetting line and the number of the typesetting lines to generate a plurality of groups of information to be typeset for the typesetting line;
the step of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a grouping for one typesetting line until all the information to be typeset are grouped is completed, specifically comprising:
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and finishing the grouping.
4. The method according to claim 2 or 3, wherein the sorting the plurality of information to be laid out based on the length of the information to be laid out comprises:
and sequencing the plurality of information to be typeset based on the sequence of the lengths of the information to be typeset from large to small.
5. The method according to claim 1 or 2, wherein typesetting the information to be typeset for the plurality of groups of typeset lines based on the extension length comprises:
based on the sequence of the supplement lengths of all the typesetting lines from small to large, carrying out group sequencing on the multiple groups of information to be typeset of the typesetting lines, and carrying out uplink and downlink typesetting on all the typesetting lines according to the group sequencing;
and expanding the length of the information to be typeset in each group aiming at the typesetting lines based on the expansion length of each information to be typeset in each typesetting line so as to finish the typesetting of the left and right alignment of each typesetting line.
6. The method according to claim 1 or 2, wherein the length of the information to be typeset is the display length of the information; the length of the typesetting line is the display length of the typesetting line.
7. The method according to claim 1, wherein the information to be typeset comprises any one of:
and the text information or the picture information to be typeset.
8. A composition apparatus, comprising:
the obtaining module is used for obtaining the information to be typeset and determining the length of each information to be typeset;
the grouping module is used for grouping the information to be typeset based on the length of the information to be typeset and the length of a preset typesetting line to generate a plurality of groups of information to be typeset for the typesetting line;
the extension length determining module comprises a first calculating unit and a second calculating unit, wherein the first calculating unit is used for calculating the difference value between the length of the typesetting line and the sum of the lengths of the information to be typeset in each group so as to determine the supplement length aiming at each typesetting line; the second calculation unit is used for calculating the ratio of the supplement length aiming at each typesetting line to the number of the information to be typeset in the corresponding group aiming at the typesetting line so as to determine the extension length of each information to be typeset in each typesetting line;
and the typesetting module is used for typesetting the plurality of groups of information to be typeset aiming at the typesetting rows based on the extension length.
9. The apparatus according to claim 8, wherein the grouping module is configured to sort the plurality of information to be laid out based on the length of the information to be laid out;
selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a group aiming at one typesetting line, wherein the sum of the lengths of the plurality of pieces of information to be typeset is not more than the length of the typesetting line;
and repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until all the information to be typeset is completely grouped.
10. The apparatus according to claim 9, wherein the grouping module is configured to sort the plurality of information to be laid out based on the length of the information to be laid out;
grouping the sorted information to be typeset based on the preset length of the typesetting line and the number of the typesetting lines to generate a plurality of groups of information to be typeset for the typesetting line;
the step of repeatedly executing the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate a grouping for one typesetting line until all the information to be typeset are grouped is completed, specifically comprising:
and repeating the step of selecting a plurality of pieces of information to be typeset from the sorted information to be typeset according to the sequence to generate the grouping aiming at one typesetting line until the grouping number is the same as the typesetting line number, and finishing the grouping.
11. The apparatus according to claim 9 or 10, wherein the grouping module is configured to sort the plurality of pieces of information to be typeset based on a descending order of the lengths of the pieces of information to be typeset.
12. The apparatus of claim 8 or 9, wherein the composition module comprises:
the group sorting unit is used for carrying out group sorting on the multiple groups of information to be typeset aiming at the typesetting lines based on the sequence of the supplement lengths aiming at the typesetting lines from small to large and carrying out uplink and downlink typesetting on the typesetting lines according to the group sorting;
and the left-right alignment typesetting unit is used for expanding the length of the information to be typeset in each group aiming at the typesetting lines based on the expansion length of each information to be typeset in each typesetting line so as to finish the typesetting of the left-right alignment of each typesetting line.
13. The apparatus according to claim 8 or 9, wherein the length of the information to be laid out is the display length of the information; the length of the typesetting line is the display length of the typesetting line.
14. The apparatus according to claim 8, wherein the information to be typeset comprises any one of:
and the text information or the picture information to be typeset.
CN201611121335.4A 2016-12-08 2016-12-08 Typesetting method and typesetting device Active CN107066435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611121335.4A CN107066435B (en) 2016-12-08 2016-12-08 Typesetting method and typesetting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611121335.4A CN107066435B (en) 2016-12-08 2016-12-08 Typesetting method and typesetting device

Publications (2)

Publication Number Publication Date
CN107066435A CN107066435A (en) 2017-08-18
CN107066435B true CN107066435B (en) 2020-05-19

Family

ID=59619484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611121335.4A Active CN107066435B (en) 2016-12-08 2016-12-08 Typesetting method and typesetting device

Country Status (1)

Country Link
CN (1) CN107066435B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111507527B (en) * 2020-04-17 2022-04-19 无锡雪浪数制科技有限公司 Furniture blanking typesetting optimization method considering raw material diversity and uncertainty

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104867103A (en) * 2014-02-24 2015-08-26 腾讯科技(深圳)有限公司 Photograph display processing method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104867103A (en) * 2014-02-24 2015-08-26 腾讯科技(深圳)有限公司 Photograph display processing method and device

Also Published As

Publication number Publication date
CN107066435A (en) 2017-08-18

Similar Documents

Publication Publication Date Title
CN110163285B (en) Ticket recognition training sample synthesis method and computer storage medium
US10347023B2 (en) Data drawing method and apparatus, terminal, and storage medium
CN107092643B (en) Barrage rendering method and device
CN105095200B (en) The method and apparatus that picture is shown in a manner of waterfall stream
CN104915332B (en) A kind of method and device for generating layout template
CN101984426B (en) Method used for character splitting on webpage picture and device thereof
CN106648391B (en) Handwriting synchronization method, device and system
CN105468617B (en) Adjust the method and device of web page contents color
CN105094775B (en) Webpage generation method and device
CN106156237B (en) Information processing method, information processing unit and user equipment
CN106408096B (en) Data processing method in online ticketing system and online ticketing system
CN107147940A (en) Method, device, electronic equipment and the storage medium of content carousel
CN102156716A (en) Method and device for re-typesetting web page
WO2015096588A1 (en) Method and device for switching display pages
CN107133909B (en) Method and device for recombining shaders
CN106126140B (en) A kind of method, apparatus and electronic equipment of rendering type
CN107066435B (en) Typesetting method and typesetting device
US9774549B2 (en) Method and apparatus for displaying instant messaging (IM) message
CN104615587B (en) A kind of electronic data composition method and device
CN106445903A (en) Image-text data typesetting method and apparatus
EP2711817A2 (en) Theme display method and device thereof
CN106293369B (en) Exchange method, interactive device and user equipment based on barrage
CN107817999A (en) The generation method and terminal of a kind of dynamic wallpaper
CN103853347B (en) Information release method based on gravity sensing horizontal screen display of mobile terminal
CN106488314B (en) A kind of barrage rendering method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200422

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping radio square B tower 13 floor 03 unit self

Applicant before: GUANGZHOU ALIBABA LITERATURE INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant