CN112825079A - Information display method and device - Google Patents

Information display method and device Download PDF

Info

Publication number
CN112825079A
CN112825079A CN201911142479.1A CN201911142479A CN112825079A CN 112825079 A CN112825079 A CN 112825079A CN 201911142479 A CN201911142479 A CN 201911142479A CN 112825079 A CN112825079 A CN 112825079A
Authority
CN
China
Prior art keywords
character
size
image
characters
text
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.)
Granted
Application number
CN201911142479.1A
Other languages
Chinese (zh)
Other versions
CN112825079B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911142479.1A priority Critical patent/CN112825079B/en
Publication of CN112825079A publication Critical patent/CN112825079A/en
Application granted granted Critical
Publication of CN112825079B publication Critical patent/CN112825079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/44Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention discloses an information display method and device, and relates to the technical field of computers. One embodiment of the method comprises: displaying the target text by utilizing the first character component, and determining the size of characters in the target text; a second character assembly is nested in the first character assembly and used for displaying a first preset character with the same size as the character in the target text; acquiring an image to be displayed and determining the size of the image; calculating the number of first preset characters to be displayed in the second character assembly according to the size of the image and the size of the characters in the target text, and filling the number of first preset characters into the second character assembly; and arranging the image in the second character component so that the image covers the first preset character. The implementation mode realizes the display effect that the starting positions of the characters of the other lines except the first line in the target text are consistent with the starting position of the picture in the first line, thereby improving the information display effect.

Description

Information display method and device
Technical Field
The invention relates to the technical field of computers, in particular to an information display method and device.
Background
When the e-commerce platform displays a product, the e-commerce platform generally displays product information in a mode of combining pictures and characters, for example, a product title bar displays a product title in a mode of combining pictures and characters.
When product information is displayed, the text information usually has multiple lines, and the picture is located at the forefront of the first line of text. When product information is displayed, the initial positions of the characters in the other lines except the first line are generally required to be consistent with the initial position of the picture in the first line, as shown in fig. 1, the initial position of the character in the second line is required to be consistent with the initial position of the picture in the first line, in fig. 1, X represents information displayed by the picture, and Y represents information displayed by the characters.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
in the existing realnative development, a text component for displaying text information cannot be nested with other types of components (such as a picture component), and if the text component is nested with the picture component, the realnative can give corresponding error report without nesting development, and the starting positions of the texts in the lines except the first line cannot be kept consistent with the starting position of the picture in the first line, so that the information display effect is reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide an information displaying method and apparatus, so that when displaying information in which a picture and characters are combined, it is ensured that starting positions of characters in other lines except for a first line are consistent with a starting position of a picture in the first line, an information displaying effect is improved, a user can conveniently view information, and further, improvement of user viscosity is facilitated.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of information presentation.
The information display method of the embodiment of the invention comprises the following steps:
displaying a target text by utilizing a first character component, and determining the size of characters in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text;
acquiring an image to be displayed and determining the size of the image;
calculating the number of first preset characters to be displayed in the second character component according to the size of the image and the size of the characters in the target text, and filling the number of the first preset characters into the second character component to enable the size of the second character component to be matched with the size of the image;
and setting the image in the second text component so that the image covers the first preset character in the second text component.
Alternatively,
the determining the size of the characters in the target text comprises:
and acquiring the width and/or height of a third character assembly to determine the size of the characters in the target text, wherein a second preset character with the same size as the characters in the target text is filled in the third character assembly.
Alternatively,
the information display method further comprises the following steps: and adjusting the size of the image according to the size of the characters in the target text, so that the size of the image after size adjustment is matched with the size of a second character assembly filled with the first preset characters.
Alternatively,
the disposing the image in the second text component comprises:
and setting the image in the second text component in an absolute layout mode.
Alternatively,
the first preset character and/or the second preset character are/is in a transparent color.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided an apparatus for displaying information.
The information display device of the embodiment of the invention comprises: the system comprises a first display module, an acquisition module, a processing module and a second display module; wherein the content of the first and second substances,
the first display module is used for displaying a target text by utilizing a first character component and determining the size of characters in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text;
the acquisition module is used for acquiring an image to be displayed and determining the size of the image;
the processing module is used for calculating the number of first preset characters to be displayed in the second character assembly according to the size of the image and the size of the characters in the target text, and filling the number of first preset characters into the second character assembly to enable the size of the second character assembly to be matched with the size of the image;
the second display module is configured to set the image in the second text component, so that the image covers the first preset character in the second text component.
Alternatively,
the processing module is used for acquiring the width and/or height of a third character component to determine the size of the characters in the target text, wherein the third character component is filled with a second preset character with the same size as the characters in the target text.
Alternatively,
the processing module is further used for adjusting the size of the image according to the size of the characters in the target text, so that the size of the image after size adjustment is matched with the size of the second character assembly filled with the first preset characters.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided an electronic device for displaying information.
An electronic device for displaying information according to an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the information presentation method of the embodiment of the invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of an embodiment of the present invention stores thereon a computer program, which when executed by a processor implements a method of information presentation of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps that a first word assembly can display a target text, a second word assembly can display first preset characters with the same size as characters in the target text, the number of the first preset characters displayed in the second word assembly is determined according to the size of an image to be displayed, the size of the second word assembly is matched with the image to be displayed, therefore, the image to be displayed occupies the first word assembly through the corresponding number of the first preset characters, then the image to be displayed is arranged in the second word assembly, the image covers the first preset characters in the second word assembly, and the image is displayed in the first word assembly due to the fact that the second word assembly is nested in the first word assembly. Therefore, the second character assembly is used for occupying the position of the image to be displayed in the first character assembly in the nesting mode of the first character assembly and the second character assembly, so that when the image to be displayed is displayed in the first character assembly, the starting positions of the characters of other lines except the first line in the target text can be kept consistent with the starting position of the image in the first line, the information display effect is improved, a user can conveniently check information, and the viscosity of the user can be improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a diagram illustrating effects of information presentation implemented according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main steps of a method of information presentation according to an embodiment of the invention;
FIG. 3 is a diagram illustrating a nested display of a first text element and a second text element, in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of the relative positions of a third text element and a second text element according to an embodiment of the invention;
FIG. 5 is a schematic diagram of another relative position of a third text element and a second text element according to an embodiment of the invention;
FIG. 6 is a schematic diagram of a third text element and a second text element in another relative position according to an embodiment of the invention;
FIG. 7 is a schematic diagram of a third text element and a second text element in still another relative position according to an embodiment of the invention;
FIG. 8 is a diagram illustrating a nested display of a third text element and a second text element, in accordance with an embodiment of the present invention;
FIG. 9 is a schematic diagram of the main modules of an apparatus for information presentation according to an embodiment of the present invention;
FIG. 10 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 11 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
Fig. 2 is a schematic diagram of the main steps of the information presentation method according to the embodiment of the present invention.
As shown in fig. 2, the method for displaying information according to the embodiment of the present invention mainly includes the following steps:
step S201: displaying a target text by utilizing a first character component, and determining the size of characters in the target text; and a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text.
The target text is displayed through the first character component, the target text can be the content such as a product title, and when the target text is displayed through the first character component, the display style of characters in the target text, such as fonts, word sizes, colors and the like, can be set in a user-defined mode.
The first character assembly is nested with a second character assembly, and the second character assembly can occupy the position of the picture to be displayed in the first assembly by displaying a first preset character with the same size as the character in the target text.
In order to ensure that the size of the first preset character displayed in the second text component is the same as the size of each character in the target text displayed by the first text component, the font and the font size of the first preset character can be set to be the same as the font and the font size of the character in the target text, and then the size of the second text component can be matched with the size of the image to be displayed by further setting the number of the first preset characters, so that the image to be displayed can be conveniently displayed in the first text component.
It can be understood that the second text element is nested in the first text element, and the second text element is located at the front end of the first text element, that is, the first preset character displayed by the second text element is located at the front end of the first row of the first text element.
Step S202: acquiring an image to be displayed, and determining the size of the image.
In the embodiment of the invention, the image to be displayed can be pre-downloaded by an image. The size of the directly acquired image may be too large to match the second text component, and therefore, in order to improve the information display effect, the size of the image may be adjusted according to the size of the first preset character which is the same as the size of the character in the target text.
It is understood that when displaying the image and the text information at the same time, a horizontal display mode as shown in fig. 1 may be adopted, in which the text is arranged in rows, or a vertical display mode, in which the text is arranged in columns. For convenience of description, the following embodiments take a lateral display manner as an example, and a size adjustment process of an image is explained in detail.
If the size of the image is too large, the height of the image may be greater than the height of one line of characters in the first character assembly, that is, the oversized image may occupy multiple lines of space of the first character assembly, which wastes display space due to the too large space occupied by the image on one hand, and on the other hand, the starting positions of the characters in the remaining lines except the first line in the target text and the starting position of the picture in the first line cannot be kept consistent, thereby reducing the information display effect.
To solve this problem, in one embodiment of the present invention, when the height imageHeight of the picture is greater than the height markviewheight of a line of text in the target text, the ratio of the height of the picture to the height of a line of text in the target text is calculated: and adjusting the height of the picture according to the calculated ratio scale, so that the height of the image is equal to or less than the height of a line of characters in the target text, and the image only occupies the space of the first line when being displayed on the first character component, thereby realizing the improvement of the display effect while saving the display space.
It can be understood that when the information is presented in a longitudinal manner, when the width of the image is greater than the width of a column of characters in the target text, the size of the image can be adjusted according to the size of the characters in the target text, so that the width of the image is equal to or less than the width of a row of characters in the target text.
It is worth mentioning that, in order to ensure the display effect of the image, the height and the width of the image can be compressed at the same time according to the calculated scale so as to maintain the aspect ratio of the image, thereby ensuring the display effect.
Step S203: and calculating the number of first preset characters to be displayed in the second character component according to the size of the image and the size of the characters in the target text, and filling the number of the first preset characters into the second character component, so that the size of the second character component is matched with the size of the image.
In an embodiment of the present invention, since the size of a single character in the first text component cannot be directly obtained, the size of the character in the target text may be determined by obtaining the width and/or height of a third text component filled with a second preset character having the same size as the character in the target text.
Since the third text element is filled with only one second preset character, the size of the second preset character is the same as the size of the character in the target text, and the size (height and/or width) of the third text element is determined by the size of the second preset character filled in the third text element, the size of the character in the target text can be determined by acquiring the size of the third text element. Specifically, since the size of the third text element is determined by the size, font thickness, etc. of the second preset character filled in the third text element, in order to ensure that the size of the second preset character is the same as the size of the character in the target text, the font and font size of the second preset character may be set to be the same as the font and font size of the character in the target text, and the second preset character may be "0" or any other preset character. Filling a second preset character with the same size as the character in the target text in the third text component, and then dynamically acquiring the height and the width of the second preset character in the third text component by an onLayout () method to determine the height and the width of one line of characters in the target text, wherein the height of one line of characters in the target text can be marked as markingViewheight, and the width of one character in the target text can be marked as preWidth. Therefore, the width and the height of the second preset character are dynamically acquired through the third character component, the problem that the same font and the same font size on different mobile devices correspond to different character sizes is solved, and the accuracy of the character size is improved.
When the information is displayed transversely, the number of the first preset characters to be displayed in the second character assembly is obtained by calculating the ratio imagewidth/preWidth of the width of the picture to the width of the characters in the target text according to the width imagewidth of the picture (if the size of the picture is adjusted, the width is the adjusted width), and then the corresponding number of the second preset characters are spliced into a character string by the method of (new Array (the number of the first preset characters)). join ('0'), and the character string is filled into the second file assembly.
Because the number of the first preset characters is positive, when the ratio imagewidth/preWidth of the width of the picture to the width of the characters in the target text is calculated, the value can be rounded upwards by adopting a Math. ceil () method so as to ensure that the width of the second character assembly filled with the corresponding number of the second preset characters is not less than the width of the picture, and therefore, enough display space is occupied for the picture to be displayed in the first character assembly through the second character assembly.
It can be understood that, when the information is displayed in the longitudinal mode, the number of the second preset characters to be displayed in the second text component can be calculated according to the ratio of the height of the image to the height of the second preset characters. In addition, the first preset characters may be the same or different, for example, in an embodiment of the present invention, the first preset character is set to "K", the second preset character is set to "L", the second text component is nested in the first text component, and when the second text component is filled with a corresponding number of first preset characters, a corresponding display effect is as shown in fig. 3, and in fig. 3, Y represents a character in the target text.
It is worth mentioning that the setting position of the third text element can be matched with the second text element, so that the third text element is overlapped with the second text element. For example, when the third text component is filled with a second predetermined character having the same size as the character in the target text, the second predetermined character overlaps with the first predetermined character in the second text component, as shown in fig. 4. In fig. 4, in order to distinguish the second text element from the third text element, the third text element is shifted upward relative to the second text element, which does not represent an actual display effect, and in the actual display effect, the second predetermined character "L" in the third text element overlaps with the first predetermined character "K" in the second text element, and the upper and lower edges of the third text element also overlap with the upper and lower edges of the second text element, respectively.
Of course, the third text element may also overlap other positions of the second element, that is, the second predetermined character in the third element may overlap other characters in the second element except the first predetermined character, as shown in fig. 5 and 6. Similar to fig. 4, in fig. 5 and 6, the third text element is offset upward relative to the second text element, which does not represent an actual display effect, but merely serves to distinguish the second text element from the third text element in the figures.
In addition, the third text component may not overlap with the second text component, as shown in fig. 7, the third text component is spliced at the tail of the second text component, at this time, a second preset character in the third text component overlaps with a first character in the target text, and in order to ensure the display effect of the information, the color of the second preset character needs to be set to be transparent, so that when the information is displayed, the user does not sense the second preset character, and the user can conveniently view the information.
In addition, the third text element may be nested in the second text element, when the third text element is nested in the second text element, since the third text element is filled with the second preset character, and the second preset character may also be an image placeholder, the number of the first preset characters filled in the second text element is the ratio imagewidth/preWidth of the width of the picture to the width of the character in the target text minus 1, and at this time, the display schematic diagram of the third text element and the second text element may be as shown in fig. 8. It is worth mentioning that when the third text element is not nested in the second text element, the third text element can be disposed in the first document element in an absolute layout manner to accurately position the third text element in the first text element.
It can be known from the above embodiment that the main function of the first preset character is to occupy the space of the image, the main function of the second preset character is to facilitate dynamic acquisition of the size of the character in the target text, and neither the first preset character nor the second preset character has an actual display effect, so that, in order to avoid the influence of the first preset character and the second preset character on the display effect of the image, the first preset character and/or the second preset character is a transparent color, and then when the information is displayed, the user cannot perceive the content of the first preset character and the second preset character, and the display effect of the image is not influenced.
Step S204: and setting the image in the second text component so that the image covers the first preset character in the second text component.
After the size of the second text component is set to be matched with the size of the image to be displayed (if the size of the image is adjusted, the image after the size is adjusted) it can be ensured that the second text component can be shielded by the image after the image is set to the first text component, that is, when the image is set to the first text component and the setting position of the image corresponds to the second text component, the image is overlapped with the second text component to shield the second text component and displayed in the first text component, the schematic diagram of the image displayed in the first text component can be as shown in fig. 1, wherein X represents the information displayed by the image, the image information can display the sales channel (self-service or global purchase, etc.) of the product, Y represents the information displayed by the text, and the text information can display the name of the product, etc. The first preset character in the second character assembly and the second preset character in the third character assembly are overlapped on the bottom layer of the displayed image, so that a user cannot perceive the first preset character and the second preset character, the display effect of information is improved, the display effect that the initial positions of the characters of the rest lines except the initial line in the target text are consistent with the initial position of the image in the initial line is achieved, and the display effect of information is improved.
In addition, in order to accurately position the position of the image in the second assembly, the image can be arranged in the second character assembly in an absolute layout mode, that is, the image to be displayed can be loaded through the image assembly, and then the image is arranged in the second character assembly in the absolute layout mode according to the calculated height and width of the image, so that the image and the characters can be displayed simultaneously, the starting positions of characters of other lines except the first line in the target text are ensured to be consistent with the starting position of the image in the first line, and the information display effect is improved.
The method for displaying information according to the embodiment of the present invention shows that, by nesting the second text component in the first text component, wherein the first text element can display the target text, the second text element can display a first preset character with the same size as the character in the target text, and the number of the first preset characters displayed in the second text component is determined according to the size of the image to be displayed, so that the size of the second text component is matched with the image to be displayed, so that the image to be displayed is occupied in the first text element by a corresponding number of first preset characters, then arranging the image to be displayed in a second text element so that the image covers the first preset character in the second text element, and the image is shown in the first text component because the second text component is nested in the first text component. Therefore, the second character assembly is used for occupying the position of the image to be displayed in the first character assembly in the nesting mode of the first character assembly and the second character assembly, so that when the image to be displayed is displayed in the first character assembly, the starting positions of the characters of other lines except the first line in the target text can be kept consistent with the starting position of the image in the first line, the information display effect is improved, a user can conveniently check information, and the viscosity of the user can be improved.
Fig. 9 is a schematic diagram of main blocks of an information presentation apparatus according to an embodiment of the present invention.
As shown in fig. 9, the apparatus 900 for displaying information according to the embodiment of the present invention includes: a first display module 901, an acquisition module 902, a processing module 903 and a second display module 904; wherein the content of the first and second substances,
the first display module 901 is configured to display a target text by using a first text component, and determine a size of a character in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text;
the obtaining module 902 is configured to obtain an image to be displayed and determine a size of the image;
the processing module 903 is configured to calculate the number of first preset characters to be displayed in the second text component according to the size of the image and the size of the characters in the target text, and fill the number of the first preset characters into the second text component, so that the size of the second text component matches the size of the image;
the second display module 904 is configured to set the image in the first text component, so that the image covers the first preset character in the second text component.
In an embodiment of the present invention, the processing module 903 is configured to obtain a width and/or a height of a third text element to determine a size of a character in the target text, where the third text element is filled with a second preset character having the same size as the character in the target text.
In an embodiment of the present invention, the processing module 903 is further configured to adjust a size of the image according to a size of a character in the target text, so that the size of the image after size adjustment matches a size of a second text component filled with the first preset character.
In an embodiment of the present invention, the second display module 904 is configured to arrange the image in the second text component in an absolute layout manner.
An apparatus for information presentation in accordance with an embodiment of the present invention may be seen in that, by nesting a second text element within a first text element, wherein the first text element can display the target text, the second text element can display a first preset character with the same size as the character in the target text, and the number of the first preset characters displayed in the second text component is determined according to the size of the image to be displayed, so that the size of the second text component is matched with the image to be displayed, so that the image to be displayed is occupied in the first text element by a corresponding number of first preset characters, then arranging the image to be displayed in a second text element so that the image covers the first preset character in the second text element, and the image is shown in the first text component because the second text component is nested in the first text component. Therefore, the second character assembly is used for occupying the position of the image to be displayed in the first character assembly in the nesting mode of the first character assembly and the second character assembly, so that when the image to be displayed is displayed in the first character assembly, the starting positions of the characters of other lines except the first line in the target text can be kept consistent with the starting position of the image in the first line, the information display effect is improved, a user can conveniently check information, and the viscosity of the user can be improved.
Fig. 10 shows an exemplary system architecture 1000 to which the method of information presentation or the apparatus of information presentation of embodiments of the present invention may be applied.
As shown in fig. 10, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. Network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 1001, 1002, 1003 to interact with a server 1005 via a network 1004 to receive or transmit messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 1001, 1002, and 1003.
The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1005 may be a server that provides various services, for example, a background management server that supports a shopping site browsed by a user using the terminal devices 1001, 1002, and 1003. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the method for displaying information provided by the embodiment of the present invention is generally executed by the server 1005, and accordingly, the apparatus for displaying information is generally disposed in the server 1005.
It should be understood that the number of terminal devices, networks, and servers in fig. 10 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 11, shown is a block diagram of a computer system 1100 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output portion 1107 including a signal output unit such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 1101.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a first presentation module, an acquisition module, a processing module, and a second presentation module. Where the names of these modules do not in some cases constitute a limitation of the module itself, for example, the first presentation module may also be described as a "module presenting a target text".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: displaying a target text by utilizing a first character component, and determining the size of characters in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text; acquiring an image to be displayed and determining the size of the image; calculating the number of first preset characters to be displayed in the second character component according to the size of the image and the size of the characters in the target text, and filling the number of the first preset characters into the second character component to enable the size of the second character component to be matched with the size of the image; and arranging the image in the first text component, wherein the position of the image corresponds to that of the second text component, so that the image is displayed in the first text component in a mode of being overlapped with the second text component.
According to the technical scheme of the embodiment of the invention, a second character assembly is nested in the first character assembly, wherein the first character assembly can display a target text, the second character assembly can display first preset characters with the same size as characters in the target text, and the number of the first preset characters displayed in the second character assembly is determined according to the size of an image to be displayed, so that the size of the second character assembly is matched with the image to be displayed, the image to be displayed is occupied in the first character assembly by the corresponding number of the first preset characters, then the image to be displayed is arranged in the first character assembly, the arrangement position of the image corresponds to the second character assembly, and the image is displayed in the first character assembly in a mode of being overlapped with the second character assembly. Therefore, the second character assembly is used for occupying the position of the image to be displayed in the first character assembly in the nesting mode of the first character assembly and the second character assembly, so that when the image to be displayed is displayed in the first character assembly, the starting positions of the characters of other lines except the first line in the target text can be kept consistent with the starting position of the image in the first line, the information display effect is improved, a user can conveniently check information, and the viscosity of the user can be improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of information presentation, comprising:
displaying a target text by utilizing a first character component, and determining the size of characters in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text;
acquiring an image to be displayed and determining the size of the image;
calculating the number of first preset characters to be displayed in the second character component according to the size of the image and the size of the characters in the target text, and filling the number of the first preset characters into the second character component to enable the size of the second character component to be matched with the size of the image;
and setting the image in the second text component so that the image covers the first preset character in the second text component.
2. The method of claim 1, wherein determining the size of the characters in the target text comprises:
and acquiring the width and/or height of a third character assembly to determine the size of the characters in the target text, wherein a second preset character with the same size as the characters in the target text is filled in the third character assembly.
3. The method of claim 1, further comprising:
and adjusting the size of the image according to the size of the characters in the target text, so that the size of the image after size adjustment is matched with the size of a second character assembly filled with the first preset characters.
4. The method of claim 1, wherein the disposing the image in the second text component comprises:
and setting the image in the second text component in an absolute layout mode.
5. The method of claim 2,
the first preset character and/or the second preset character are/is in a transparent color.
6. An apparatus for information presentation, comprising: the system comprises a first display module, an acquisition module, a processing module and a second display module; wherein the content of the first and second substances,
the first display module is used for displaying a target text by utilizing a first character component and determining the size of characters in the target text; a second word assembly is nested in the first word assembly and used for displaying a first preset character with the same size as the character in the target text;
the acquisition module is used for acquiring an image to be displayed and determining the size of the image;
the processing module is used for calculating the number of first preset characters to be displayed in the second character assembly according to the size of the image and the size of the characters in the target text, and filling the number of first preset characters into the second character assembly to enable the size of the second character assembly to be matched with the size of the image;
the second display module is configured to set the image in the second text component, so that the image covers the first preset character in the second text component.
7. The apparatus of claim 6,
the processing module is used for acquiring the width and/or height of a third character component to determine the size of the characters in the target text, wherein the third character component is filled with a second preset character with the same size as the characters in the target text.
8. The apparatus of claim 6,
the processing module is further used for adjusting the size of the image according to the size of the characters in the target text, so that the size of the image after size adjustment is matched with the size of the second character assembly filled with the first preset characters.
9. An electronic device for information presentation, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201911142479.1A 2019-11-20 2019-11-20 Information display method and device Active CN112825079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911142479.1A CN112825079B (en) 2019-11-20 2019-11-20 Information display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911142479.1A CN112825079B (en) 2019-11-20 2019-11-20 Information display method and device

Publications (2)

Publication Number Publication Date
CN112825079A true CN112825079A (en) 2021-05-21
CN112825079B CN112825079B (en) 2024-04-05

Family

ID=75906292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911142479.1A Active CN112825079B (en) 2019-11-20 2019-11-20 Information display method and device

Country Status (1)

Country Link
CN (1) CN112825079B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130195315A1 (en) * 2012-01-26 2013-08-01 Qualcomm Incorporated Identifying regions of text to merge in a natural image or video frame
CN104361312A (en) * 2014-10-16 2015-02-18 北京捷通华声语音技术有限公司 Device and method for optical character recognition of images
CN109640148A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 A kind of method and device by text box text exhibition content
CN109978972A (en) * 2019-03-20 2019-07-05 珠海天燕科技有限公司 A kind of method and device of copy editor in picture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130195315A1 (en) * 2012-01-26 2013-08-01 Qualcomm Incorporated Identifying regions of text to merge in a natural image or video frame
CN104361312A (en) * 2014-10-16 2015-02-18 北京捷通华声语音技术有限公司 Device and method for optical character recognition of images
CN109640148A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 A kind of method and device by text box text exhibition content
CN109978972A (en) * 2019-03-20 2019-07-05 珠海天燕科技有限公司 A kind of method and device of copy editor in picture

Also Published As

Publication number Publication date
CN112825079B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
US20140258849A1 (en) Automatic Alignment of a Multi-Dimensional Layout
CN103959281A (en) Method for associating third party content with online document signing
US20210090132A1 (en) Scalable Native In-Stream Advertising for Mobile Applications and Websites
US11062382B2 (en) Search machine with dynamically updated flag on graphical slider
US10628876B2 (en) Website shopping system and shopping method thereof
GB2547756A (en) Acquisition of a font portion using a compression mechanism
US20240143898A1 (en) Content typesetting method and apparatus, computer device, and storage medium
US10915236B2 (en) User interface design system
CN107330087B (en) Page file generation method and device
CN110941401A (en) Printing method and device
CN114756228A (en) Page processing method, device, equipment and storage medium
CN112825079B (en) Information display method and device
CN113282852A (en) Method and device for editing webpage
US20220326901A1 (en) Data display
US9767079B1 (en) Serving expandable content items
CN114611031A (en) Digital scrolling display method, device, equipment and medium
CN113705190A (en) Text processing method, device and equipment
CN107886350B (en) Method and device for analyzing data
CN112486783A (en) Progress bar display method and device
CN113284174A (en) Method and device for processing pictures
CN109710355B (en) WEB interaction-based TIP display content processing method and device and electronic equipment
CN112580314A (en) Method, device and equipment for processing words and computer readable medium
CN117032543A (en) Form adjusting method and device, storage medium and terminal equipment
CN113760149A (en) Page split screen system, method and device
CN114692035A (en) Data display method and device

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
GR01 Patent grant
GR01 Patent grant