CN103886025A - Method and device for displaying pictures in webpage - Google Patents

Method and device for displaying pictures in webpage Download PDF

Info

Publication number
CN103886025A
CN103886025A CN201410063125.9A CN201410063125A CN103886025A CN 103886025 A CN103886025 A CN 103886025A CN 201410063125 A CN201410063125 A CN 201410063125A CN 103886025 A CN103886025 A CN 103886025A
Authority
CN
China
Prior art keywords
text
viewing area
default font
demonstration
picture
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
CN201410063125.9A
Other languages
Chinese (zh)
Other versions
CN103886025B (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 Xiaomi Technology Co Ltd
Xiaomi Inc
Original Assignee
Xiaomi Inc
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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201410063125.9A priority Critical patent/CN103886025B/en
Publication of CN103886025A publication Critical patent/CN103886025A/en
Application granted granted Critical
Publication of CN103886025B publication Critical patent/CN103886025B/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/22Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of characters or indicia using display control signals derived from coded signals representing the characters or indicia, e.g. with a character-code memory
    • G09G5/24Generation of individual character patterns
    • G09G5/26Generation of individual character patterns for modifying the character dimensions, e.g. double width, double height

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method and a device for displaying pictures in a webpage, and belongs to the technical field of networks. The method comprises the following steps of acquiring attribute information, which at least comprises a display area corresponding to a picture and a text of the picture, of each picture when receiving a webpage displaying command; judging whether the text can be completely displayed in the corresponding display area or not; diminishing the typefaces of each text into preset typefaces when the text cannot be completely displayed in the corresponding display area; and displaying the texts with the preset typefaces in the display areas corresponding to the pictures in the webpage. Whether the texts can be completely displayed in the display areas or not is judged, when the texts cannot be completely displayed in the display areas, the typefaces are diminished into the preset typefaces, then the texts are displayed, characters in the texts can be displayed in the display areas as much as possible, the problem that information is missed and is displayed discontinuously due to the fact that a plurality of characters are cut out is solved, and the continuity and the definition of the texts are guaranteed.

Description

The display packing of picture and device in webpage
Technical field
The disclosure is directed to networking technology area, is display packing and device about picture in webpage specifically.
Background technology
Along with the variation of internet information, in webpage, may comprise a lot of pictures, because the data volume of picture is very large, the terminals such as mobile phone or panel computer need to consume too much flow and time in the time Loading Image.And in order to reduce the consumption of flow, improving the speed of web displaying, terminal can, in the time of display web page, replace picture to show with texts such as the words in picture name or picture, farthest retains the information of picture.
In the time replacing this picture to show with text corresponding to picture, can in viewing area corresponding to picture, show the text by single file, in the time that the text has exceeded the border of this viewing area, the text being beyond the boundary is intercepted.
Realizing in process of the present invention, inventor finds that correlation technique exists defect, for example: in the time that the font size of text word large or that comprise is more, having most of text is intercepted, easily omit the continuity of information crucial in text or destruction text display, thereby cause text implication unintelligible.
Summary of the invention
In order to solve the problem existing in correlation technique, the disclosure provides display packing and the device of picture in a kind of webpage.Described technical scheme is as follows:
According to the first aspect of disclosure embodiment, the display packing of picture in a kind of webpage is provided, described method comprises:
In the time receiving the instruction of display web page, obtain the attribute information of every pictures in described webpage, described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
When determining in described viewing area can not the described text of complete demonstration time, the font of described text is reduced into default font;
In the viewing area that described in described webpage, picture is corresponding, show the text of default font.
The text that shows default font in the viewing area that described in described webpage, picture is corresponding comprises:
Whether judge in described viewing area can the described default font of complete demonstration text;
When determine in described viewing area can not the described default font of complete demonstration text time, calculate the business of the region height of described viewing area and the font height of described default font, determine the demonstration line number of the text of described default font according to the business of described region height and described font height;
According to described peak width and described demonstration line number, the text of described default font is divided into multistage text message, the paragraph number of described multistage text message equates with described demonstration line number, and the display width of every section of text message is not more than described peak width;
In described viewing area, branch shows described multistage text message.
According to described peak width and described demonstration line number, the text of described default font is divided into multistage text message and comprises:
Calculate the business of described peak width and described set width, determine according to the business of described peak width and described set width the number of characters that a line of described viewing area can complete demonstration;
From the text of described default font, repeatedly extract the character corresponding with described number of characters, form multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number.
From the text of described default font, repeatedly extract the character corresponding with described number of characters, formation multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number comprises:
Calculate the product of described peak width and described demonstration line number;
Judge whether described product is greater than described total display width;
In the time that described product is not more than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message;
Proceed to extract until extraction time stops while reaching described demonstration line number, obtain multistage text message;
By remaining character deletion in the text of described default font, and last character extracting is replaced with to designated character, it is imperfect that described designated character is used for pointing out current text to show.
After judging whether described product is greater than described total display width, described method also comprises:
In the time that described product is greater than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message;
Proceed extraction until the text of described default font has all been extracted, obtain multistage text message.
Whether judge in described viewing area can the described default font of complete demonstration text comprise:
Calculate the product of the character number of described set width and described text, obtain total display width of the text of described default font;
Whether the peak width that judges described viewing area is greater than described total display width;
In the time that described peak width is greater than described total display width, determine in described viewing area can the described default font of complete demonstration text; Or,
In the time that described peak width is not more than described total display width, determine in described viewing area can not the described default font of complete demonstration text.
Whether judge in described viewing area can the text of the described default font of complete demonstration after, described method also comprises:
When determine in described viewing area can the described default font of complete demonstration text time, in described viewing area, single file shows the text of described default font.
According to the second aspect of disclosure embodiment, the display device of picture in a kind of webpage is provided, described device comprises:
Acquisition of information module, in the time receiving the instruction of display web page, obtains the attribute information of every pictures in described webpage, and described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Judge module, for whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
Font adjusting module, for when determining in described viewing area can not the described text of complete demonstration time, is reduced into default font by the font of described text;
Display module, for showing the text of default font in the viewing area that described in described webpage, picture is corresponding.
Described display module comprises:
Judging unit, for whether judge in described viewing area can the described default font of complete demonstration text;
Line number computing unit, for when can not the described default font of complete demonstration in definite described viewing area text time, calculate the business of the region height of described viewing area and the font height of described default font, determine the demonstration line number of the text of described default font according to the business of described region height and described font height;
Segmenting unit, be used for according to described peak width and described demonstration line number, the text of described default font is divided into multistage text message, and the paragraph number of described multistage text message equates with described demonstration line number, and the display width of every section of text message is not more than described peak width;
Branch's display unit, shows described multistage text message for branch in described viewing area.
Described segmenting unit comprises:
Number of characters is determined subelement, for calculating the business of described peak width and described set width, determines according to the business of described peak width and described set width the number of characters that a line of described viewing area can complete demonstration;
Character extracts subelement, for repeatedly extracting the character corresponding with described number of characters from the text of described default font, form multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number.
Described character extracts subelement for calculating the product of described peak width and described demonstration line number; Judge whether described product is greater than described total display width; In the time that described product is not more than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message; Proceed to extract until extraction time stops while reaching described demonstration line number, obtain multistage text message; By remaining character deletion in the text of described default font, and last character extracting is replaced with to designated character, it is imperfect that described designated character is used for pointing out current text to show.
Described character extracts subelement also in the time that described product is greater than described total display width, extracts the character corresponding with described number of characters from the text of described default font, forms one section of text message; Proceed extraction until the text of described default font has all been extracted, obtain multistage text message.
Described judging unit comprises:
Overall width computation subunit, for calculating the product of character number of described set width and described text, obtains total display width of the text of described default font;
Width judgment sub-unit, for judging whether the peak width of described viewing area is greater than described total display width;
First determines subelement, in the time that described peak width is greater than described total display width, determine in described viewing area can the described default font of complete demonstration text; Or,
Second determines subelement, in the time that described peak width is not more than described total display width, determine in described viewing area can not the described default font of complete demonstration text.
Described device also comprises:
Single file display module, for when determine in described viewing area can the described default font of complete demonstration text time, in described viewing area, single file shows the text of described default font.
According to the third aspect of disclosure embodiment, the display device of picture in a kind of webpage is provided, comprising:
Processor; For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
In the time receiving the instruction of display web page, obtain the attribute information of every pictures in described webpage, described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
When determining in described viewing area can not the described text of complete demonstration time, the font of described text is reduced into default font;
In the viewing area that described in described webpage, picture is corresponding, show the text of default font.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect:
The method and apparatus that the embodiment of the present invention provides, by in the time receiving the instruction of display web page, it not the text directly Showing Picture in viewing area corresponding to picture, but whether first judge in the viewing area that this picture is corresponding can complete this picture of demonstration text, when determining in this viewing area can not the complete demonstration text time, after being reduced into default font, the font of the text shows again, can in this viewing area, show as much as possible the character in the text, avoid the information causing due to the too much character intercepting in text to omit and discontinuous demonstration, continuity and the sharpness of text are ensured.
Should be understood that, it is only exemplary that above general description and details are hereinafter described, and can not limit the disclosure.
Brief description of the drawings
Accompanying drawing is herein merged in instructions and forms the part of this instructions, shows embodiment according to the invention, and is used from and explains principle of the present invention with instructions one.
Fig. 1 is according to the process flow diagram of the display packing of picture in a kind of webpage shown in an exemplary embodiment;
Fig. 2 a is according to the process flow diagram of the display packing of picture in a kind of webpage shown in an exemplary embodiment;
Fig. 2 b is according to the text display effect schematic diagram shown in an exemplary embodiment;
Fig. 2 c is the text display effect schematic diagram according to the default font shown in an exemplary embodiment;
Fig. 2 d is the text single file display effect schematic diagram according to the default font shown in an exemplary embodiment;
Fig. 2 e is the text branch display effect schematic diagram according to the default font shown in an exemplary embodiment;
Fig. 3 is according to the display device schematic diagram of picture in a kind of webpage shown in an exemplary embodiment;
Fig. 4 is according to the display device schematic diagram of picture in a kind of webpage shown in an exemplary embodiment;
Fig. 5 is according to the block diagram of the device of a kind of demonstration for webpage picture shown in an exemplary embodiment.
Embodiment
For making object of the present disclosure, technical scheme and advantage clearer, below in conjunction with embodiment and accompanying drawing, the disclosure is described in further details.At this, exemplary embodiment of the present disclosure and explanation thereof are used for explaining the disclosure, but not as to restriction of the present disclosure.
Disclosure embodiment provides display packing and the device of picture in a kind of webpage, below in conjunction with accompanying drawing, the disclosure is elaborated.
Fig. 1 is according to the process flow diagram of the display packing of picture in a kind of webpage shown in an exemplary embodiment, and as shown in Figure 1, in this webpage, the display packing of picture, for terminal, comprises the following steps:
In step 101, in the time receiving the instruction of display web page, obtain the attribute information of every pictures in this webpage, this attribute information at least comprises viewing area that picture is corresponding and the text of picture, the method for the present embodiment is for terminal.
In step 102, whether judge in the viewing area that this picture is corresponding can complete this picture of demonstration text.
In step 103, when determining in this viewing area can not the complete demonstration text time, the font of the text is reduced into default font.
In step 104, in the viewing area that this picture is corresponding in this webpage, show the text of default font.
The method that the present embodiment provides, by in the time receiving the instruction of display web page, it not the text directly Showing Picture in viewing area corresponding to picture, but whether first judge in the viewing area that this picture is corresponding can complete this picture of demonstration text, when determining in this viewing area can not the complete demonstration text time, after being reduced into default font, the font of the text shows again, can in this viewing area, show as much as possible the character in the text, avoid the information causing due to the too much character intercepting in text to omit and discontinuous demonstration, continuity and the sharpness of text are ensured.
The text that shows default font in the viewing area that this picture is corresponding in this webpage comprises:
Whether judge in this viewing area can complete this default font of demonstration text;
When determine in this viewing area can not complete this default font of demonstration text time, calculate the business of the region height of this viewing area and the font height of this default font, determine the demonstration line number of the text of this default font according to the business of this region height and this font height;
According to this peak width and this demonstration line number, the text of this default font is divided into multistage text message, the paragraph number of this multistage text message equates with this demonstration line number, and the display width of every section of text message is not more than this peak width;
In this viewing area, branch shows this multistage text message.
According to this peak width and this demonstration line number, the text of this default font is divided into multistage text message and comprises:
Calculate the business of this peak width and this set width, determine according to the business of this peak width and this set width the number of characters that a line of this viewing area can complete demonstration;
From the text of this default font, repeatedly extract the character corresponding with this number of characters, form multistage text message, until the text of this default font has all been extracted, or until extraction time reaches this demonstration line number.
From the text of this default font, repeatedly extract the character corresponding with this number of characters, formation multistage text message, until the text of this default font has all been extracted, or until extraction time reaches this demonstration line number comprises:
Calculate the product of this peak width and this demonstration line number;
Judge whether this product is greater than this total display width;
In the time that this product is not more than this total display width, from the text of this default font, extract the character corresponding with this number of characters, form one section of text message;
Proceed to extract until extraction time stops while reaching this demonstration line number, obtain multistage text message;
By remaining character deletion in the text of this default font, and last character extracting is replaced with to designated character, it is imperfect that this designated character is used for pointing out current text to show.
After judging whether this product is greater than this total display width, the method also comprises:
In the time that this product is greater than this total display width, from the text of this default font, extract the character corresponding with this number of characters, form one section of text message;
Proceed extraction until the text of this default font has all been extracted, obtain multistage text message.
Whether judge in this viewing area can complete this default font of demonstration text comprise:
Calculate the product of the character number of this set width and the text, obtain total display width of the text of this default font;
Whether the peak width that judges this viewing area is greater than this total display width;
In the time that this peak width is greater than this total display width, determine in this viewing area can complete this default font of demonstration text; Or,
In the time that this peak width is not more than this total display width, determine in this viewing area can not complete this default font of demonstration text.
Whether judge in this viewing area can the text of complete this default font of demonstration after, the method also comprises:
When determine in this viewing area can complete this default font of demonstration text time, in this viewing area, single file shows the text of this default font.
Above-mentioned all optional technical schemes, can adopt any combination to form optional embodiment of the present invention, and this is no longer going to repeat them.
Fig. 2 a is according to the process flow diagram of the display packing of picture in a kind of webpage shown in an exemplary embodiment, and as shown in Figure 2 a, in this webpage, the display packing of picture, for terminal, comprises the following steps:
In step 201, in the time that this terminal receives the instruction of display web page, obtain the attribute information of every pictures in this webpage, this attribute information at least comprises viewing area that picture is corresponding and the text of picture.
Wherein, the instruction of this display web page can be inputted web page address by user and trigger, or triggers while opening browser by this terminal, or is initiatively sent to this terminal by the server of this Webpage correlation, and the present embodiment does not limit this.
In addition, this attribute information at least comprises viewing area that picture is corresponding and the text of picture, can also comprise number of character in the font of photo resolution, dimension of picture, the text or the text etc., and the present embodiment does not limit this.Wherein, the text can be the word comprising in the title of picture, picture, or replaces for the alt(that picture is described in this webpage) label.
For example, the HTML(Hyper Text Markup Language of this webpage, HTML (Hypertext Markup Language)) in, src(source file in <img src=" path A " alt=" text B "/> label) the attribute path of having specified picture is " path A ", it is " text B " that alt attribute has been specified the text of the picture " path A " under.
In the present embodiment, in the time that this terminal receives the instruction of display web page, show after need to loading web page contents in this webpage and picture, now this terminal can directly load this web page contents again.But because the data volume of picture is very large, when loading, need to expend too much flow, therefore this terminal can not Load Image, but obtain the text of picture, and replace picture to show with the text, both can save flow, avoid the typesetting confusion of webpage, also can retain the information of picture.
The present embodiment is applied to this terminal and receives the instruction of display web page, under the scene of the text that need to Show Picture in viewing area corresponding to this picture.
In step 202, for the every pictures in this webpage, this terminal judges in the time that single file shows, text that whether can complete this picture of demonstration in viewing area corresponding to this picture, if so, execution step 203, if not, execution step 204.
In the present embodiment, this terminal showing before the text, and whether first judge in the viewing area that this picture is corresponding can the complete demonstration text, if can, this terminal shows the text in this viewing area.And be set to acquiescence while showing the text of this picture according to predetermined manner when this terminal, whether this terminal can judge while demonstration according to this predetermined manner in this viewing area can the complete demonstration text, if can, can in this viewing area, show the text according to this predetermined manner.Wherein, this predetermined manner can be display mode, the first trip indentation display mode etc. in Liang Ge space in interval between single file display mode, adjacent character, the present embodiment only describes as single file display mode as example taking this predetermined manner, but does not form the restriction to this predetermined manner.
In the present embodiment, this step 202 comprises the following steps (2021)-(2024):
(2021) this terminal is obtained region height and the peak width of character number in the text, viewing area that this picture is corresponding, and the set width of the current font of the text and font height.
(2022) this terminal is calculated the product of this set width and this character number, obtains total display width of the text.
In the present embodiment, this terminal is calculated the product of this set width and this character number, total display width of the text when product of this set width and this character number is single file demonstration.
(2023) whether this peak width of this terminal judges is greater than this total display width, and judges whether this region height is greater than this font height.
(2024) in the time that this peak width is greater than this total display width and this region height and is greater than this font height, this terminal determines when single file shows, can the complete demonstration text in viewing area corresponding to this picture; Or in the time that this peak width is not more than this total display width or this region height and is not more than this font height, this terminal determines when single file shows, can not the complete demonstration text in viewing area corresponding to this picture.
In the present embodiment, in the time that single file shows, the width in shared region when this total display width represents to show the text, the height in shared region when this font height represents to show the text.In the time that this peak width is not more than this total display width, represent that this viewing area is not enough to hold complete text in the horizontal direction, a part for some character in the text or some character will inevitably, outside viewing area corresponding to this picture, can not intactly show the text in this viewing area.And in the time that this region height is not more than this font height, represent that this viewing area in the vertical direction is not enough to hold complete text, in the text each character above or below will inevitably some outside this viewing area, in this viewing area, can not intactly show the text.And when can not the complete demonstration text in this viewing area, this terminal will intercept the character outside this viewing area, easily omits the key message of the text, has destroyed the continuity of the text.
As with reference to Fig. 2 b, the text is " microblogging Weibo.com ", and " microblogging " represents the title of webpage, and " Weibo.com " is for representing the network address of webpage.But because this peak width is less than this total display width and this region height is less than this font height, this terminal intercepts display effect after the character outside this viewing area as shown in Figure 2 b, omitted webpage title and network address, and text display is discontinuous, causes text implication unintelligible.
It should be noted that, the present embodiment is all shown as example with corresponding text replacement with the every pictures in this webpage and describes, and in actual application, this terminal can be selected the first picture to be loaded and replace the second picture showing with text in all pictures from this webpage.For the first picture, this terminal only need load rear demonstration, and for second picture, this terminal continues to carry out subsequent step, to show the text of this second picture in viewing area corresponding to this second picture.
Accordingly, before this step 202, the method also comprises: in this webpage of this terminal judges, whether the attribute information of every pictures mates with the default attribute that loads, this default attribute that loads is for specifying the attribute information of picture to be loaded, when the attribute information of arbitrary picture and this is default while loading attributes match, this terminal determines that this attribute information and this default picture that loads attributes match are the first picture, in the time that the attribute information of arbitrary picture does not mate with this default loading attribute, this terminal determines that this attribute information and the unmatched picture of this default loading attribute are second picture.For the first picture in this webpage, this first picture of this terminal loads, follow-up this first picture that shows in this webpage, for the second picture in this webpage, this terminal execution step 202.
Wherein, this is default loads the information such as size that attribute can specify picture to be loaded, resolution, type, and the present embodiment does not limit this.
In step 203, this terminal single file in this viewing area shows the text, finishes.
In the present embodiment, if this terminal determine while showing according to predetermined manner, can the complete demonstration text in this viewing area, this terminal can show the text according to this predetermined manner in the time showing this webpage in this viewing area.In the time that this predetermined manner is single file demonstration, this terminal can be in the time showing this webpage, and in this viewing area, single file shows the text.Further, this terminal can also be in this viewing area single file and show between two parties the text.
In step 204, the font of the text is reduced into default font by this terminal.
Can not the complete demonstration text in this viewing area when single file shows if this terminal is determined, the font of the text is reduced into default font.Wherein, this default font is predetermined small font, and the font size of this default font is as far as possible little, and can clear demonstration in the small screen such as mobile phone or panel computer terminal.
It should be noted that, the present embodiment dwindles the font of a text with this terminal, follow-uply whether judges in this viewing area that the text after can complete demonstration decreasing font size is that example describes.And in actual applications, this terminal can preset the multiple font varying in size, when text after follow-up can not complete demonstration in this terminal is determined this viewing area decreasing font size, can also continue the font of the text to be reduced into less font, until can the complete demonstration text in this viewing area, or until this terminal be carried out subsequent step 207 when the font of the text is reduced into predefined smallest font again.
In step 205, this terminal judges in the time that single file shows, text that whether can complete this default font of demonstration in this viewing area, if so, execution step 206, if not, execution step 207.
In the present embodiment, this step 205 comprises the following steps (2051)-(2054):
(2051) this terminal is obtained set width and the font height of this default font.
(2052) this terminal is calculated the product of the character number of this set width and the text, obtains total display width of the text of this default font.
(2053) whether the peak width of this this viewing area of terminal judges is greater than this total display width, and judges whether this region height is greater than the font height of this default font.
In the present embodiment, the font size of this default font is very little, this terminal is reduced into the font of the text after default font, the viewing area that picture is corresponding is generally all greater than the font height of this default font, therefore this terminal can only judge whether the peak width of this viewing area is greater than this total display width, and without judging whether this region height is greater than the font height of this default font.Accordingly, in the time that this peak width is greater than this total display width, this terminal can be determined text that can complete this default font of demonstration in this viewing area when single file shows, in the time that this peak width is not more than this total display width, this terminal can be determined text that can not complete this default font of demonstration in this viewing area when single file shows.
(2054) in the time that this peak width is greater than this total display width and this region height and is greater than this font height, this terminal determines when single file shows, text that can complete this default font of demonstration in viewing area corresponding to this picture; Or in the time that this peak width is not more than this total display width or this region height and is not more than this font height, this terminal determines when single file shows, text that can not complete this default font of demonstration in viewing area corresponding to this picture.
In step 206, this terminal single file in this viewing area shows the text of this default font, finishes.
In the present embodiment, if this terminal determine can complete this default font of demonstration in this viewing area when single file shows text, can be in this viewing area single file and show between two parties the text of this default font.
Based on step 202 for example, this terminal is reduced into the font of text " microblogging Weibo.com " after this default font, text that can complete this default font of demonstration in this viewing area, display effect is as shown in Figure 2 c.
In step 207, this terminal is calculated the business of the region height of this viewing area and the font height of this default font, determines the demonstration line number of the text of this default font according to the business of this region height and this font height.
Even determine and the font of the text be reduced into default font when this terminal, still can not the complete demonstration text in this viewing area time, the text branch of this default font can be shown, this terminal is first calculated the business of this region height and this font height, the business who obtains is rounded, obtain the demonstration line number of the text of this default font, this demonstration line number is for representing that this viewing area can hold the maximum number of lines of the text of this default font.
For example, this region height is 30mm, and this font height is 4.5mm, and the business of this region height and this font height is 6.667, and after the business who obtains is rounded, this terminal determines that this demonstration line number is 6.
In step 208, this terminal is according to this peak width and this demonstration line number, the text of this default font is divided into multistage text message, and the paragraph number of this multistage text message equates with this demonstration line number, and the display width of every section of text message is not more than this peak width.
In the present embodiment, this terminal is first divided into multistage text message according to this peak width by the text of this default font, when being shown in this viewing area, every section of text message can be covered with a line of this viewing area, and the display width of every section of text message is not more than this peak width, determine according to this demonstration line number the paragraph number of dividing again, this paragraph number equates with this demonstration line number, makes in the time showing the text, and this multistage text message can be covered with this viewing area.
In the present embodiment, this step 208 comprises the following steps (2081)-(2085):
(2081) this terminal is calculated the business of this peak width and this set width, determines according to the business of this peak width and this set width the number of characters that a line of this viewing area can complete demonstration.
In the present embodiment, this terminal is calculated the business of this peak width and this set width, the business who obtains is rounded, obtain the number of characters that a line of this viewing area can complete demonstration,, in the time showing the text of this default font, the character corresponding with this number of characters can be covered with a line of this viewing area.
For example, this peak width is W, and this set width is w, this number of characters n=[W/w].
(2082) this terminal is calculated the product of this peak width and this demonstration line number.
(2083) whether this product of this terminal judges is greater than this total display width, if so, and execution step 2084, if not, execution step 2085.
For example, this peak width is W, this demonstration line number is N, this total display width is D, this terminal compares the size of W*N and D, in the time of W*N>D, if while representing that this terminal is divided the capable demonstration of N, text that can complete this default font of demonstration in this viewing area, in the time of W*N<=D, if while representing that this terminal is divided the capable demonstration of N, text that can not complete this default font of demonstration in this viewing area shows the character corresponding width that has D-W*N outside this viewing area.
In another embodiment providing at the present embodiment, this step (2082) and (2083) can be replaced by following steps: this terminal is calculated the product of this demonstration line number and this number of characters, obtain total number of characters that this viewing area can complete demonstration, judge whether this total number of characters is greater than the character number in the text, if, execution step 2084, if not, execution step 2085.
For example, this demonstration line number is N, a line of this viewing area can complete demonstration number of characters be n, character number in the text is M, this terminal compares the size of N*n and M, in the time of N*n>M, if while representing that this terminal is divided the capable demonstration of N, text that can complete this default font of demonstration in this viewing area, in the time of N*n<=M, if while representing that this terminal is divided the capable demonstration of N, text that can not complete this default font of demonstration in this viewing area, will have M-N*n character outside this viewing area.
(2084) this terminal is extracted the character corresponding with this number of characters from the text of this default font, forms one section of text message, proceeds extraction until the text of this default font has all been extracted, and obtains multistage text message.
In the present embodiment, in the time that this product is greater than this total display width, represent the text that branch can complete this default font of demonstration in this viewing area while showing, this terminal is extracted the character formation one section text message corresponding with this number of characters successively from the text of this default font, when final extraction, this terminal obtains multistage text message, and the number of finally extracting character in one section of text message is less than this number of characters.
Based on giving an example of step (2083), in the time of W*N>D, this terminal is extracted n character from the text, form one section of text message, due to n=[W/w], the display width of n character is less than or equal to W, can this n of the complete demonstration of a line character in this viewing area.This terminal continues to extract n character afterwards, until extraction time is while reaching N-1, remaining number of characters is less than n, and remaining character is also formed to one section of text message, front N-1 section text message comprises n character, and the number of characters that final stage text message comprises is less than n.
Based on giving an example of step (2083), in the time of N*n>M, this terminal is extracted n character from the text, form one section of text message, this terminal continues to extract n character afterwards, until extraction time is while reaching N-1, remaining number of characters is M-n* (N-1), due to N*n>M, remaining number of characters M-n* (N-1) is less than n, remaining character is also formed to one section of text message, and front N-1 section text message comprises n character, and the number of characters M-n* (N-1) that final stage text message comprises is less than n.
(2085) this terminal is extracted the character corresponding with this number of characters from the text of this default font, form one section of text message, proceed to extract until extraction time stops while reaching this demonstration line number, obtain multistage text message, by remaining character deletion in the text of this default font, and last character extracting is replaced with to designated character.
Wherein, it is imperfect that this designated character is used for pointing out current text to show, can be asterisk or suspension points etc., and the present embodiment does not limit this.
In the present embodiment, if intercept remaining character in the text of this default font according to the border of this viewing area, may cause the character on this boundary line completely not intercepted, can retain the part of this character in this viewing area, thereby cause text display discontinuous.Therefore, this terminal is remaining character deletion in the text of this default font after repeatedly extracting, instead of intercepts according to the border of this viewing area, avoided showing incomplete character, thereby avoided the discontinuous demonstration of text.
Based on giving an example of step (2083), in the time of W*N<=D or in the time of N*n<=M, this terminal is extracted n character from the text of this default font, form one section of text message, this terminal continues to extract n character afterwards, until extraction time stops while reaching N, now form N section text message, every section of text message comprises n character.Due to W*N<=D or N*n<=M, in the text of this default font, also have remaining character, this terminal is by remaining character deletion.
With reference to Fig. 2 d, the text is that " large-scale Spring Festival Party is guess activity well afoot with lottery, good gift the more, prize is abundant, the number of people allowed is limited, First come first served ", this terminal is reduced into the font of the text after default font, still can not the complete demonstration text in this viewing area when single file shows, this terminal is calculated the business of this region height and this font height, determine the text that shows at most the default font of 3 row in this viewing area, and calculate the business of this peak width and this set width, determine that this viewing area a line can show at most the character of 9 default fonts, that is to say and in this viewing area, can show at most 27 characters, this terminal is extracted 9 characters successively as one section of text message, after extracting 3 times by remaining character deletion, and the 27th character " rich " replaced with to designated character " .. ", imperfect to represent that the text shows.
In step 209, this terminal branch in this viewing area shows this multistage text message.
Integrating step (2081)-(2085), this terminal is extracted after this multistage text message, and this multistage text message is presented in this viewing area according to sequence of extraction branch.Certainly, this terminal can also show the left-justify of final stage text message or show between two parties.
It should be noted that, the method that the present embodiment provides has only increased several times floating point arithmetic, calculated amount is very little, can ignore compared with the calculated amount while normally operation with this terminal, adopts the technical scheme of the present embodiment to impact the processing power of this terminal.
The method that the present embodiment provides, by in the time receiving the instruction of display web page, it not the text directly Showing Picture in viewing area corresponding to picture, but whether first judge in the viewing area that this picture is corresponding can complete this picture of demonstration text, when determining in this viewing area can not the complete demonstration text time, after being reduced into default font, the font of the text shows again, can in this viewing area, show as much as possible the character in the text, and show imperfect with this designated character prompting user version in the time failing complete demonstration, avoid the information causing due to the too much character intercepting in text to omit and discontinuous demonstration, continuity and the sharpness of text are ensured.
Fig. 3 is according to the display device schematic diagram of picture in a kind of webpage shown in an exemplary embodiment.With reference to Fig. 3, this device comprises acquisition of information module 301, judge module 302, font adjusting module 303 and display module 304.
This acquisition of information module 301 is configured to, in the time receiving the instruction of display web page, obtain the attribute information of every pictures in this webpage, and this attribute information at least comprises viewing area that picture is corresponding and the text of picture;
This judge module 302 be configured to for whether judge in the viewing area that this picture is corresponding can complete this picture of demonstration text;
This font adjusting module 303 is configured to, for when determining in this viewing area can not the complete demonstration text time, the font of the text is reduced into default font;
This display module 304 is configured in the text that shows default font in the viewing area that in this webpage, this picture is corresponding.
With reference to Fig. 4, this display module 304 comprises:
Judging unit 3041, for whether judge in the viewing area that this picture is corresponding can complete this default font of demonstration text;
Line number computing unit 3042, for when can not the described default font of complete demonstration in definite described viewing area text time, calculate the business of the region height of this viewing area and the font height of this default font, determine the demonstration line number of the text of this default font according to the business of this region height and this font height;
Segmenting unit 3043, be used for according to this peak width and this demonstration line number, the text of this default font is divided into multistage text message, and the paragraph number of this multistage text message equates with this demonstration line number, and the display width of every section of text message is not more than this peak width;
Branch's display unit 3044, shows this multistage text message for branch in this viewing area.
This segmenting unit 3043 comprises:
Number of characters is determined subelement, for calculating the business of this peak width and this set width, determines according to the business of this peak width and this set width the number of characters that a line of this viewing area can complete demonstration;
Character extracts subelement, repeatedly extracts the character corresponding with this number of characters for the text from this default font, forms multistage text message, until the text of this default font has all been extracted, or until extraction time reaches this demonstration line number.
This character extracts subelement for calculating the product of this peak width and this demonstration line number; Judge whether this product is greater than this total display width; In the time that this product is not more than this total display width, from the text of this default font, extract the character corresponding with this number of characters, form one section of text message; Proceed to extract until extraction time stops while reaching this demonstration line number, obtain multistage text message; By remaining character deletion in the text of this default font, and last character extracting is replaced with to designated character, it is imperfect that this designated character is used for pointing out current text to show.
This character extracts subelement also in the time that this product is greater than this total display width, extracts the character corresponding with this number of characters from the text of this default font, forms one section of text message; Proceed extraction until the text of this default font has all been extracted, obtain multistage text message.
This judging unit 3041 comprises:
Overall width computation subunit, for calculating the product of character number of this set width and the text, obtains total display width of the text of this default font;
Width judgment sub-unit, for judging whether the peak width of this viewing area is greater than this total display width;
First determines subelement, in the time that this peak width is greater than this total display width, determine in the viewing area that this picture is corresponding can complete this default font of demonstration text; Or,
Second determines subelement, in the time that this peak width is not more than this total display width, determine in the viewing area that this picture is corresponding can not complete this default font of demonstration text.
This device also comprises:
Single file display module, for when determine in this viewing area can complete this default font of demonstration text time, in this viewing area, single file shows the text of this default font.
The device that the present embodiment provides, by in the time receiving the instruction of display web page, it not the text directly Showing Picture in viewing area corresponding to picture, but whether first judge in the viewing area that this picture is corresponding can complete this picture of demonstration text, when determining in this viewing area can not the complete demonstration text time, after being reduced into default font, the font of the text shows again, can in this viewing area, show as much as possible the character in the text, and show imperfect with this designated character prompting user version in the time failing complete demonstration, avoid the information causing due to the too much character intercepting in text to omit and discontinuous demonstration, continuity and the sharpness of text are ensured.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations have been described in detail in the embodiment about the method, will not elaborate explanation herein.
It should be noted that: in the webpage that above-described embodiment provides when the picture of the display device of picture in display web page, only be illustrated with the division of above-mentioned each functional module, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, be divided into different functional modules by the inner structure of terminal, to complete all or part of function described above.In addition, in the webpage that above-described embodiment provides, in the display device of picture and webpage, the display packing embodiment of picture belongs to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
Fig. 5 is according to the block diagram of the device 500 of a kind of demonstration for webpage picture shown in an exemplary embodiment.For example, device 500 can be mobile phone, computing machine, digital broadcast terminal, information receiving and transmitting equipment, game console, flat-panel devices, Medical Devices, body-building equipment, personal digital assistant etc.
With reference to Fig. 5, device 500 can comprise following one or more assembly: processing components 502, storer 504, power supply module 506, multimedia groupware 508, audio-frequency assembly 510, the interface 512 of I/O (I/O), sensor module 514, and communications component 516.
The integrated operation of processing components 502 common control device 500, such as with demonstration, call, data communication, the operation that camera operation and record operation are associated.Treatment element 502 can comprise that one or more processors 520 carry out instruction, to complete all or part of step of above-mentioned method.In addition, processing components 502 can comprise one or more modules, is convenient to mutual between processing components 502 and other assemblies.For example, processing components 502 can comprise multi-media module, to facilitate mutual between multimedia groupware 508 and processing components 502.
Storer 504 is configured to store various types of data to be supported in the operation of device 500.The example of these data comprises for any application program of operation on device 500 or the instruction of method, contact data, telephone book data, message, picture, video etc.Storer 504 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read-only memory (prom), ROM (read-only memory) (ROM), magnetic store, flash memory, disk or CD.
Electric power assembly 506 provides electric power for installing 500 various assemblies.Electric power assembly 506 can comprise power-supply management system, one or more power supplys, and other and the assembly that generates, manages and distribute electric power to be associated for device 500.
Multimedia groupware 508 is included in the screen that an output interface is provided between described device 500 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises that one or more touch sensors are with the gesture on sensing touch, slip and touch panel.Described touch sensor is the border of sensing touch or sliding action not only, but also detects duration and the pressure relevant to described touch or slide.In certain embodiments, multimedia groupware 508 comprises a front-facing camera and/or post-positioned pick-up head.When device 500 is in operator scheme, during as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom ability.
Audio-frequency assembly 510 is configured to output and/or input audio signal.For example, audio-frequency assembly 510 comprises a microphone (MIC), and when device 500 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The sound signal receiving can be further stored in storer 504 or be sent via communications component 516.In certain embodiments, audio-frequency assembly 510 also comprises a loudspeaker, for output audio signal.
I/O interface 512 is for providing interface between processing components 502 and peripheral interface module, and above-mentioned peripheral interface module can be keyboard, some striking wheel, button etc.These buttons can include but not limited to: home button, volume button, start button and locking press button.
Sensor module 514 comprises one or more sensors, is used to device 500 that the state estimation of various aspects is provided.For example, sensor module 514 can detect the opening/closing state of device 500, the relative positioning of assembly, for example described assembly is display and the keypad of device 500, the position of all right pick-up unit 500 of sensor module 514 or 500 1 assemblies of device changes, user is with device 500 existence that contact or do not have the temperature variation of device 500 orientation or acceleration/deceleration and device 500.Sensor module 514 can comprise proximity transducer, be configured to without any physical contact time detect near the existence of object.Sensor module 514 can also comprise optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor module 514 can also comprise acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 516 is configured to be convenient to the communication of wired or wireless mode between device 500 and other equipment.Device 500 wireless networks that can access based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communications component 516 receives broadcast singal or the broadcast related information from external broadcasting management system via broadcast channel.In one exemplary embodiment, described communications component 516 also comprises near-field communication (NFC) module, to promote junction service.For example, can be based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 500 can be realized by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD) (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components, for carrying out said method.
In the exemplary embodiment, also provide a kind of non-provisional computer-readable recording medium that comprises instruction, for example, comprised the storer 504 of instruction, above-mentioned instruction can have been carried out said method by the processor 520 of device 500.For example, described non-provisional computer-readable recording medium can be ROM, random-access memory (ram), CD-ROM, tape, floppy disk and optical data storage equipment etc.
A kind of non-provisional computer-readable recording medium, in the time that the instruction in this storage medium is carried out by the processor of terminal, makes terminal can carry out the display packing of picture in a kind of webpage, and the method comprises:
In the time receiving the instruction of display web page, obtain the attribute information of every pictures in this webpage, this attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Whether judge in the viewing area that this picture is corresponding can complete this picture of demonstration text;
When determining in this viewing area can not the complete demonstration text time, the font of the text is reduced into default font;
In the viewing area that this picture is corresponding in this webpage, show the text of default font.
The text that shows default font in the viewing area that this picture is corresponding in this webpage comprises:
Whether judge in this viewing area can complete this default font of demonstration text;
When determine in this viewing area can not complete this default font of demonstration text time, calculate the business of the region height of this viewing area and the font height of this default font, determine the demonstration line number of the text of this default font according to the business of this region height and this font height;
According to this peak width and this demonstration line number, the text of this default font is divided into multistage text message, the paragraph number of this multistage text message equates with this demonstration line number, and the display width of every section of text message is not more than this peak width;
In this viewing area, branch shows this multistage text message.
According to this peak width and this demonstration line number, the text of this default font is divided into multistage text message and comprises:
Calculate the business of this peak width and this set width, determine according to the business of this peak width and this set width the number of characters that a line of this viewing area can complete demonstration;
From the text of this default font, repeatedly extract the character corresponding with this number of characters, form multistage text message, until the text of this default font has all been extracted, or until extraction time reaches this demonstration line number.
From the text of this default font, repeatedly extract the character corresponding with this number of characters, formation multistage text message, until the text of this default font has all been extracted, or until extraction time reaches this demonstration line number comprises:
Calculate the product of this peak width and this demonstration line number;
Judge whether this product is greater than this total display width;
In the time that this product is not more than this total display width, from the text of this default font, extract the character corresponding with this number of characters, form one section of text message;
Proceed to extract until extraction time stops while reaching this demonstration line number, obtain multistage text message;
By remaining character deletion in the text of this default font, and last character extracting is replaced with to designated character, it is imperfect that this designated character is used for pointing out current text to show.
After judging whether this product is greater than this total display width, the method also comprises:
In the time that this product is greater than this total display width, from the text of this default font, extract the character corresponding with this number of characters, form one section of text message;
Proceed extraction until the text of this default font has all been extracted, obtain multistage text message.
Whether judge in this viewing area can complete this default font of demonstration text comprise:
Calculate the product of the character number of this set width and the text, obtain total display width of the text of this default font;
Whether the peak width that judges this viewing area is greater than this total display width;
In the time that this peak width is greater than this total display width, determine in this viewing area can complete this default font of demonstration text; Or,
In the time that this peak width is not more than this total display width, determine in this viewing area can not complete this default font of demonstration text.
Whether judge in this viewing area can the text of complete this default font of demonstration after, the method also comprises:
When determine in this viewing area can complete this default font of demonstration text time, in this viewing area, single file shows the text of this default font.
Those skilled in the art, considering instructions and putting into practice after invention disclosed herein, will easily expect other embodiment of the present invention.The application is intended to contain any modification of the present invention, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present invention and comprised undocumented common practise or the conventional techniques means in the art of the disclosure.Instructions and embodiment are only regarded as exemplary, and true scope of the present invention and spirit are pointed out by claim below.
Should be understood that, the present invention is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendments and change not departing from its scope.Scope of the present invention is only limited by appended claim.

Claims (15)

1. a display packing for picture in webpage, is characterized in that, described method comprises:
In the time receiving the instruction of display web page, obtain the attribute information of every pictures in described webpage, described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
When determining in described viewing area can not the described text of complete demonstration time, the font of described text is reduced into default font;
In the viewing area that described in described webpage, picture is corresponding, show the text of default font.
2. method according to claim 1, is characterized in that, shows that the text of default font comprises in the viewing area that described in described webpage, picture is corresponding:
Whether judge in described viewing area can the described default font of complete demonstration text;
When determine in described viewing area can not the described default font of complete demonstration text time, calculate the business of the region height of described viewing area and the font height of described default font, determine the demonstration line number of the text of described default font according to the business of described region height and described font height;
According to described peak width and described demonstration line number, the text of described default font is divided into multistage text message, the paragraph number of described multistage text message equates with described demonstration line number, and the display width of every section of text message is not more than described peak width;
In described viewing area, branch shows described multistage text message.
3. method according to claim 2, is characterized in that, according to described peak width and described demonstration line number, the text of described default font is divided into multistage text message and comprises:
Calculate the business of described peak width and described set width, determine according to the business of described peak width and described set width the number of characters that a line of described viewing area can complete demonstration;
From the text of described default font, repeatedly extract the character corresponding with described number of characters, form multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number.
4. method according to claim 3, it is characterized in that, from the text of described default font, repeatedly extract the character corresponding with described number of characters, form multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number comprises:
Calculate the product of described peak width and described demonstration line number;
Judge whether described product is greater than described total display width;
In the time that described product is not more than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message;
Proceed to extract until extraction time stops while reaching described demonstration line number, obtain multistage text message;
By remaining character deletion in the text of described default font, and last character extracting is replaced with to designated character, it is imperfect that described designated character is used for pointing out current text to show.
5. method according to claim 4, is characterized in that, after judging whether described product is greater than described total display width, described method also comprises:
In the time that described product is greater than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message;
Proceed extraction until the text of described default font has all been extracted, obtain multistage text message.
6. method according to claim 2, is characterized in that, whether judge in described viewing area can the described default font of complete demonstration text comprise:
Calculate the product of the character number of described set width and described text, obtain total display width of the text of described default font;
Whether the peak width that judges described viewing area is greater than described total display width;
In the time that described peak width is greater than described total display width, determine in described viewing area can the described default font of complete demonstration text; Or,
In the time that described peak width is not more than described total display width, determine in described viewing area can not the described default font of complete demonstration text.
7. method according to claim 6, is characterized in that, whether judge in described viewing area can the text of the described default font of complete demonstration after, described method also comprises:
When determine in described viewing area can the described default font of complete demonstration text time, in described viewing area, single file shows the text of described default font.
8. a display device for picture in webpage, is characterized in that, described device comprises:
Acquisition of information module, in the time receiving the instruction of display web page, obtains the attribute information of every pictures in described webpage, and described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Judge module, for whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
Font adjusting module, for when determining in described viewing area can not the described text of complete demonstration time, is reduced into default font by the font of described text;
Display module, for showing the text of default font in the viewing area that described in described webpage, picture is corresponding.
9. device according to claim 8, is characterized in that, described display module comprises:
Judging unit, for whether judge in described viewing area can the described default font of complete demonstration text;
Line number computing unit, for when can not the described default font of complete demonstration in definite described viewing area text time, calculate the business of the region height of described viewing area and the font height of described default font, determine the demonstration line number of the text of described default font according to the business of described region height and described font height;
Segmenting unit, be used for according to described peak width and described demonstration line number, the text of described default font is divided into multistage text message, and the paragraph number of described multistage text message equates with described demonstration line number, and the display width of every section of text message is not more than described peak width;
Branch's display unit, shows described multistage text message for branch in described viewing area.
10. device according to claim 9, is characterized in that, described segmenting unit comprises:
Number of characters is determined subelement, for calculating the business of described peak width and described set width, determines according to the business of described peak width and described set width the number of characters that a line of described viewing area can complete demonstration;
Character extracts subelement, for repeatedly extracting the character corresponding with described number of characters from the text of described default font, form multistage text message, until the text of described default font has all been extracted, or until extraction time reaches described demonstration line number.
11. devices according to claim 10, is characterized in that, described character extracts subelement for calculating the product of described peak width and described demonstration line number; Judge whether described product is greater than described total display width; In the time that described product is not more than described total display width, from the text of described default font, extract the character corresponding with described number of characters, form one section of text message; Proceed to extract until extraction time stops while reaching described demonstration line number, obtain multistage text message; By remaining character deletion in the text of described default font, and last character extracting is replaced with to designated character, it is imperfect that described designated character is used for pointing out current text to show.
12. devices according to claim 11, it is characterized in that, described character extracts subelement also in the time that described product is greater than described total display width, extracts the character corresponding with described number of characters from the text of described default font, forms one section of text message; Proceed extraction until the text of described default font has all been extracted, obtain multistage text message.
13. devices according to claim 9, is characterized in that, described judging unit comprises:
Overall width computation subunit, for calculating the product of character number of described set width and described text, obtains total display width of the text of described default font;
Width judgment sub-unit, for judging whether the peak width of described viewing area is greater than described total display width;
First determines subelement, in the time that described peak width is greater than described total display width, determine in described viewing area can the described default font of complete demonstration text; Or,
Second determines subelement, in the time that described peak width is not more than described total display width, determine in described viewing area can not the described default font of complete demonstration text.
14. devices according to claim 13, is characterized in that, described device also comprises:
Single file display module, for when determine in described viewing area can the described default font of complete demonstration text time, in described viewing area, single file shows the text of described default font.
In 15. 1 kinds of webpages, the display device of picture, is characterized in that, comprising:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
In the time receiving the instruction of display web page, obtain the attribute information of every pictures in described webpage, described attribute information at least comprises viewing area that picture is corresponding and the text of picture;
Whether judge in the viewing area that described picture is corresponding can the described picture of complete demonstration text;
When determining in described viewing area can not the described text of complete demonstration time, the font of described text is reduced into default font;
In the viewing area that described in described webpage, picture is corresponding, show the text of default font.
CN201410063125.9A 2014-02-22 2014-02-22 The display methods and device of picture in webpage Active CN103886025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410063125.9A CN103886025B (en) 2014-02-22 2014-02-22 The display methods and device of picture in webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410063125.9A CN103886025B (en) 2014-02-22 2014-02-22 The display methods and device of picture in webpage

Publications (2)

Publication Number Publication Date
CN103886025A true CN103886025A (en) 2014-06-25
CN103886025B CN103886025B (en) 2017-10-20

Family

ID=50954917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410063125.9A Active CN103886025B (en) 2014-02-22 2014-02-22 The display methods and device of picture in webpage

Country Status (1)

Country Link
CN (1) CN103886025B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360799A (en) * 2014-10-17 2015-02-18 深圳七彩畅想网络技术有限公司 Font matching method and device
CN104598542A (en) * 2014-12-30 2015-05-06 广州酷狗计算机科技有限公司 Display method and device for multimedia information
CN106843793A (en) * 2017-02-16 2017-06-13 济南浪潮高新科技投资发展有限公司 A kind of data display method and device
CN107848173A (en) * 2015-07-28 2018-03-27 东洋机械金属株式会社 Forming machine
CN110865753A (en) * 2019-11-07 2020-03-06 支付宝(杭州)信息技术有限公司 Application message notification method and device
CN111339338A (en) * 2020-02-29 2020-06-26 西安理工大学 Text picture matching recommendation method based on deep learning
CN111400998A (en) * 2020-03-09 2020-07-10 北京字节跳动网络技术有限公司 Text display method and device, electronic equipment and readable storage medium
CN112287188A (en) * 2020-10-19 2021-01-29 珠海格力电器股份有限公司 Character trimming identification method and device
CN112445474A (en) * 2019-09-04 2021-03-05 福建天泉教育科技有限公司 Display method and storage medium for long text file name
CN114115779A (en) * 2021-11-22 2022-03-01 珠海格力电器股份有限公司 Parameter display control method and device, display panel and household appliance
CN116233540A (en) * 2023-03-10 2023-06-06 北京富通亚讯网络信息技术有限公司 Parallel signal processing method and system based on video image recognition

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006190174A (en) * 2005-01-07 2006-07-20 Nippon Telegr & Teleph Corp <Ntt> Information provision system and information provision method
CN101064177A (en) * 2006-04-26 2007-10-31 松下电器产业株式会社 Caption display control apparatus
CN103186912A (en) * 2011-12-28 2013-07-03 北京神州泰岳软件股份有限公司 Method and system for showing letter in picture format

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006190174A (en) * 2005-01-07 2006-07-20 Nippon Telegr & Teleph Corp <Ntt> Information provision system and information provision method
CN101064177A (en) * 2006-04-26 2007-10-31 松下电器产业株式会社 Caption display control apparatus
CN103186912A (en) * 2011-12-28 2013-07-03 北京神州泰岳软件股份有限公司 Method and system for showing letter in picture format

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360799B (en) * 2014-10-17 2018-04-10 深圳第七大道科技有限公司 A kind of method and device of font matching
CN104360799A (en) * 2014-10-17 2015-02-18 深圳七彩畅想网络技术有限公司 Font matching method and device
CN104598542A (en) * 2014-12-30 2015-05-06 广州酷狗计算机科技有限公司 Display method and device for multimedia information
CN104598542B (en) * 2014-12-30 2018-12-21 广州酷狗计算机科技有限公司 The display methods and device of multimedia messages
CN107848173A (en) * 2015-07-28 2018-03-27 东洋机械金属株式会社 Forming machine
CN106843793A (en) * 2017-02-16 2017-06-13 济南浪潮高新科技投资发展有限公司 A kind of data display method and device
CN112445474B (en) * 2019-09-04 2023-07-07 福建天泉教育科技有限公司 Display method for long text file name and storage medium
CN112445474A (en) * 2019-09-04 2021-03-05 福建天泉教育科技有限公司 Display method and storage medium for long text file name
CN110865753A (en) * 2019-11-07 2020-03-06 支付宝(杭州)信息技术有限公司 Application message notification method and device
CN110865753B (en) * 2019-11-07 2021-01-22 支付宝(杭州)信息技术有限公司 Application message notification method and device
CN111339338B (en) * 2020-02-29 2023-03-07 西安理工大学 Text picture matching recommendation method based on deep learning
CN111339338A (en) * 2020-02-29 2020-06-26 西安理工大学 Text picture matching recommendation method based on deep learning
CN111400998A (en) * 2020-03-09 2020-07-10 北京字节跳动网络技术有限公司 Text display method and device, electronic equipment and readable storage medium
CN111400998B (en) * 2020-03-09 2023-09-26 北京字节跳动网络技术有限公司 Text display method and device, electronic equipment and readable storage medium
CN112287188A (en) * 2020-10-19 2021-01-29 珠海格力电器股份有限公司 Character trimming identification method and device
CN114115779A (en) * 2021-11-22 2022-03-01 珠海格力电器股份有限公司 Parameter display control method and device, display panel and household appliance
CN114115779B (en) * 2021-11-22 2024-03-15 珠海格力电器股份有限公司 Parameter display control method and device, display panel and household appliance
CN116233540A (en) * 2023-03-10 2023-06-06 北京富通亚讯网络信息技术有限公司 Parallel signal processing method and system based on video image recognition
CN116233540B (en) * 2023-03-10 2024-04-02 北京富通亚讯网络信息技术有限公司 Parallel signal processing method and system based on video image recognition

Also Published As

Publication number Publication date
CN103886025B (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN103886025A (en) Method and device for displaying pictures in webpage
US10554805B2 (en) Information processing method, terminal, and computer-readable storage medium
US10949490B2 (en) Method and apparatus for displaying webpage content
US10509540B2 (en) Method and device for displaying a message
US20160028741A1 (en) Methods and devices for verification using verification code
CN104238875A (en) Application corner mark addition method and device
US20120289290A1 (en) Transferring objects between application windows displayed on mobile terminal
KR101709427B1 (en) Method and device for selecting information
US9959487B2 (en) Method and device for adding font
CN106527928B (en) Screen capture control device and method and intelligent terminal
CN110704647B (en) Content processing method and device
CN107239351B (en) Pasting method and device
EP4354827A1 (en) Display method, display apparatus, related device, and readable storage medium
CN104536787B (en) Resource preloads method and device
CN104063424B (en) Web page picture shows method and demonstration device
CN104951445B (en) Webpage processing method and device
CN105808304B (en) Code deployment method, device and system
CN104199915A (en) Method and device for detecting webpage changes
CN107360322B (en) Information prompting method and device
CN104636320A (en) Data processing method and device
CN112181252A (en) Screen capturing method and device and electronic equipment
CN110213062B (en) Method and device for processing message
US10613622B2 (en) Method and device for controlling virtual reality helmets
CN104239407B (en) A kind of method and apparatus for showing webpage
US20170060822A1 (en) Method and device for storing string

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant