A text display method, device, equipment, medium and product
The method automatically adjusts text size and layout based on importance to reduce manual user interaction and enhance visual appeal in text arrangement on device interfaces.
Patent Information
- Application Number
- CN202210647359.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-06-09
AI Technical Summary
When displaying multiple texts, users need to manually set the layout position of each text, which leads to high workload and inconvenience.
Receive input of the importance of text, adjust the text size according to the importance, and determine the layout position of the text in the image according to the order of importance, and automatically complete the layout.
Reduces user manual operations and improves the convenience and aesthetics of text display. Users only need to provide text and importance to automatically layout.
Smart Images

Figure CN114880063B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a text display method, apparatus, device, computer-readable storage medium, and computer program product. Background Art
[0002] With the continuous development of computer technologies, especially mobile Internet technologies, various applications can be installed on electronic devices such as mobile phones and computers. These applications can provide users with rich human-computer interaction interfaces. Through the human-computer interaction interfaces, users can interact with the electronic devices. For example, the electronic devices can be used to display information such as texts.
[0003] Currently, when a user uses an electronic device to display a group of texts, the user needs to manually set the layout position of each text. When the number of texts is too large, this will greatly increase the workload of the user, which is very inconvenient. It can be seen that how to more conveniently display texts and reduce the manual operations of the user is an important issue that those skilled in the art focus on. Summary of the Invention
[0004] The purpose of the present disclosure is to provide a text display method, apparatus, device, computer-readable storage medium, and computer program product, which can reduce the manual operations of the user and more conveniently display texts.
[0005] In a first aspect, the present disclosure provides a text display method, which includes:
[0006] Receiving an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts;
[0007] Adjusting the size of each text according to the importance level of each text;
[0008] Sequentially determining the layout position of each text with the adjusted size in the image according to the order of the importance level of each text;
[0009] Displaying each text after the layout is completed in the image.
[0010] In a second aspect, the present disclosure provides a text display apparatus, including:
[0011] A receiving module, configured to receive an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts;
[0012] An adjusting module, configured to adjust the size of each text according to the importance level of each text;
[0013] A determination module, configured to sequentially determine the layout positions of each text after size adjustment in the image according to the order of the importance levels of each text;
[0014] A display module, configured to display each text after layout in the image.
[0015] In a third aspect, the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of the first aspects of the present disclosure are implemented.
[0016] In a fourth aspect, the present disclosure provides an electronic device, including:
[0017] A storage device, on which a computer program is stored;
[0018] A processing device, configured to execute the computer program in the storage device to implement the steps of the method described in any one of the first aspects of the present disclosure.
[0019] In a fifth aspect, the present disclosure provides a computer program product including instructions, and when it runs on a device, the device is caused to execute the method described in any one of the implementation manners of the first aspect above.
[0020] As can be seen from the above technical solutions, the present disclosure has the following advantages:
[0021] The present disclosure provides a text display method, device, equipment, medium and product. The method includes: receiving an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts; adjusting the size of each text according to the importance level of each text; sequentially determining the layout positions of each text after size adjustment in the image according to the order of the importance levels of each text; and displaying each text after layout in the image. This method can automatically arrange the text at a specified position in the image based on the importance level of the text, thereby being able to beautifully display the text to the user. For the user, the user only needs to provide the text, its importance level, and the image to be filled, without subsequent manual operations, reducing the user's operations and improving the user experience.
[0022] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation section. Description of the Drawings
[0023] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below.
[0024] Figure 1 It is a flowchart of a text display method provided by an embodiment of the present disclosure;
[0025] Figure 2A A schematic diagram of an input interface provided by an embodiment of the present disclosure;
[0026] Figure 2B Another schematic diagram of an input interface provided by an embodiment of the present disclosure;
[0027] Figure 3 A schematic diagram of a locus line with the center of an image as the origin provided by an embodiment of the present disclosure;
[0028] Figure 4 A schematic diagram of text rotation provided by an embodiment of the present disclosure;
[0029] Figure 5 A schematic diagram of an image of a multi-connected domain provided by an embodiment of the present disclosure;
[0030] Figure 6A A schematic diagram of a word cloud provided by an embodiment of the present disclosure;
[0031] Figure 6B A schematic diagram of interacting with a word cloud provided by an embodiment of the present disclosure;
[0032] Figure 7 A schematic diagram of a text display device provided by an embodiment of the present disclosure;
[0033] Figure 8 A schematic diagram of the structure of a device provided by an embodiment of the present disclosure. Detailed implementation manners
[0034] The terms "first" and "second" in the embodiments of the present disclosure are only used for descriptive purposes, and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0035] In some scenarios, users can display text for information transmission. The text can directly and clearly express information. When the audience sees the text, they can directly understand the meaning of the text.
[0036] Generally, users can use electronic devices to display text. To display the text more beautifully and prominently, users can set the layout of the text. When there is a large amount of text to be displayed, users need to set the layout position for each piece of text and then display the text with the layout completed. In this way, users need to perform complex and heavy workload to set the layout position of the text.
[0037] In view of this, embodiments of the present disclosure provide a text display method, which can be executed by an electronic device. The electronic device includes, but is not limited to, a smart phone, a tablet computer, a laptop computer, a personal digital assistant (PDA), etc. Specifically, the method includes: the electronic device receives an input operation for an image, a plurality of texts, and the importance level corresponding to each text in the plurality of texts, adjusts the size of each text according to the importance level of each text, and sequentially determines the layout position of each text after size adjustment in the image according to the order of the importance level of each text, and displays each text after layout in the image.
[0038] This method can be applied to a display system. When this method is applied to the display system, it can be implemented in the form of a computer program. In some embodiments, the computer program can be independent. For example, it can be an independent application (such as an APP) with corresponding functions. In other embodiments, the computer program can be a functional module or a plug-in, etc., and runs attached to an existing APP.
[0039] In order to make the technical solution of the present disclosure clearer and easier to understand, the image display method provided by the embodiments of the present disclosure will be introduced below with reference to the accompanying drawings. As Figure 1 shown, this figure is a flowchart of a text display method provided by an embodiment of the present disclosure. The method includes:
[0040] S101. The electronic device receives an input operation for an image, a plurality of texts, and the importance level corresponding to each text in the plurality of texts.
[0041] In some embodiments, the electronic device can present an input interface to the user. As Figure 2A shown, this figure is a schematic diagram of an input interface provided by an embodiment of the present disclosure. The input interface includes: an image input area 210, a text input area 220, an importance level input area 230, and a submit control 240. Among them, the image input area 210 includes an upload control 211 and an image preview area 212; the text input area 220 includes a text input box 221, an add control 222, and a text preview area 223; the importance level input area 230 includes an importance level input box 231 and a text 232, and the text 232 can be the text previewed in the text preview area 223.
[0042] The user can click the upload control 211 to select an image from the local area for upload. After the upload is completed, the electronic device can display the uploaded image in the preview area 212 for the user to preview.
[0043] The user can type text in the input box 221, and then click the add control 222. After the electronic device receives the operation of the user clicking the add control 222, it can display the text typed by the user in the input box 221 in the text preview area 223 for the user to preview.
[0044] During the preview process, the user can configure the importance level of each text in the importance input area 230. In some examples, the value range of the importance level can be an integer from 1 to 10. For example, for text 1, the user can configure its importance level to 10, indicating that text 1 has the highest importance level; for text 2, the user can configure its importance level to 5, indicating that text 2 has a medium importance level; for text 3, the user can configure its importance level to 1, indicating that text 3 has the lowest importance level.
[0045] After the user completes the configuration of the importance level of each text, the user can click the submit control 240 to complete the input operations for the image, multiple texts, and the importance levels of multiple texts. It should be noted that the input operations can include a series of operations for inputting information about the image, text, and their importance levels, such as the operation of clicking the upload control 211 and the operation of clicking the submit control 240 as described above.
[0046] Of course, the above introduction of uploading an image through the upload control 211 is only exemplary. In some other embodiments, the electronic device can provide the user with multiple candidate images, such as Figure 2B shown, this figure is a schematic diagram of another input interface provided by an embodiment of the present disclosure. The input interface includes: an image candidate area 250, a text input area 260, an importance input area 270, and a submit control 280. Different from Figure 2A that, the image candidate area 250 includes multiple candidate images 241.
[0047] The user can click any one of the multiple candidate images 241 as the input image. When the selection is completed, the image selected by the user can be displayed in the front for subsequent configuration of the importance level.
[0048] Next, the user can complete the input of the text and its importance level. The specific process is similar to Figure 2A that, and will not be elaborated here.
[0049] S102. The electronic device adjusts the size of each text according to the importance level of each text.
[0050] The importance level is used to characterize the importance of the text. When the importance of the text is relatively high, its importance level is relatively high. The electronic device can adjust the size of each text based on the importance level of the text. For example, when the importance level of the text is relatively high, the electronic device can enlarge the size of the text, thereby making the space occupied by the text larger and easier to be noticed by the audience; when the importance level of the text is relatively low, the electronic device can reduce the size of the text, thereby making the space occupied by the text smaller and more difficult to be noticed by the audience. Among them, the size of the text can be characterized by the font size of the text. For example, enlarging the size of the text can be to increase the font of the text.
[0051] In some embodiments, the corresponding relationship between the importance level and the scaling ratio when adjusting the text can be preset in advance. Then, the electronic device obtains the scaling ratio based on this corresponding relationship and the importance level configured by the user for the text, and then uses this scaling ratio to adjust the size of the text. Continuing with the above example, the corresponding relationship can be as shown in Table 1.
[0052] Table 1:
[0053] Degree of importance Scaling ratio 10 2 9 1.8 … … 1 0.2
[0054] As shown in Table 1, when the importance level is 10, it indicates that the importance of this text is the highest, and the scaling ratio is 2, that is, the size of the original text is adjusted to 2 times the original; when the importance level is 1, it indicates that the importance of this text is the lowest, and the scaling ratio is 0.2, that is, the size of the original text is adjusted to 0.2 times the original.
[0055] After presetting the corresponding relationship as shown in Table 1, the electronic device can obtain the corresponding scaling ratio based on the importance level configured by the user for the text through the above Table 1, and then adjust the size of the text based on the obtained scaling ratio. For example, if the importance level input by the user for Text 1 is 10, the electronic device can obtain a scaling ratio of 2 through the corresponding relationship shown in the above Table 1, and then adjust the size of Text 1 to 2 times the original.
[0056] In some other embodiments, the electronic device can also adjust the size of each text based on the magnitude relationship between the importance level and the degree threshold. When the importance level of the text is greater than the degree threshold, the electronic device can enlarge the size of the text; when the importance level of the text is less than the degree threshold, the electronic device can reduce the size of the text; when the importance level of the text is equal to the degree threshold, the electronic device can not adjust the size of the text. For example, the degree threshold can be 5, and the importance level of the above Text 1 is greater than this degree threshold, and the electronic device can perform an enlargement process on Text 1.
[0057] It should be noted that in the above examples, the degree threshold is a specific value. In some other examples, the above degree threshold can also be a value within an interval. For example, the interval can be 4 - 6.
[0058] S103. The electronic device sequentially determines the layout positions of each text after size adjustment in the image according to the order of the importance level of each text.
[0059] In some examples, the electronic device can first determine the layout position of the text with the highest importance level, and then sequentially determine the layout positions of each text after size adjustment based on the order of the importance level. Among them, the distance from the layout position of each text to the center of the image is negatively correlated with the importance level, that is, the higher the importance level of the text, the smaller the distance between the text and the center of the image. For example, when the electronic device places the text with the highest importance level, it can place the text at the center of the image. When placing the text with the lowest importance level, it can place the text at the edge of the image.
[0060] In some embodiments, the electronic device can sequentially determine the layout positions of each text after size adjustment in the image according to the order of the importance level of each text and a first locus line with the center of the image as the origin. As Figure 3 shown, this figure is a locus line provided by an embodiment of the present disclosure with the center of the image as the origin. Among them, the electronic device can first determine the center O1 of the image 310, and then generate a first locus line 320 with the center O1 as the origin. The first locus line 320 can be a spiral locus line. The spiral locus line extends outward in a spiral manner from the origin. There are multiple layout positions in the area of the spiral locus line within the image for laying out the text. Of course, in some other examples, the first locus line can also be a rectangular locus line. Compared with the rectangular locus line, the spiral locus line can make the text placement more uniform, thus making the final display effect more beautiful.
[0061] After determining the first locus line, the electronic device can sequentially determine the layout positions of each text after size adjustment on the first locus line in the image according to the order of the importance level of each text. In some embodiments, the distance from the layout position of each text along the first locus line to the center of the image is negatively correlated with the importance level of the text, that is, the higher the importance level of the text, the shorter the distance along the first locus line to the center of the image. For example, the layout position of the text with the highest importance level can be the center of the image.
[0062] Of course, in some other examples, it can also be to first arrange the text with a higher importance level, and then layout the text with a lower importance level. At this time, the text with a lower importance level can be filled between the text with a higher importance level.
[0063] For the sake of easy understanding, the following uses Figure 3 For a detailed introduction, Figure 3 The image 310 shown includes a connected component. Among multiple texts, there are at least a first text and a second text with different degrees of importance, and the degree of importance of the first text is higher than that of the second text. The electronic device can first determine the first position of the first text on the first trajectory line 320 in the image 310, such as the center O1 of the image (i.e., the origin of the first trajectory line 320), and then determine the next trajectory point 302 of the origin of the first trajectory line 320, and use this trajectory point 302 as the second position on the first trajectory line 320 in the image 310. Then, the electronic device can obtain a first overlapping result between the first text and the second text based on the adjusted size of the first text, the first position, the adjusted size of the second text, and the second position.
[0064] In some examples, the electronic device can treat each text as a rectangle for processing to improve processing efficiency. For example, a rectangular coordinate system can be established with the first position. When the sum of the widths of the first text and the second text is greater than twice the horizontal distance from the second position to the first position, and the sum of the heights of the first text and the second text is greater than twice the vertical distance from the second position to the first position, a first overlapping result indicating that the first text and the second text overlap is obtained; otherwise, a first overlapping result indicating that the first text and the second text do not overlap is obtained.
[0065] It should be noted that the above are only some examples of the implementation methods for determining whether the first text and the second text overlap. Those skilled in the art can select other methods according to actual needs to determine whether the first text and the second text overlap, and then obtain the first overlapping result.
[0066] In the case where the obtained overlapping result indicates that the first text and the second text do not overlap, the electronic device can determine the second position as the layout position of the second text on the first trajectory line in the image.
[0067] In the case where the obtained first overlapping result indicates that the first text and the second text overlap, the electronic device can rotate the second text, as Figure 4 shown, and then re-determine a second overlapping result between the first text and the rotated second text (the process of determining whether they overlap refers to the above embodiments); if the second overlapping result indicates that the first text and the rotated second text do not overlap, determine the second position as the layout position of the rotated second text in the image. The electronic device can place the rotated second text at the above second position.
[0068] In some embodiments, after rotating the second text multiple times, such as rotating the second text more than 360 degrees, the second text after each rotation overlaps with the first text. That is, if the second overlap result indicates that the first text overlaps with the rotated second text, then determine a third position on the first trajectory line in the image, such as Figure 3 the locus point 303 on the first trajectory line 310 of the image 320 shown in. Then, the electronic device can use the third position to replace the second position, and re-determine the first overlap result and the second overlap result between the first text and the second text. Until the re-determined first overlap result indicates that the first text does not overlap with the second text, the replaced position is used as the layout position of the second text; or the re-determined second overlap result indicates that the first text does not overlap with the rotated second text, the replaced position is used as the layout position of the rotated second text.
[0069] For example, after using the above third position to replace the second position for judgment, when the first overlap result that the first text does not overlap with the second text is obtained, the third position is used as the layout position of the second text; if the first overlap result that the first text overlaps with the second text is obtained, the second text is rotated, and then the first text, the rotated second text, the first position, and the third position are used to re-determine the second overlap result between the first text and the rotated second text. If the re-determined second overlap result indicates that the first text overlaps with the rotated second text, and the second text is rotated multiple times and exceeds 360 degrees, then select the next locus point on the first trajectory line to judge the overlap result, and so on, until the re-determined first overlap result indicates that the first text does not overlap with the second text, or the re-determined second overlap result indicates that the first text does not overlap with the rotated second text. When the re-determined first overlap result indicates that the first text does not overlap with the second text, the replaced position is used as the layout position of the second text; when the re-determined second overlap result indicates that the first text does not overlap with the rotated second text, the replaced position is used as the layout position of the rotated second text.
[0070] It should be noted that during the process of judging whether there is an overlap after rotating the text, the text can be regarded as a rectangle, and then it is judged whether there is the same element in the rectangles corresponding to the two texts. If so, it means that the two texts overlap, otherwise they do not overlap. The above method is only an example, and those skilled in the art can choose other methods for judgment based on actual needs.
[0071] Continuing with the above embodiment, after the electronic device places the second text at the third position and there is no text placed at the second position, when the electronic device places subsequent text (such as text 3), it will obtain the overlapping result of text 3 and the first text based on the second position, the adjusted size of text 3, the first position, and the adjusted size of the first text. Then, based on the second position, the adjusted size of text 3, the third position, and the adjusted size of the second text, it will obtain the overlapping result of text 3 and the second text. When the overlapping result of text 3 and the first text indicates that text 3 does not overlap with the first text, and the overlapping result of text 3 and the second text indicates that text 3 does not overlap with the second text, then the second position is used as the layout position of text 3. This can make the text on the trajectory line more compact and have a better visualization effect.
[0072] In the above embodiment, the image introduced only includes 1 connected component. In other embodiments, the image may further include multiple connected components, such as at least two connected components: a first connected component and a second connected component. The electronic device determines the layout position of each text with adjusted size in the image in sequence according to the order of the importance of each text, a second trajectory line with the center of the first connected component as the origin, and a third trajectory line with the center of the second connected component as the origin.
[0073] For ease of understanding, below, taking the image including three connected components as an example, as Figure 5 shown, this figure is a multi-connected-component image provided by an embodiment of the present disclosure. This image includes a first connected component 510, a second connected component 520, and a third connected component 530. After the electronic device determines each connected component, it can determine the area of each connected component (for example, it can be characterized by relative area), and then based on the area of each connected component, determine the number of texts allocated to them. Taking Figure 5 as an example, for example, the number of texts is 50, and the area ratio among the first connected component 510, the second connected component 520, and the third connected component 530 is [1:1:1]. The electronic device can allocate 17 texts to the first connected component 510, 17 texts to the second connected component 520, and 16 texts to the third connected component 530.
[0074] In some examples, the electronic device may allocate text to each connected region based on the order of the importance of the text. For example, allocate the text with the first importance to the first connected region 510, the text with the second importance to the second connected region 520, the text with the third importance to the third connected region 530, the text with the fourth importance to the first connected region 510... and the text with the fiftieth importance to the second connected region 520. Among them, the difference in the average importance of the text in each connected region is less than a preset threshold, so that the distribution of the importance of the text in each connected region is similar, avoiding the situation where the size of the text in one connected region is too large and the size of the text in the remaining connected regions is too small, and enabling the display effect after layout to be more beautiful.
[0075] After the electronic device completes the allocation, the electronic device may layout the text in each connected region according to the solution in the above embodiment. Continuing with the above example, the first connected region 510 includes 17 texts, the second connected region 520 includes 17 texts, and the third connected region includes 16 texts. For the sake of easy understanding, take the third text and the fourth text with different importance levels in the first connected region 510, and the fifth text and the sixth text with different importance levels in the second connected region 520 as examples. Among them, the importance level of the third text is higher than that of the fourth text, and the importance level of the fifth text is higher than that of the sixth text.
[0076] For the first connected region 510, the electronic device determines the fourth position of the third text in the first connected region (such as the center of the first connected region 510), and the fifth position 542 on the second trajectory line 540 in the first connected region 510. According to the adjusted size of the third text, the fourth position, the adjusted size of the fourth text, and the fifth position, the third overlapping result of the third text and the fourth text is obtained; if the third overlapping result indicates that the third text and the fourth text do not overlap, then the fifth position is determined as the layout position of the fourth text in the first connected region. If the third overlapping result indicates that the third text and the fourth text overlap, the specific process of subsequent processing is similar to the above embodiment and will not be elaborated here.
[0077] For the second connected region 520, the electronic device determines the sixth position of the fifth text in the second connected region (such as the center of the second connected region 520), and the seventh position 552 on the third trajectory line 550 in the second connected region 520. According to the adjusted size of the fifth text, the sixth position, the adjusted size of the sixth text, and the seventh position, the fourth overlapping result of the fifth text and the sixth text is obtained; if the fourth overlapping result indicates that the fifth text and the sixth text do not overlap, then the seventh position is determined as the layout position of the sixth text in the second connected region. If the fourth overlapping result indicates that the fifth text and the sixth text overlap, the specific process of subsequent processing is similar to the above embodiment and will not be elaborated here.
[0078] For the third connected region 530, similar to the above-mentioned first connected region 510 and second connected region 520, details are not described herein again.
[0079] Next, the electronic device can determine the layout position of each image, and then place each image at its corresponding layout position to complete the layout of each image.
[0080] S104. The electronic device displays each text after the layout is completed in the image.
[0081] As Figure 6A shown, this figure is a schematic diagram of a word cloud provided by an embodiment of the present disclosure. It can be seen from the figure that the importance level of "AA" 601 is the highest, and the space it occupies is the largest; the importance level of "BB" 602 is the second, and the space it occupies is the second; the importance level of "CC" 603 is the third, and the space it occupies is the third. It should be noted that the above "AA", "BB", and "CC" are only examples.
[0082] It should be noted that the trajectory line is used for the electronic device to determine the layout position of each text. After the placement of each text is completed, the trajectory line may not be displayed during subsequent display.
[0083] In some embodiments, the electronic device can also detect the position of the cursor. When the cursor hovers over the target text, the target text is magnified. As Figure 6B shown, this figure is a schematic diagram of interacting with a word cloud provided by an embodiment of the present disclosure. Among them, "AA" 601 may be the target text. When the user controls the cursor to hover over the target text, the electronic device can magnify the target text to provide more details to the user. Further, while magnifying the target text, the electronic device can also display relevant information of the target text, such as its attribute information, etc. Among them, the attribute information includes, but is not limited to, the jump link and introduction information of the target text.
[0084] Based on the above description, embodiments of the present disclosure provide a text display method, apparatus, device, medium and product. The method includes: receiving an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts; adjusting the size of each text according to the importance level of each text; determining, in sequence according to the order of the importance level of each text, the layout position of each text after size adjustment in the image; and displaying each text after layout in the image. This method can automatically arrange texts at specified positions in an image based on the importance level of the texts, thereby beautifully displaying the texts to the user. For the user, the user only needs to provide the texts, their importance levels, and the image to be filled, without subsequent manual operations, reducing the user's operations and improving the user experience.
[0085] Figure 7 is a schematic diagram of a text display apparatus shown according to an exemplary embodiment of the disclosure, as Figure 7 shown, the text display apparatus 700 includes:
[0086] A receiving module 701, configured to receive an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts;
[0087] An adjustment module 702, configured to adjust the size of each text according to the importance level of each text;
[0088] A determination module 703, configured to determine, in sequence according to the order of the importance level of each text, the layout position of each text after size adjustment in the image;
[0089] A display module 704, configured to display each text after layout in the image.
[0090] Optionally, the distance from the layout position to the center of the image is negatively correlated with the importance level.
[0091] Optionally, the determination module 703 is specifically configured to determine, in sequence according to the order of the importance level of each text and a first locus line with the center of the image as the origin, the layout position of each text after size adjustment in the image.
[0092] Optionally, at least the first text and the second text with different importance levels are included in the multiple texts, and the importance level of the first text is higher than that of the second text; the determining module 703 is specifically configured to determine a first position of the first text in the image and a second position on the first trajectory line in the image; obtain a first overlapping result between the first text and the second text according to the adjusted size of the first text, the first position, the adjusted size of the second text, and the second position; if the first overlapping result indicates that the first text and the second text do not overlap, determine the second position as the layout position of the second text in the image.
[0093] Optionally, the determining module 703 is further configured to rotate the second text if the first overlapping result indicates that the first text and the second text overlap; re-determine a second overlapping result between the first text and the rotated second text; if the second overlapping result indicates that the first text and the rotated second text do not overlap, determine the second position as the layout position of the rotated second text in the image.
[0094] Optionally, the determining module 703 is further configured to determine a third position on the first trajectory line in the image if the second overlapping result indicates that the first text and the rotated second text overlap and the second text rotates more than 360 degrees; use the third position to replace the second position, and re-determine the first overlapping result and the second overlapping result between the first text and the second text until the re-determined first overlapping result indicates that the first text and the second text do not overlap, then use the replaced position as the layout position of the second text; or if the re-determined second overlapping result indicates that the first text and the rotated second text do not overlap, use the replaced position as the layout position of the rotated second text.
[0095] Optionally, the image at least includes two connected components: a first connected component and a second connected component; the determining module 703 is specifically configured to sequentially determine the layout position of each text with adjusted size in the image according to the order of the importance level of each text, the second trajectory line with the center of the first connected component as the origin, and the third trajectory line with the center of the second connected component as the origin.
[0096] Optionally, the first connected region at least includes a third text and a fourth text with different degrees of importance, and the degree of importance of the third text is higher than that of the fourth text; the second connected region at least includes a fifth text and a sixth text with different degrees of importance, and the degree of importance of the fifth text is higher than that of the sixth text; the determining module 703 is specifically configured to determine a fourth position of the third text in the first connected region and a fifth position on the second locus line in the first connected region; obtain a third overlapping result between the third text and the fourth text according to the adjusted size of the third text, the fourth position, the adjusted size of the fourth text, and the fifth position; if the third overlapping result indicates that the third text and the fourth text do not overlap, determine the fifth position as the layout position of the fourth text in the first connected region; and determine a sixth position of the fifth text in the second connected region and a seventh position on the third locus line in the second connected region; obtain a fourth overlapping result between the fifth text and the sixth text according to the adjusted size of the fifth text, the sixth position, the adjusted size of the sixth text, and the seventh position; if the fourth overlapping result indicates that the fifth text and the sixth text do not overlap, determine the seventh position as the layout position of the sixth text in the second connected region.
[0097] Optionally, the number of texts in each connected region in the image is positively correlated with the area of each connected region; the difference between the average degrees of importance of the texts in each connected region is less than a preset threshold.
[0098] Optionally, the display module 704 is further configured to enlarge the target text when the cursor hovers over the target text.
[0099] Optionally, the size of each text is positively correlated with the degree of importance of each text.
[0100] The functions of the above-mentioned modules have been elaborated in detail in the method steps of the previous embodiment, and will not be repeated here.
[0101] Next, refer to Figure 8 , which shows a schematic structural diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. The electronic device is used to implement the functions corresponding to the text display device 700 as shown in Figure 7 . Figure 8 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0102] As shown in Figure 8As shown, the electronic device 800 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 801, which may perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 802 or the programs loaded from the storage device 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0103] Generally, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 8 the electronic device 800 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0104] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above functions defined in the methods of the embodiments of the present disclosure are executed.
[0105] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0106] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (for example, a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0107] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately without being assembled into the electronic device.
[0108] The above computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receive an input operation for an image, a plurality of texts, and the importance level corresponding to each text in the plurality of texts; adjust the size of each text according to the importance level of each text; sequentially determine the layout positions of each text after size adjustment in the image in the order of the importance level of each text; and display each text after layout in the image.
[0109] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by connecting through the Internet using an Internet service provider).
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0111] The modules described in the embodiments of the present disclosure may be implemented in software or in hardware. Among them, the name of the module does not, in some cases, constitute a limitation on the module itself. For example, the first acquisition module may also be described as "the module for acquiring at least two Internet protocol addresses".
[0112] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0113] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM or Flash Memory), an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0114] According to one or more embodiments of the present disclosure, Example 1 provides a text display method that receives an input operation for an image, a plurality of texts, and the importance level corresponding to each text in the plurality of texts; adjusts the size of each text according to the importance level of each text; sequentially determines the layout position of each text after size adjustment in the image according to the order of the importance level of each text; and displays each text after layout in the image.
[0115] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the distance from the layout position to the center of the image is negatively correlated with the importance level.
[0116] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein sequentially determining the layout position of each text after size adjustment in the image according to the order of the importance level of each text includes: sequentially determining the layout position of each text after size adjustment in the image according to the order of the importance level of each text and a first locus line with the center of the image as the origin.
[0117] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3. The plurality of texts includes at least a first text and a second text with different importance levels, and the importance level of the first text is higher than that of the second text. Determining the layout position of each text after size adjustment in the image in sequence according to the order of the importance level of each text and a first locus line with the center of the image as the origin includes: determining a first position of the first text in the image and a second position on the first locus line in the image; obtaining a first overlapping result of the first text and the second text according to the adjusted size of the first text, the first position, the adjusted size of the second text, and the second position; if the first overlapping result indicates that the first text and the second text do not overlap, determining the second position as the layout position of the second text in the image.
[0118] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4. The method further includes: if the first overlapping result indicates that the first text and the second text overlap, rotating the second text; re-determining a second overlapping result of the first text and the rotated second text; if the second overlapping result indicates that the first text and the rotated second text do not overlap, determining the second position as the layout position of the rotated second text in the image.
[0119] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5. The method further includes:
[0120] if the second overlapping result indicates that the first text and the rotated second text overlap and the second text rotates more than 360 degrees, determining a third position on the first locus line in the image;
[0121] replacing the second position with the third position, re-determining the first overlapping result and the second overlapping result of the first text and the second text until the re-determined first overlapping result indicates that the first text and the second text do not overlap, and then taking the replaced position as the layout position of the second text; or the re-determined second overlapping result indicates that the first text and the rotated second text do not overlap, and then taking the replaced position as the layout position of the rotated second text.
[0122] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 1. The image includes at least two connected domains: a first connected domain and a second connected domain. Determining the layout position of each text after size adjustment in the image in sequence according to the order of the importance level of each text includes:
[0123] In the order of the importance level of each text, a second locus line with the center of the first connected region as the origin, and a third locus line with the center of the second connected region as the origin are used to sequentially determine the layout positions of each text after size adjustment in the image.
[0124] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 7. At least a third text and a fourth text with different importance levels are included in the first connected region, and the importance level of the third text is higher than that of the fourth text; at least a fifth text and a sixth text with different importance levels are included in the second connected region, and the importance level of the fifth text is higher than that of the sixth text; in the order of the importance level of each text, a second locus line with the center of the first connected region as the origin, and a third locus line with the center of the second connected region as the origin are used to sequentially determine the layout positions of each text after size adjustment in the image, including:
[0125] Determine a fourth position of the third text in the first connected region, and a fifth position on the second locus line in the first connected region;
[0126] According to the adjusted size of the third text, the fourth position, the adjusted size of the fourth text, and the fifth position, obtain a third overlap result between the third text and the fourth text;
[0127] If the third overlap result indicates that the third text and the fourth text do not overlap, then determine the fifth position as the layout position of the fourth text in the first connected region; and,
[0128] Determine a sixth position of the fifth text in the second connected region, and a seventh position on the third locus line in the second connected region;
[0129] According to the adjusted size of the fifth text, the sixth position, the adjusted size of the sixth text, and the seventh position, obtain a fourth overlap result between the fifth text and the sixth text;
[0130] If the fourth overlap result indicates that the fifth text and the sixth text do not overlap, then determine the seventh position as the layout position of the sixth text in the second connected region.
[0131] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 7. The number of texts in each connected region in the image is positively correlated with the area of each connected region; the difference between the average importance levels of the texts in each connected region is less than a preset threshold.
[0132] According to one or more embodiments of the present disclosure, Example 10 provides the method of Examples 1-9. After each text shown in the image is laid out, the method further includes:
[0133] When the cursor hovers over the target text, magnify the target text.
[0134] According to one or more embodiments of the present disclosure, Example 11 provides the method of Example 1, and the size of each text is positively correlated with the importance level of each text.
[0135] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solution formed by the specific combination of the above technical features. At the same time, it should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, a technical solution formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.
[0136] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0137] Although the subject matter has been described in language specific to structural features and / or methodological act logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
Claims
1. A text display method, characterized in that, Including: Receiving an input operation for an image, a plurality of texts, and the importance level corresponding to each text in the plurality of texts; Adjusting the size of each text according to the importance level of each text; Sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text; Displaying each text after completing the layout in the image; The image includes at least two connected regions: a first connected region and a second connected region; the sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text includes: Sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text, a second trajectory line with the center of the first connected region as the origin, and a third trajectory line with the center of the second connected region as the origin; The number of texts in each connected region in the image is positively correlated with the area of each connected region; the difference between the average values of the importance levels of the texts in each connected region is less than a preset threshold.
2. The method according to claim 1, characterized in that, The distance from the layout position to the center of the image is negatively correlated with the importance level.
3. The method according to claim 1, wherein The sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text includes: Sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text and a first trajectory line with the center of the image as the origin.
4. The method according to claim 3, wherein At least the first text and the second text with different importance levels are included in the plurality of texts, and the importance level of the first text is higher than that of the second text; the sequentially determining the layout position of each text with adjusted size in the image according to the order of the importance level of each text and a first trajectory line with the center of the image as the origin includes: Determining a first position of the first text in the image and a second position on the first trajectory line in the image; Obtaining a first overlapping result between the first text and the second text according to the adjusted size of the first text, the first position, the adjusted size of the second text, and the second position; If the first overlapping result indicates that the first text and the second text do not overlap, determining the second position as the layout position of the second text in the image.
5. The method according to claim 4, wherein The method further includes: If the first overlapping result indicates that the first text and the second text overlap, rotating the second text; Redetermining a second overlapping result between the first text and the rotated second text; If the second overlapping result indicates that the first text and the rotated second text do not overlap, determining the second position as the layout position of the rotated second text in the image.
6. The method according to claim 5, characterized in that The method further includes: If the second overlapping result indicates that the first text and the rotated second text overlap and the second text rotates more than 360 degrees, determining a third position on the first trajectory line in the image; Replace the second position with the third position, and re-determine the first overlap result and the second overlap result between the first text and the second text until the re-determined first overlap result indicates that the first text and the second text do not overlap, then use the replaced position as the layout position of the second text; or if the re-determined second overlap result indicates that the first text and the rotated second text do not overlap, then use the replaced position as the layout position of the rotated second text.
7. The method according to claim 1, wherein The first connected region at least includes a third text and a fourth text with different importance levels, and the importance level of the third text is higher than that of the fourth text; the second connected region at least includes a fifth text and a sixth text with different importance levels, and the importance level of the fifth text is higher than that of the sixth text; according to the order of the importance level of each text, the second locus line with the center of the first connected region as the origin, and the third locus line with the center of the second connected region as the origin, sequentially determine the layout positions of each text after adjusting the size in the image, including: Determine the fourth position of the third text in the first connected region, and the fifth position on the second locus line in the first connected region; According to the adjusted size of the third text, the fourth position, the adjusted size of the fourth text, and the fifth position, obtain the third overlap result between the third text and the fourth text; If the third overlap result indicates that the third text and the fourth text do not overlap, then determine the fifth position as the layout position of the fourth text in the first connected region; and, Determine the sixth position of the fifth text in the second connected region, and the seventh position on the third locus line in the second connected region; According to the adjusted size of the fifth text, the sixth position, the adjusted size of the sixth text, and the seventh position, obtain the fourth overlap result between the fifth text and the sixth text; If the fourth overlap result indicates that the fifth text and the sixth text do not overlap, then determine the seventh position as the layout position of the sixth text in the second connected region.
8. The method according to any one of claims 1-7, characterized in that, After displaying each text after completing the layout in the image, the method further includes: When the cursor hovers over the target text, enlarge the target text.
9. The method according to claim 1, wherein The size of each text is positively correlated with the importance level of each text.
10. A text display device, characterized in that, Including: A receiving module for receiving an input operation for an image, a plurality of texts, and the corresponding importance level of each text in the plurality of texts; An adjustment module for adjusting the size of each text according to the importance level of each text; A determination module for sequentially determining the layout positions of each text after adjusting the size in the image according to the order of the importance level of each text; A display module for displaying each text after completing the layout in the image; The image includes at least two connected components: a first connected component and a second connected component; the determining module is specifically configured to sequentially determine the layout positions of each text after size adjustment in the image according to the order of the importance levels of each text, a second trajectory line with the center of the first connected component as the origin, and a third trajectory line with the center of the second connected component as the origin; The number of texts in each connected component in the image is positively correlated with the area of each connected component; the difference between the average values of the importance levels of the texts in each connected component is less than a preset threshold.
11. An electronic device, characterized in that, Comprising: A storage device on which a computer program is stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product, characterized in that, When the computer program product runs on a computer, the computer is caused to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Word cloud diagram visualizing method based on occupation matrix
CN103778213A
Word cloud picture display method and device, equipment and medium
CN114416945A