CN112825079B - Information display method and device - Google Patents

Information display method and device Download PDF

Info

Publication number
CN112825079B
CN112825079B CN201911142479.1A CN201911142479A CN112825079B CN 112825079 B CN112825079 B CN 112825079B CN 201911142479 A CN201911142479 A CN 201911142479A CN 112825079 B CN112825079 B CN 112825079B
Authority
CN
China
Prior art keywords
size
component
text
character
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911142479.1A
Other languages
Chinese (zh)
Other versions
CN112825079A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention discloses a method and a device for information display, and relates to the technical field of computers. One embodiment of the method comprises the following steps: displaying the target text by using the first text component, and determining the size of characters in the target text; the first text component is nested with a second text component, and the second text component is 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 first preset characters into the second character component; the image is arranged in the second character component so that the image covers the first preset character. According to the method and the device for displaying the information, the display effect that the initial positions of the characters in the other rows except the first row in the target text are consistent with the initial positions of the pictures in the first row is achieved, and therefore the information display effect is improved.

Description

Information display method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for displaying information.
Background
When the electronic commerce platform displays the product, the product information is usually displayed in a mode of combining pictures and characters, for example, the product title is displayed in a product title column in a mode of combining pictures and characters.
When product information is displayed, the text information usually has a plurality of rows, and the picture is positioned at the forefront of the first row text. When product information is displayed, the starting positions of the characters in the other rows except the first row are generally required to be consistent with the starting positions of the pictures in the first row, as shown in fig. 1, the starting positions of the characters in the second row are required to be consistent with the starting positions of the pictures in the first row, in fig. 1, X represents information displayed by the pictures, and Y represents information displayed by the characters.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
in the existing reactivative development, a text component for displaying text information cannot be nested with other types of components (such as picture components), for example, the text component is nested with the picture components, so that the reactivative can give corresponding errors without nested development, the starting positions of other rows of text except for a first row cannot be ensured to be consistent with the starting positions of pictures in the first row, and the information display effect is reduced.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method and a device for displaying information, which can ensure that the initial positions of the characters in the other rows except the first row are consistent with the initial positions of the pictures in the first row when displaying the information combining the pictures and the characters, thereby improving the information display effect, facilitating the user to view the information and further being beneficial to improving the user viscosity.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a method for information presentation.
The information display method of the embodiment of the invention comprises the following steps:
displaying a target text by using a first text component, and determining the size of characters in the target text; a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as 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 text component 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 text component so that the size of the second text component is matched with the size of the image;
and setting the image in the second character component so that the image covers the first preset character in the second character component.
Alternatively, the process may be carried out in a single-stage,
the determining the size of the characters in the target text includes:
and acquiring the width and/or the height of a third text component to determine the size of the characters in the target text, wherein the third text component is filled with a second preset character with the same size as the characters in the target text.
Alternatively, the process may be carried out in a single-stage,
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 as to enable the size of the image with the adjusted size to be matched with the size of the second character component filled with the first preset characters.
Alternatively, the process may be carried out in a single-stage,
the setting the image in the second text component includes:
the image is arranged in the second text component in an absolute layout.
Alternatively, the process may be carried out in a single-stage,
the first preset character and/or the second preset character is transparent.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided an apparatus for information presentation.
The device for information display in 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 first display module is used for displaying a target text by utilizing a first text component and determining the size of characters in the target text; a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as 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 text component 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 text component so that the size of the second text component is 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 process may be carried out in a single-stage,
the processing module is configured to obtain a width and/or a height of a third text component to determine a size of a character in the target text, where the third text component is filled with a second preset character having a size identical to that of the character in the target text.
Alternatively, the process may be carried out in a single-stage,
the processing module is further configured to adjust the size of the image according to the size of the character in the target text, so that the size of the image after the size adjustment matches the size of the second text component filled with the first preset character.
In order to achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided an electronic device for information presentation.
The electronic equipment for information display in the embodiment of the invention comprises: one or more processors; and 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 are enabled to realize the information display method of the embodiment of the invention.
To achieve the above object, according to still another aspect of the 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 has stored 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 first text component can display a target text, the second text component can display first preset characters with the same character size as the target text, the number of the first preset characters displayed in the second text component is determined according to the size of an image to be displayed, the size of the second text component is matched with the image to be displayed, the image to be displayed occupies a position in the first text component through the corresponding number of the first preset characters, then the image to be displayed is arranged in the second text component, the image covers the first preset characters in the second text component, and the image is displayed in the first text component due to the fact that the second text component is nested in the first text component. Therefore, through the nesting mode of the first character component and the second character component, the second character component is utilized to occupy the space of the image to be displayed in the first character component, so that when the image to be displayed is displayed in the first character component, the starting positions of the characters except the first line in the target text can be ensured to be consistent with the starting positions of the images in the first line, the information display effect is improved, the user can conveniently check the information, and further the viscosity of the user can be improved.
Further effects of the above-described non-conventional alternatives are 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 schematic diagram of the effect 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 present invention;
FIG. 3 is a schematic diagram showing a first text component nested with a second text component according to an embodiment of the present invention;
FIG. 4 is a schematic diagram showing the relative positions of a third text component and a second text component according to an embodiment of the present invention;
FIG. 5 is a schematic diagram showing another relative positions of the third text component and the second text component according to an embodiment of the present invention;
FIG. 6 is a schematic diagram showing still another relative position of the third text component and the second text component according to an embodiment of the present invention;
FIG. 7 is a schematic diagram showing still another relative position of the third text component and the second text component according to an embodiment of the present invention;
FIG. 8 is a schematic diagram showing a third text component nested with a second text component according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of the main modules of an information presentation apparatus 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 applied;
fig. 11 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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 in the embodiments may be combined with each other without collision.
Fig. 2 is a schematic diagram of main steps of a method of information presentation according to an 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 using a first text component, and determining the size of characters in the target text; and a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as the target text.
The target text is displayed through the first text component, the target text can be content such as a product title, and when the target text is displayed by the first text component, the display style of characters in the target text, such as fonts, font sizes, colors and the like, can be set in a self-defined mode.
The first text component is nested with a second text component, and the second text component can occupy a place in the first component for a picture to be displayed by displaying a first preset character with the same character size as that 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 characters in the target text, and then the number of the first preset characters can be further set, so that the size of the second text component is matched with the size of the image to be displayed, and the display of the image to be displayed in the first text component is facilitated.
It can be understood that the second text component is nested in the first text component, and then the second text component is located at the front end of the first text component, that is, the first preset character displayed by the second text component is located at the forefront end of the first row of the first text component.
Step S202: and 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 through an image size () method, the width and the height of the image can be obtained, the width of the image can be recorded as imageWidth, and the height of the image can be recorded as imageHeight. The size of the directly acquired image may be too large to match the second text component, so 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 identical to the size of the character in the target text.
It will be appreciated that when displaying both the image and the text information, a lateral display mode as shown in fig. 1 may be used, in which the text is arranged in rows, or a longitudinal 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 describe in detail the size adjustment process of an image.
If the size of the image is too large, the height of the image may be larger than the height of one line of characters in the first character component, that is, the image with the too large size may occupy multiple lines of spaces of the first character component, which wastes display space due to the too large space occupied by the image, and on the other hand, the starting positions of the characters in the other lines except the first line in the target text and the starting positions of the pictures in the first line cannot be kept consistent, so that the information display effect is reduced.
To solve this problem, in one embodiment of the present invention, when the height imageHeight of the picture is greater than the height markingview height of one line of text in the target text, the ratio of the height of the picture to the height of one line of text in the target text is calculated: scale=imageheight/markingview height, and according to the calculated proportion scale, the height of the picture is adjusted, so that the height of the image is equal to or smaller than the height of one line of characters in the target text, and when the image is displayed on the first character component, only the first line of space is occupied, thereby realizing that the display effect is improved while the display space is saved.
It can be appreciated that when the information is presented in a portrait manner, when the width of the image is greater than the width of a column of text in the target text, the size of the image may be adjusted according to the size of the characters in the target text such that the width of the image is equal to or less than the width of a row of text in the target text.
It should be noted that, in order to ensure the display effect of the image, the height and width of the image can be compressed according to the calculated scale at the same time so as to maintain the aspect ratio of the image, thereby ensuring the display effect.
Step S203: according to the size of the image and the size of the characters in the target text, calculating the number of first preset characters to be displayed in the second character component, and filling the number of 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 one embodiment of the present invention, since the size of a single character in the first text component cannot be directly obtained, the size of a character in the target text can be determined by obtaining the width and/or the height of a third text component, where the third text component is filled with a second preset character having the same size as the character in the target text.
Since only one second preset character is filled in the third text component, the size of the second preset character is the same as the size of the characters in the target text, and the size (height and/or width) of the third text component is determined by the size of the second preset character filled in the third text component, the size of the characters in the target text can be determined by acquiring the size of the third text component. Specifically, since the size of the third text component is determined by the size of the font size, the font thickness, etc. of the second preset character that it fills, in order to ensure that the size of the second preset character is the same as the size of the characters in the target text, the font and the font size of the second preset character may be set to be the same as the font and the font size of the characters in the target text, and the second preset character may be "0" or any other preset character. The height and width of a row of characters in the target text can be recorded as mark Viewheight, and the width of a row of characters in the target text can be recorded as preWidth by filling a second preset character with the same size as the characters in the target text in the third text component and dynamically acquiring the height and width of the second preset character in the third text component through an onLayout () method. 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 correspond to different character sizes on different mobile equipment is avoided, and the accuracy of the character size is improved.
When information is displayed laterally, according to the width imagewidth of the picture (if the picture size is adjusted, the width is the adjusted width), the number of first preset characters to be displayed in the second text component is calculated according to the ratio imagewidth/preWidth of the width of the picture to the width of characters in the target text, and then the corresponding number of second preset characters are spliced into character strings by a method of (new Array (number of first preset characters)). Join ('0'), and the character strings are filled into the second file component.
Because the number of the first preset characters is a positive number, when calculating the ratio image width/preWidth of the width of the picture to the width of the characters in the target text, a Math.ceil () method can be adopted to round up so as to ensure that the width of the second text component filled with the corresponding number of the second preset characters is not smaller than the width of the image, thereby occupying enough display space for the image to be displayed in the first text component through the second text component.
It can be understood that when the information is displayed in a longitudinal manner, 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 one embodiment of the present invention, the first preset character is set to "K", the second preset character is set to "L", and when the second text component is nested in the first text component and the second text component is filled with a corresponding number of first preset characters, the corresponding display effect is shown in fig. 3, and in fig. 3, Y represents a character in the target text.
It should be noted that the setting position of the third text component may be matched with the second text component, so that the third text component overlaps the second text component. For example, when the third text component is filled with a second preset character having the same size as the character in the target text, the second preset character overlaps with the first preset character in the second text component, as shown in fig. 4. In fig. 4, in order to facilitate distinguishing the second text component from the third text component, the third text component is offset upward relative to the second text component, which does not represent an actual display effect, and in the actual display effect, a second preset character "L" in the third text component overlaps a first preset character "K" in the second text component, and upper and lower edges of the third text component also overlap upper and lower edges of the second text component, respectively.
Of course, the third text component may also overlap other positions of the second component, that is, the second predetermined character in the third component may overlap other characters in the second component except the first predetermined character, as shown in fig. 5 and 6. Similar to fig. 4, in fig. 5 and 6, the third letter component is offset upward with respect to the second letter component, which does not represent an actual display effect, but merely serves to distinguish the second letter component from the third letter component in the figures.
In addition, the third text component may not overlap with the second text component, as shown in fig. 7, where the third text component is spliced at the end of the second text component, and at this time, a second preset character in the third text component overlaps with a first character in the target text, so that, in order to ensure the information display effect, 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 feel the second preset character, so that the user views the information.
In addition, the third text component may be further nested in the second text component, when the third text component is nested in the second text component, since the third text component is filled with the second preset characters, the second preset characters may also be image space occupation, and the number of the first preset characters filled in the second component is the ratio imagewidth/preWidth of the width of the characters in the target text minus 1, and at this time, the display schematic diagram of the third text component and the second text component may be as shown in fig. 8. It should be noted that, when the third text component is not nested in the second text component, the third text component may be disposed in the first document component in an absolute layout manner, so as to accurately locate the position of the third text component in the first component.
According to the embodiment, the primary function of the first preset character is to occupy an image space, the primary 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 can be transparent, and when information is displayed, a user cannot perceive the content of the first preset character and the second preset character, and the display effect of the image is not affected.
Step S204: and setting the image in the second character component so that the image covers the first preset character in the second character 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 picture is adjusted, the image after the size adjustment is referred to herein as an image after the size adjustment), the second text component can be blocked by the image after the image is arranged on the first text component, that is, when the image is arranged on the first text component and the arrangement position of the image corresponds to the second text component, the image overlaps the second text component to block the second text component and is displayed in the first text component, the schematic diagram of the image displayed in the first text component can be shown as shown in fig. 1, wherein X represents information of picture display, picture information can display sales channel (self-service or global purchase and the like) of a product, Y represents information of text display, and text information can display name and the like of the product. The first preset characters in the second character component and the second preset characters in the third character component are overlapped on the bottom layer of the displayed image, so that a user cannot perceive the first preset characters and the second preset characters, the information display effect is improved, the display effect that the initial positions of the characters of the other rows except the first row in the target text are consistent with the initial positions of the images in the first row is achieved, and the information display effect is improved.
In addition, in order to accurately position the image in the second component, the image can be arranged in the second character component in an absolute layout mode, that is, the image to be displayed can be loaded through the picture component, then the image is arranged in the second character component in an absolute layout mode according to the calculated height and width of the image, so that the image and the characters can be displayed at the same time, the starting positions of the characters of other lines except the first line in the target text are ensured to be consistent with the starting positions of the pictures in the first line, and the information display effect is improved.
According to the information display method, as can be seen from the mode of nesting a second text component in a first text component, the first text component can display target text, the second text component can display first preset characters with the same character size as the target text, the number of the first preset characters displayed in the second text component is determined according to the size of an image to be displayed, the size of the second text component is matched with the size of the image to be displayed, the image to be displayed occupies a position in the first text component through the corresponding number of the first preset characters, then the image to be displayed is arranged in the second text component, the image covers the first preset characters in the second text component, and the image is displayed in the first text component due to the fact that the second text component is nested in the first text component. Therefore, through the nesting mode of the first character component and the second character component, the second character component is utilized to occupy the space of the image to be displayed in the first character component, so that when the image to be displayed is displayed in the first character component, the starting positions of the characters except the first line in the target text can be ensured to be consistent with the starting positions of the images in the first line, the information display effect is improved, the user can conveniently check the information, and further the viscosity of the user can be improved.
Fig. 9 is a schematic diagram of main modules of an information presentation apparatus according to an embodiment of the present invention.
As shown in fig. 9, an apparatus 900 for information presentation according to an 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 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 character component is nested in the first character component and is used for displaying a first preset character with the same character size as the target text;
the acquiring module 902 is configured to acquire an image to be displayed, and determine a size of the image;
the processing module 903 is configured to calculate, according to the size of the image and the size of the characters in the target text, the number of first preset characters to be displayed in the second text component, and fill the number of first preset characters into the second text component, so that the size of the second text component matches with 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 one embodiment of the present invention, the processing module 903 is configured to obtain a width and/or a height of a third text component to determine a size of a character in the target text, where the third text component is filled with a second preset character having a size identical to the size of the character in the target text.
In one embodiment of the present invention, the processing module 903 is further configured to adjust the size of the image according to the size of the character in the target text, so that the size of the image after the size adjustment matches the size of the second text component filled with the first preset character.
In one embodiment of the present invention, the second display module 904 is configured to locate the image in the second text component in an absolute layout manner.
According to the information display device, as can be seen from the manner of nesting the second text component in the first text component, the first text component can display the target text, the second text component can display the first preset characters with the same character size as the target text, 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 size of the image to be displayed, the image to be displayed occupies a place in the first text component through the corresponding number of the first preset characters, then the image to be displayed is arranged in the second text component, the image covers the first preset characters in the second text component, and the image is displayed in the first text component due to the fact that the second text component is nested in the first text component. Therefore, through the nesting mode of the first character component and the second character component, the second character component is utilized to occupy the space of the image to be displayed in the first character component, so that when the image to be displayed is displayed in the first character component, the starting positions of the characters except the first line in the target text can be ensured to be consistent with the starting positions of the images in the first line, the information display effect is improved, the user can conveniently check the information, and further the viscosity of the user can be improved.
Fig. 10 illustrates an exemplary system architecture 1000 of a method of information presentation or an apparatus of information presentation to which embodiments of the present invention may be applied.
As shown in fig. 10, a system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 serves as a medium for providing a communication link between the terminal apparatuses 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user can interact with a server 1005 via a network 1004 using terminal apparatuses 1001, 1002, 1003 to receive or transmit messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 1001, 1002, 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 smartphones, tablets, laptop and desktop computers, and the like.
The server 1005 may be a server providing various services, such as a background management server providing support for shopping-type websites browsed by the user using the terminal apparatuses 1001, 1002, 1003. The background management server can analyze and other processing on the received data such as the product information inquiry request and the like, and feed back processing results (such as target push information and product information) to the terminal equipment.
It should be noted that, the method for displaying information provided in the embodiment of the present invention is generally executed by the server 1005, and accordingly, the device 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, there is illustrated a schematic diagram of a computer system 1100 suitable for use in implementing the terminal device of an embodiment of the present invention. The terminal device shown in fig. 11 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU) 1101, which can execute various appropriate actions and processes according to 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 required 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 section 1106 including a keyboard, a mouse, and the like; an output portion 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk or the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, and the like. The communication section 1109 performs communication processing via a network such as the internet. The drive 1110 is also connected to the I/O interface 1105 as needed. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed as needed in drive 1110, so that a computer program read therefrom is installed as needed in storage section 1108.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1109, and/or installed from the removable media 1111. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 1101.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 flowcharts 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 involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a first display module, an acquisition module, a processing module, and a second display module. The names of these modules do not in any way constitute a limitation of the module itself, for example, the first presentation module may also be described as "module presenting 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 present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: displaying a target text by using a first text component, and determining the size of characters in the target text; a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as 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 text component 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 text component so that the size of the second text component is matched with the size of the image; the image is arranged in the first character component, and the position of the image corresponds to the second character component, so that the image is displayed in the first character component in a mode of being overlapped with the second character component.
According to the technical scheme, the first text component can display the target text, the second text component can display the first preset characters with the same size as the characters in the target text, 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, the size of the second text component is matched with the size of the image to be displayed, the image to be displayed occupies a position in the first text component through the corresponding number of the first preset characters, then the image to be displayed is arranged in the first text component, the arrangement position of the image corresponds to the second text component, and the image is displayed in the first text component in a mode of being overlapped with the second text component. Therefore, through the nesting mode of the first character component and the second character component, the second character component is utilized to occupy the space of the image to be displayed in the first character component, so that when the image to be displayed is displayed in the first character component, the starting positions of the characters except the first line in the target text can be ensured to be consistent with the starting positions of the images in the first line, the information display effect is improved, the user can conveniently check the information, and further the viscosity of the user can be improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of information presentation, comprising:
displaying a target text by using a first text component, and determining the size of characters in the target text; a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as 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 text component 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 text component so that the size of the second text component is matched with the size of the image;
and setting the image in the second character component so that the image covers the first preset character in the second character component.
2. The method of claim 1, wherein the determining the size of the character in the target text comprises:
and acquiring the width and/or the height of a third text component to determine the size of the characters in the target text, wherein the third text component is filled with a second preset character with the same size as the characters in the target text.
3. The method as recited in claim 1, further comprising:
and adjusting the size of the image according to the size of the characters in the target text so as to enable the size of the image with the adjusted size to be matched with the size of the second character component filled with the first preset characters.
4. The method of claim 1, wherein the disposing the image in the second text component comprises:
the image is arranged in the second text component in an absolute layout.
5. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the first preset character and/or the second preset character is transparent.
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 first display module is used for displaying a target text by utilizing a first text component and determining the size of characters in the target text; a second character component is nested in the first character component and is used for displaying a first preset character with the same character size as 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 text component 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 text component so that the size of the second text component is 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, wherein the device comprises a plurality of sensors,
the processing module is configured to obtain a width and/or a height of a third text component to determine a size of a character in the target text, where the third text component is filled with a second preset character having a size identical to that of the character in the target text.
8. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
the processing module is further configured to adjust the size of the image according to the size of the character in the target text, so that the size of the image after the size adjustment matches the size of the second text component filled with the first preset character.
9. An electronic device for information presentation, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any 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 CN112825079A (en) 2021-05-21
CN112825079B true 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9053361B2 (en) * 2012-01-26 2015-06-09 Qualcomm Incorporated Identifying regions of text to merge in a natural image or video frame

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN112825079A (en) 2021-05-21

Similar Documents

Publication Publication Date Title
CN107656911B (en) Form processing method and system
US20140258849A1 (en) Automatic Alignment of a Multi-Dimensional Layout
US20090085921A1 (en) Populate Web-Based Content Based on Space Availability
AU2016277770B2 (en) Use of bloom filters to simplify dynamic font augmentation and subsetting
CN107491307B (en) Information providing method, device, electronic equipment and computer readable storage medium
CN109446199B (en) Cell data processing method and device
CN110688829A (en) Table generation method, device, equipment and storage medium
US20150212981A1 (en) Providing print view of document for editing in web-based application
CN107330087B (en) Page file generation method and device
CN110941401A (en) Printing method and device
CN112825079B (en) Information display method and device
CN112486783A (en) Progress bar display method and device
CN112258594A (en) Character display method and device, electronic equipment and computer readable storage medium
US20220326901A1 (en) Data display
CN113282852A (en) Method and device for editing webpage
CN113553123B (en) Data processing method, device, electronic equipment and storage medium
CN112486482A (en) Page display method and device
CN115756461A (en) Annotation template generation method, image identification method and device and electronic equipment
CN112256176B (en) Character display method and device, electronic equipment and computer readable storage medium
CN113296771A (en) Page display method, device, equipment and computer readable medium
CN113822745A (en) Article display method and device
CN113705190A (en) Text processing method, device and equipment
CN113284174A (en) Method and device for processing pictures
CN112784187A (en) Page display method and device
CN113032696A (en) Display method and display device of page picture

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