CN103886025B - The display methods and device of picture in webpage - Google Patents

The display methods and device of picture in webpage Download PDF

Info

Publication number
CN103886025B
CN103886025B CN201410063125.9A CN201410063125A CN103886025B CN 103886025 B CN103886025 B CN 103886025B CN 201410063125 A CN201410063125 A CN 201410063125A CN 103886025 B CN103886025 B CN 103886025B
Authority
CN
China
Prior art keywords
text
viewing area
font
display
default font
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
CN201410063125.9A
Other languages
Chinese (zh)
Other versions
CN103886025A (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.)
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

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

Abstract

The disclosure is directed to a kind of display methods of picture in webpage and device, belong to network technique field.Methods described includes:When receiving the instruction of display webpage, the attribute information per pictures is obtained, attribute information at least includes the text of the corresponding viewing area of picture and picture;Judge whether can completely show text in viewing area;When in viewing area text completely can not be shown, the font of text is reduced into default font;The text of default font is shown in the corresponding viewing area of picture in webpage.The present invention is by judging whether can completely show the text in the viewing area, when in the viewing area text completely can not be shown, font is reduced into default font to be shown again, the character in text can be shown as much as possible in the viewing area, information is omitted and discontinuous display caused by avoiding due to intercepting excessive character, it is ensured that the continuity and definition of text.

Description

The display methods and device of picture in webpage
Technical field
The disclosure is directed to network technique field, the specifically display methods and device on picture in webpage.
Background technology
With the variation of internet information, many pictures may be included in webpage, because the data volume of picture is very big, The terminal such as mobile phone or tablet personal computer needs the excessive flow of consumption and time when Loading Image.And in order to reduce disappearing for flow Consumption, improves the speed of web displaying, and terminal can be when showing webpage, with text insteads such as the words in picture name or picture Picture is shown, farthest retains the information of picture.
When being shown with the picture corresponding text instead picture, can in the corresponding viewing area of picture single file The text is shown, when border of the text beyond the viewing area, the text interception beyond border is fallen.
During the present invention is realized, inventor has found correlation technique existing defects, for example:When the font chi of the text It is very little larger or comprising word it is more when, have most of text and be intercepted, easily omit in text crucial information or The continuity that destruction text is shown, so as to cause text implication unintelligible.
The content of the invention
In order to solve problem present in correlation technique, present disclose provides a kind of display methods of picture in webpage and dress Put.The technical scheme is as follows:
According to the first aspect of the embodiment of the present disclosure, there is provided a kind of display methods of picture in webpage, methods described bag Include:
When receiving the instruction of display webpage, the attribute information per pictures in the webpage, the attribute letter are obtained Breath at least includes the text of the corresponding viewing area of picture and picture;
Judge whether can completely show the text of the picture in the corresponding viewing area of the picture;
When it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into default Font;
The text of default font is shown in the corresponding viewing area of picture described in the webpage.
Show that the text of default font includes in the corresponding viewing area of picture described in the webpage:
Judge whether can completely show the text of the default font in the viewing area;
When it is determined that can not completely show the text of the default font in the viewing area, the viewing area is calculated Region height and the default font font height business, according to the business of the region height and the font height determine The display line number of the text of the default font;
According to the peak width and the display line number, the text of the default font is divided into multistage text envelope Breath, the paragraph number of the multistage text message is equal with the display line number, and the display width of every section of text message is little In the peak width;
Show the multistage text message in lines in the viewing area.
According to the peak width and the display line number, the text of the default font is divided into multistage text message Including:
The business of the peak width and the set width is calculated, according to the business of the peak width and the set width Determine the number of characters that a line of the viewing area can completely be shown;
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text envelope is constituted Breath, is completed until the text of the default font is all extracted, or until extraction time reaches the display line number.
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text envelope is constituted Breath, is completed until the text of the default font is all extracted, or until extraction time reaches that the display line number includes:
Calculate the peak width and the product of the display line number;
Judge whether the product is more than total display width;
When the product is not more than total display width, extracted and the character from the text of the default font The corresponding character of number, constitutes one section of text message;
Proceed to extract and stop when extraction time reaches the display line number, obtain multistage text message;
By remaining character deletion in the text of the default font, and the last character of extraction replaced with specified Character, the designated character is imperfect for pointing out current text to show.
Judge whether the product is more than after total display width, methods described also includes:
When the product is more than total display width, extracted and the number of characters from the text of the default font The corresponding character of mesh, constitutes one section of text message;
Proceed to extract and completed until the text of the default font is all extracted, obtain multistage text message.
Judge whether can completely show that the text of the default font includes in the viewing area:
Calculate the product of the character number of the set width and the text, obtain the default font text it is total Display width;
Judge whether the peak width of the viewing area is more than total display width;
When the peak width is more than total display width, determine completely show described in the viewing area The text of default font;Or,
When the peak width is not more than total display width, determine completely show institute in the viewing area State the text of default font.
Judge whether can completely to show that methods described is also wrapped after the text of the default font in the viewing area Include:
When it is determined that can completely show the text of the default font in the viewing area, in the viewing area Single file shows the text of the default font.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of display device of picture in webpage, described device bag Include:
Data obtaining module, for when receiving the instruction of display webpage, obtaining the category per pictures in the webpage Property information, the attribute information at least includes the text of the corresponding viewing area of picture and picture;
Judge module, for judging whether can completely show the text of the picture in the corresponding viewing area of the picture This;
Font adjusting module, for when it is determined that in the viewing area text completely can not be shown, by the text This font is reduced into default font;
Display module, the text for showing default font in the corresponding viewing area of picture described in the webpage.
The display module includes:
Judging unit, for judging whether can completely show the text of the default font in the viewing area;
Line number computing unit, determines completely show the text of the default font in the viewing area for working as When, calculate the business of the region height of the viewing area and the font height of the default font, according to the region height and The business of the font height determines the display line number of the text of the default font;
Segmenting unit, for according to the peak width and the display line number, the text of the default font to be divided For multistage text message, the paragraph number of the multistage text message is equal with the display line number, and every section of text message Display width is not more than the peak width;
Branch's display unit, for showing the multistage text message in lines in the viewing area.
The segmenting unit includes:
Number of characters determination subelement, the business for calculating the peak width and the set width, according to the area The business of field width degree and the set width determines the number of characters that a line of the viewing area can completely be shown;
Character extracts subelement, for repeatedly extracting corresponding with the number of characters from the text of the default font Character, constitutes multistage text message, is completed until the text of the default font is all extracted, or until extraction time reaches To the display line number.
The character, which extracts subelement, to be used to calculate the peak width and the product of the display line number;Multiply described in judging Whether product is more than total display width;When the product is not more than total display width, from the text of the default font Character corresponding with the number of characters is extracted in this, one section of text message is constituted;Proceed to extract until extraction time reaches Stop during to the display line number, obtain multistage text message;By remaining character deletion in the text of the default font, and The last character of extraction is replaced with into designated character, the designated character is imperfect for pointing out current text to show.
The character extracts subelement and is additionally operable to when the product is more than total display width, from the default font Text in extract corresponding with number of characters character, one section of text message of composition;Proceed to extract until will be described The text of default font, which is all extracted, to be completed, and obtains multistage text message.
The judging unit includes:
Overall width computation subunit, the product of the character number for calculating the set width and the text, is obtained Total display width of the text of the default font;
Width judgment sub-unit, for judging whether the peak width of the viewing area is more than total display width;
First determination subelement, for when the peak width is more than total display width, determining the viewing area The text of the default font can be completely shown in domain;Or,
Second determination subelement, for when the peak width is not more than total display width, determining the display The text of the default font can not be completely shown in region.
Described device also includes:
Single file display module, determines completely show the text of the default font in the viewing area for working as When, single file shows the text of the default font in the viewing area.
According to the third aspect of the embodiment of the present disclosure there is provided a kind of display device of picture in webpage, including:
Processor;Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
When receiving the instruction of display webpage, the attribute information per pictures in the webpage, the attribute letter are obtained Breath at least includes the text of the corresponding viewing area of picture and picture;
Judge whether can completely show the text of the picture in the corresponding viewing area of the picture;
When it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into default Font;
The text of default font is shown in the corresponding viewing area of picture described in the webpage.
The technical scheme provided by this disclosed embodiment can include the following benefits:
Method and apparatus provided in an embodiment of the present invention, by not being directly to exist when receiving the instruction of display webpage The corresponding viewing area of picture shows the text of picture, but whether first judge can be complete in the corresponding viewing area of the picture The text of the picture is shown, when it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into Shown again after default font, the character in the text can be shown as much as possible in the viewing area, it is to avoid by Information is omitted and discontinuous display caused by excessive character in interception text, it is ensured that the continuity of text and clear Degree.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary, this can not be limited It is open.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the present invention Example, and for explaining principle of the invention together with specification.
Fig. 1 is the flow chart of the display methods of picture in a kind of webpage according to an exemplary embodiment;
Fig. 2 a are the flow charts of the display methods of picture in a kind of webpage according to an exemplary embodiment;
Fig. 2 b are the text display effect schematic diagrames according to an exemplary embodiment;
Fig. 2 c are the text display effect schematic diagrames of the default font according to an exemplary embodiment;
Fig. 2 d are the text single file display effect schematic diagrames of the default font according to an exemplary embodiment;
Fig. 2 e are the text branch display effect schematic diagrames of the default font according to an exemplary embodiment;
Fig. 3 is the display device schematic diagram of picture in a kind of webpage according to an exemplary embodiment;
Fig. 4 is the display device schematic diagram of picture in a kind of webpage according to an exemplary embodiment;
Fig. 5 is a kind of block diagram for the device of the display of picture in webpage according to an exemplary embodiment.
Embodiment
It is right with reference to embodiment and accompanying drawing for the purpose, technical scheme and advantage of the disclosure are more clearly understood The disclosure is described in further details.Here, the exemplary embodiment of the disclosure and its illustrating to be used to explain the disclosure, but simultaneously Limited not as of this disclosure.
The embodiment of the present disclosure provides the display methods and device of picture in a kind of webpage, and the disclosure is entered below in conjunction with accompanying drawing Row is described in detail.
Fig. 1 is the flow chart of the display methods of picture in a kind of webpage according to an exemplary embodiment, such as Fig. 1 institutes Show, the display methods of picture is used in terminal in the webpage, comprises the following steps:
In a step 101, when receiving the instruction of display webpage, the attribute information per pictures in the webpage is obtained, The attribute information at least includes the text of the corresponding viewing area of picture and picture, and the method for the present embodiment is used in terminal.
In a step 102, judge whether can completely show the text of the picture in the corresponding viewing area of the picture.
In step 103, when it is determined that in the viewing area text completely can not be shown, the font of the text is reduced To preset font.
At step 104, the text of default font is shown in the corresponding viewing area of the picture in the web page.
The method that the present embodiment is provided, by not being directly corresponding in picture when receiving the instruction of display webpage Viewing area shows the text of picture, but first judges whether can completely show the picture in the corresponding viewing area of the picture Text, when it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into after default font Shown again, the character in the text can be shown as much as possible in the viewing area, it is to avoid due to interception text In excessive character caused by information omit and discontinuous display, it is ensured that the continuity and definition of text.
Showing the text of default font in the corresponding viewing area of the picture in the web page includes:
Judge the text of the default font whether can be completely shown in the viewing area;
When it is determined that can not completely show the text of the default font in the viewing area, the region of the viewing area is calculated The business of the font height of height and the default font, the default font is determined according to the business of the region height He the font height The display line number of text;
According to the peak width and the display line number, the text of the default font is divided into multistage text message, this is more The paragraph number of section text message is equal with the display line number, and to be not more than the region wide for the display width of every section of text message Degree;
Show the multistage text message in lines in the viewing area.
According to the peak width and the display line number, the text of the default font is divided into multistage text message includes:
The business of the peak width and the set width is calculated, determines that this shows according to the business of the peak width and the set width Show the number of characters that a line in region can completely be shown;
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text message is constituted, Completed until the text of the default font is all extracted, or until extraction time reaches the display line number.
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text message is constituted, Completed until the text of the default font is all extracted, or until extraction time reaches that the display line number includes:
Calculate the product of the peak width and the display line number;
Judge whether the product is more than total display width;
When the product is not more than total display width, extract corresponding with the number of characters from the text of the default font Character, constitute one section of text message;
Proceed to extract and stop when extraction time reaches the display line number, obtain multistage text message;
By remaining character deletion in the text of the default font, and the last character of extraction is replaced with into designated word Symbol, the designated character is imperfect for pointing out current text to show.
Judge whether the product is more than after total display width, this method also includes:
When the product is more than total display width, extract corresponding with the number of characters from the text of the default font Character, constitutes one section of text message;
Proceed to extract and completed until the text of the default font is all extracted, obtain multistage text message.
Judge that the text that the default font whether can be completely shown in the viewing area includes:
The product of the set width and the character number of the text is calculated, the total display for obtaining the text of the default font is wide Degree;
Judge whether the peak width of the viewing area is more than total display width;
When the peak width is more than total display width, determine completely show the default font in the viewing area Text;Or,
When the peak width is not more than total display width, determine completely show the predetermined word in the viewing area The text of body.
After the text for judging whether can completely to show the default font in the viewing area, this method also includes:
When it is determined that can completely show the text of the default font in the viewing area, single file shows in the viewing area Show the text of the default font.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the present invention, herein no longer using any combination Repeat one by one.
Fig. 2 a are the flow chart of the display methods of picture in a kind of webpage according to an exemplary embodiment, such as Fig. 2 a Shown, the display methods of picture is used in terminal in the webpage, comprises the following steps:
In step 201, when the terminal receives the instruction of display webpage, the attribute per pictures in the webpage is obtained Information, the attribute information at least includes the text of the corresponding viewing area of picture and picture.
Wherein, the instruction of the display webpage can be browsed by user's input web page address triggering, or by terminal unlatching Trigger, or actively sent from the server of the Webpage correlation to the terminal during device, the present embodiment is not limited this.
In addition, the attribute information at least includes the text of the corresponding viewing area of picture and picture, picture can also be included Number of character etc. in resolution ratio, dimension of picture, the font of the text or the text, the present embodiment is not limited this.Wherein, The text can be the word that is included in the title of picture, picture, or be used for alt that picture is described in the webpage (Instead of)Label.
For example, the HTML of the webpage(Hyper Text Markup Language, HTML)In,<img Src=" path A " alt=" text B "/>Src in label(Source file)The path that attribute specifies picture is " path A ", alt Attribute specify " text of the picture under the A " of path be " text B ".
In the present embodiment, when the terminal receives the instruction of display webpage, it is necessary to load in the webpage in the webpage Hold and shown again after picture, now the terminal can be loaded directly into the web page contents.But because the data volume of picture is very big, Need to expend excessive flow during loading, therefore the terminal can be not loaded with picture, but the text of picture is obtained, with the text Shown instead of picture, can both save flow, it is to avoid the typesetting of webpage is chaotic, can also retain the information of picture.
The present embodiment is to be applied to the terminal to receive the instruction of display webpage, it is necessary in the corresponding viewing area of the picture Under the scene of the text of interior display picture.
In step 202., for every pictures in the webpage, the terminal is judged when single file is shown, picture correspondence Viewing area in whether can completely show the text of the picture, if it is, perform step 203, if not, perform step 204。
In the present embodiment, the terminal is before the display text, first judge in the corresponding viewing area of the picture whether The text can be completely shown, if it can, the terminal shows the text in the viewing area.And when the terminal has been set to write from memory When recognizing the text that the picture is shown according to predetermined manner, it is aobvious at this when being shown according to the predetermined manner that the terminal may determine that Whether can completely show the text, be somebody's turn to do if it can, can be shown according to the predetermined manner in the viewing area if showing in region Text.Wherein, the predetermined manner can be the display mode in two spaces in interval, head between single file display mode, adjacent character Row retraction display mode etc., the present embodiment is only illustrated so that the predetermined manner is single file display mode as an example, but is not constituted Restriction to the predetermined manner.
In the present embodiment, the step 202 comprises the following steps(2021)-(2024):
(2021)The terminal obtains character number, the region height of the corresponding viewing area of the picture and the area in the text Field width degree, and text current font set width and font height.
(2022)The terminal calculates the product of the set width and the character number, obtains total display width of the text.
In the present embodiment, the terminal calculates the product of the set width and the character number, the set width and the word Total display width of the text when product of symbol number is single file display.
(2023)The terminal judges that whether the peak width is more than total display width, and judge whether the region height is big In the font height.
(2024)When the peak width is more than total display width and the region height is more than the font height, the terminal When determining single file display, the picture can completely show the text in corresponding viewing area;Or, when the peak width is not more than When total display width or the region height are not more than the font height, when the terminal determines single file display, picture correspondence Viewing area in can not completely show the text.
In the present embodiment, when single file is shown, the width in shared region when total display width represents to show the text Degree, the height in shared region when the font height represents to show the text.When the peak width is not more than total display width When, represent that the viewing area is not enough to accommodate complete text in the horizontal direction, then some of text character or some A part for character can not will necessarily intactly show this article outside the corresponding viewing area of the picture in the viewing area This.And when the region height is not more than the font height, represent that the viewing area in the vertical direction is not enough to accommodate completely Text, then in the text above or below each character will necessarily some outside the viewing area, the viewing area The text can not be intactly shown in domain.And when that completely can not show the text in the viewing area, the terminal will be cut The character outside the viewing area is taken, the key message of the text is easily omitted, destroys the continuity of the text.
Such as reference picture 2b, the text is " microblogging Weibo.com ", " microblogging " represents the title of webpage, and " Weibo.com " is used In the network address for representing webpage.But because the peak width is less than total display width and the region height is less than the font height, Terminal interception falls the display effect after the character outside the viewing area as shown in Figure 2 b, misses webpage title and network address, And text is shown discontinuously, cause text implication unintelligible.
It should be noted that the present embodiment is entered by every pictures in the webpage so that corresponding text instead is shown as an example Row explanation, and in actual application, the terminal can select the first figure to be loaded from all pictures in the webpage Piece and the second picture shown with text instead.For the first picture, the terminal is shown after need to only being loaded, and for Second picture, the terminal continues executing with subsequent step, to show the second picture in the corresponding viewing area of the second picture Text.
Accordingly, before the step 202, this method also includes:The terminal judges that the attribute in the webpage per pictures is believed Whether breath matches with default loading attribute, and the default loading attribute is used for the attribute information for providing picture to be loaded, when any figure When the attribute information of piece is with the default loading attributes match, the terminal determines the attribute information and the default loading attributes match Picture is the first picture, and when the default loading attribute of attribute information and this of any picture is mismatched, the terminal determines the attribute Information is second picture with the unmatched picture of default loading attribute.For the first picture in the webpage, the terminal loads First picture, subsequently shows first picture in the web page, and for the second picture in the webpage, the terminal performs step 202。
Wherein, the default loading attribute can specify that the information, this implementation such as the size, resolution ratio, type of picture to be loaded Example is not limited this.
In step 203, terminal single file in the viewing area shows the text, terminates.
In the present embodiment, can be complete in the viewing area if the terminal determines to be shown according to predetermined manner The whole display text, then the terminal according to the predetermined manner can show this article in the viewing area when showing the webpage This.When the predetermined manner is that single file is shown, the terminal can be when showing the webpage, and single file shows this in the viewing area Text.Further, the terminal single file and can also be shown centered on the text in the viewing area.
In step 204, the font of the text is reduced into default font by the terminal.
If the terminal determines completely show the text in the viewing area during single file display, by the word of the text Body is reduced into default font.Wherein, the default font is predetermined small font, and the font size of the default font is as small as possible, And can clearly be shown in the small screen terminal such as mobile phone or tablet personal computer.
It should be noted that the present embodiment reduces the font of a text with the terminal, the viewing area is subsequently judged Inside whether can completely show and illustrate exemplified by the text after decreasing font size.And in actual applications, the terminal can be advance A variety of fonts of different sizes are set, subsequently when the terminal determines completely show text after decreasing font size in the viewing area This when, it can also continue to being reduced into the font of the text into smaller font, until can completely show this in the viewing area Untill text, or until the terminal performs subsequent step again when the font of the text is reduced into smallest font set in advance 207。
In step 205, the terminal is judged when single file is shown, whether can completely show that this is preset in the viewing area The text of font, if it is, step 206 is performed, if not, performing step 207.
In the present embodiment, the step 205 comprises the following steps(2051)-(2054):
(2051)The terminal obtains the set width and font height of the default font.
(2052)The terminal calculates the product of the set width and the character number of the text, obtains the text of the default font This total display width.
(2053)The terminal judges that whether the peak width of the viewing area is more than total display width, and judge the region Whether height is more than the font height of the default font.
In the present embodiment, the font of the text is reduced into default font by the font size very little of the default font, the terminal Afterwards, the corresponding viewing area of picture is typically greater than the font height of the default font, therefore the terminal can only judge that this shows Show whether the peak width in region is more than total display width, without judging whether the region height is more than the default font Font height.Accordingly, when the peak width is more than total display width, the terminal is display when can determine that single file display The text of the default font can be completely shown in region, when the peak width is not more than total display width, the terminal is The text of the default font can not be completely shown when can determine that single file display in the viewing area.
(2054)When the peak width is more than total display width and the region height is more than the font height, the terminal When determining single file display, the text of the default font can be completely shown in the corresponding viewing area of the picture;Or, when the region Width is not more than total display width or when the region height is not more than the font height, when the terminal determines single file display, The text of the default font can not be completely shown in the corresponding viewing area of the picture.
In step 206, terminal single file in the viewing area shows the text of the default font, terminates.
In the present embodiment, if the terminal determines completely show the predetermined word in the viewing area during single file display The text of body, then single file and can be shown centered on the text of the default font in the viewing area.
Citing based on step 202, by text, " microblogging Weibo.com " font is reduced into the default font to the terminal Afterwards, the text of the default font can be completely shown in the viewing area, display effect is as shown in Figure 2 c.
In step 207, the terminal calculates the business of the region height of the viewing area and the font height of the default font, The display line number of the text of the default font is determined according to the business of the region height He the font height.
When the terminal determine even if the font of the text has been reduced into default font, still can not be complete in the viewing area When showing the text, the text branch of the default font can be shown that then the terminal first calculates the region height and the font The business of height, rounds to obtained business, obtains the display line number of the text of the default font, and the display line number is used to represent The viewing area can accommodate the maximum number of lines of the text of the default font.
For example, the region height is 30mm, the font height is 4.5mm, the then region height and the font height business For 6.667, the terminal determines that the display line number is 6 after being rounded to obtained business.
In a step 208, the text of the default font is divided into by the terminal according to the peak width and the display line number Multistage text message, the paragraph number of the multistage text message is equal with the display line number, and the display of every section of text message is wide Degree is not more than the peak width.
In the present embodiment, the text of the default font is first divided into multistage text envelope by the terminal according to the peak width Breath so that a line of the viewing area, and every section of text envelope can be covered with when every section of text message is shown in the viewing area The display width of breath is not more than the peak width, further according to the display line number determine divide paragraph number, the paragraph number with The display line number is equal so that when showing the text, the multistage text message can be covered with the viewing area.
In the present embodiment, the step 208 comprises the following steps(2081)-(2085):
(2081)The terminal calculates the business of the peak width and the set width, according to the peak width and the set width Business determine the number of characters that a line of the viewing area can completely be shown.
In the present embodiment, the terminal calculates the business of the peak width and the set width, and obtained business is rounded, The number of characters that a line of the viewing area can completely be shown is obtained, then when showing the text of the default font, with the word The corresponding character of symbol number can be covered with a line of the viewing area.
For example, the peak width is W, the set width is w, then number of characters n=[W/w].
(2082)The terminal calculates the product of the peak width and the display line number.
(2083)The terminal judges whether the product is more than total display width, if it is, step 2084 is performed, if It is no, perform step 2085.
For example, the peak width is W, the display line number is N, and total display width is D, then the terminal compares W*N's and D Size, works as W*N>During D, represent if when the terminal point N rows are shown, the default font can be completely shown in the viewing area Text, works as W*N<During=D, represent if when the terminal point N rows are shown, the default font can not be completely shown in the viewing area Text, the corresponding character of width for having D-W*N is shown outside the viewing area.
In another embodiment that the present embodiment is provided, the step(2082)With(2083)It can be replaced by following steps: The terminal calculates the product of the display line number and the number of characters, obtains total number of characters that the viewing area can completely be shown Mesh, judges the character number whether total number of characters is more than in the text, if it is, step 2084 is performed, if not, performing Step 2085.
For example, the display line number is N, during the number of characters that a line of the viewing area can completely be shown is n, the text Character number be M, then the terminal compare N*n and M size, work as N*n>During M, represent if when the terminal point N rows are shown, be somebody's turn to do The text of the default font can be completely shown in viewing area, works as N*n<During=M, represent if during the display of the terminal point N rows, The text of the default font can not be completely shown in the viewing area, there will be M-N*n character outside the viewing area.
(2084)The terminal extracts character corresponding with the number of characters from the text of the default font, constitutes one section of text This information, proceeds to extract up to all extraction is completed by text of the default font, obtains multistage text message.
In the present embodiment, when the product is more than total display width, viewing area interior energy when branch shows is represented Enough completely to show the text for presetting font, then the terminal is extracted and the number of characters pair from the text of the default font successively The character answered constitutes one section of text message, and the terminal obtains multistage text message when final extraction is completed, and finally extracts one The number of character is less than the number of characters in section text message.
Based on step(2083)Citing, work as W*N>During D, the terminal extracts n character from the text, constitutes one section of text This information, due to n=[W/w], the display width of n character is less than or equal in W, the viewing area and can completely shown with a line This n character.The terminal continues to extract n character afterwards, until when extraction time reaches N-1, remaining number of characters is less than N, one section of text message is also constituted by remaining character, then preceding N-1 sections of text message includes n character, final stage text envelope The number of characters that ceasing includes is less than n.
Based on step(2083)Citing, work as N*n>During M, the terminal extracts n character from the text, constitutes one section of text This information, the terminal continues to extract n character afterwards, until when extraction time reaches 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, and remaining character is also constituted into one section of text message, Then preceding N-1 sections of text message includes n character, and the number of characters M-n* (N-1) that final stage text message includes is less than n.
(2085)The terminal extracts character corresponding with the number of characters from the text of the default font, constitutes one section of text This information, proceeds extraction until stopping when extraction time reaches the display line number, obtains multistage text message, this is preset Remaining character deletion in the text of font, and the last character of extraction is replaced with into designated character.
Wherein, the designated character is imperfect for pointing out current text to show, can be asterisk or ellipsis etc., this implementation Example is not limited this.
In the present embodiment, if intercepting remaining word in the text of the default font according to the border of the viewing area Symbol, then may result in the character on the boundary line and be not intercepted completely, can retain the character in the viewing area Part, so as to cause text to show discontinuously.Therefore, the terminal will be remaining in the text of the default font after multiple extract Character deletion, rather than intercepted according to the border of the viewing area, it is to avoid the incomplete character of display, so as to avoid The discontinuous display of text.
Based on step(2083)Citing, work as W*N<During=D or work as N*n<During=M, text of the terminal from the default font N character is extracted in this, one section of text message is constituted, the terminal continues to extract n character afterwards, until extraction time reaches N When stop, now having constituted N sections of text messages, every section of text message includes n character.Due to W*N<=D or N*n<=M, this is pre- If there is remaining character in the text of font, then the terminal is by remaining character deletion.
Reference picture 2d, the text is " guess activity is in progress with lottery for large-scale Spring Festival Party, and good gift the more, is encouraged Product are abundant, and the number of people allowed is limited, arrive first and first obtain ", the font of the text is reduced into after default font by the terminal, and this shows when single file is shown Showing still can not completely show the text in region, then the terminal calculates the business of the region height and the font height, determine that this shows Show that at most 3 rows of display preset the text of font in region, and calculate the business of the peak width and the set width, determine the display Region a line is at best able to show the character of 9 default fonts, that is to say and is at best able to show 27 characters in the viewing area, Then the terminal extracts 9 characters as one section of text message successively, by remaining character deletion after extracting 3 times, and by the 27th Character " rich " replaces with designated character " .. ", to represent that it is imperfect that the text is shown.
In step 209, the terminal shows the multistage text message in lines in the viewing area.
With reference to step(2081)-(2085), the terminal extracts after the multistage text message, the multistage text message pressed According to sequence of extraction, branch is shown in the viewing area.Certainly, the terminal can also show final stage text message left-justify Show or be shown centered on.
It should be noted that the method that the present embodiment is provided increase only floating point arithmetic several times, amount of calculation very little, with The amount of calculation during normal operation of terminal, can't be to the place of the terminal using the technical scheme of the present embodiment compared to can ignore Reason ability is impacted.
The method that the present embodiment is provided, by not being directly corresponding in picture when receiving the instruction of display webpage Viewing area shows the text of picture, but first judges whether can completely show the picture in the corresponding viewing area of the picture Text, when it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into after default font Shown again, the character in the text can be shown as much as possible in the viewing area, and when failing complete display Show imperfect with designated character prompting user version, it is to avoid due to intercepting information caused by the excessive character in text Omit and discontinuous display, it is ensured that the continuity and definition of text.
Fig. 3 is the display device schematic diagram of picture in a kind of webpage according to an exemplary embodiment.Reference picture 3, The device includes data obtaining module 301, judge module 302, font adjusting module 303 and display module 304.
The data obtaining module 301 is configurable for, when receiving the instruction of display webpage, obtaining every in the webpage The attribute information of pictures, the attribute information at least includes the text of the corresponding viewing area of picture and picture;
The judge module 302 is configurable for judging whether can completely show this in the corresponding viewing area of the picture The text of picture;
The font adjusting module 303 is configurable for when it is determined that completely can not show the text in the viewing area, The font of the text is reduced into default font;
The display module 304, which is configured in the webpage in the corresponding viewing area of the picture, shows default font Text.
Reference picture 4, the display module 304 includes:
Judging unit 3041, for judging the default font whether can be completely shown in the corresponding viewing area of the picture Text;
Line number computing unit 3042, determines completely show the text of the default font in the viewing area for working as This when, the business of the region height of the viewing area and the font height of the default font is calculated, according to the region height and the word The business of body height determines the display line number of the text of the default font;
Segmenting unit 3043, for according to the peak width and the display line number, the text of the default font to be divided into Multistage text message, the paragraph number of the multistage text message is equal with the display line number, and the display of every section of text message is wide Degree is not more than the peak width;
Branch's display unit 3044, for showing the multistage text message in lines in the viewing area.
The segmenting unit 3043 includes:
Number of characters determination subelement, the business for calculating the peak width and the set width, according to the peak width The number of characters that a line of the viewing area can completely be shown is determined with the business of the set width;
Character extracts subelement, for repeatedly extracting word corresponding with the number of characters from the text of the default font Symbol, constitutes multistage text message, is completed until the text of the default font is all extracted, or until extraction time reaches this Show line number.
The character, which extracts subelement, to be used to calculate the peak width and the product of the display line number;Judge whether the product is big In total display width;When the product is not more than total display width, extracted and the character from the text of the default font The corresponding character of number, constitutes one section of text message;Proceed to extract and stop when extraction time reaches the display line number, Obtain multistage text message;By remaining character deletion in the text of the default font, and the last character of extraction is replaced Designated character is changed to, the designated character is imperfect for pointing out current text to show.
The character extracts subelement and is additionally operable to when the product is more than total display width, from the text of the default font Character corresponding with the number of characters is extracted, one section of text message is constituted;Proceed to extract until this to be preset to the text of font This whole, which is extracted, to be completed, and obtains multistage text message.
The judging unit 3041 includes:
Overall width computation subunit, the product of the character number for calculating the set width and the text, obtains this pre- If total display width of the text of font;
Width judgment sub-unit, for judging whether the peak width of the viewing area is more than total display width;
First determination subelement, for when the peak width is more than total display width, determining that the picture is corresponding aobvious The text of the default font can completely be shown by showing in region;Or,
Second determination subelement, for when the peak width is not more than total display width, determining that the picture is corresponding The text of the default font can not be completely shown in viewing area.
The device also includes:
Single file display module, for when it is determined that can completely show the text of the default font in the viewing area, Single file shows the text of the default font in the viewing area.
The device that the present embodiment is provided, by not being directly corresponding in picture when receiving the instruction of display webpage Viewing area shows the text of picture, but first judges whether can completely show the picture in the corresponding viewing area of the picture Text, when it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into after default font Shown again, the character in the text can be shown as much as possible in the viewing area, and when failing complete display Show imperfect with designated character prompting user version, it is to avoid due to intercepting information caused by the excessive character in text Omit and discontinuous display, it is ensured that the continuity and definition of text.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
It should be noted that:Picture of the display device of picture in display webpage in the webpage that above-described embodiment is provided When, only with the division progress of above-mentioned each functional module for example, in practical application, as needed can divide above-mentioned functions With by different functional module completions, i.e., the internal structure of terminal is divided into different functional modules, to complete above description All or part of function.In addition, in the webpage that above-described embodiment is provided the display device of picture and picture in webpage it is aobvious Show that embodiment of the method belongs to same design, it implements process and refers to embodiment of the method, repeats no more here.
Fig. 5 is a kind of block diagram for the device 500 of the display of picture in webpage according to an exemplary embodiment. For example, device 500 can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, flat board is set It is standby, Medical Devices, body-building equipment, personal digital assistant etc..
Reference picture 5, device 500 can include following one or more assemblies:Processing assembly 502, memory 504, power supply Component 506, multimedia groupware 508, audio-frequency assembly 510, input/output(I/O)Interface 512, sensor cluster 514, and Communication component 516.
The integrated operation of the usual control device 500 of processing assembly 502, such as with display, call, data communication, phase Machine operates the operation associated with record operation.Treatment element 502 can refer to including one or more processors 520 to perform Order, to complete all or part of step of above-mentioned method.In addition, processing assembly 502 can include one or more modules, just Interaction between processing assembly 502 and other assemblies.For example, processing assembly 502 can include multi-media module, it is many to facilitate Interaction between media component 508 and processing assembly 502.
Memory 504 is configured as storing various types of data supporting the operation in device 500.These data are shown Example includes the instruction of any application program or method for operating on device 500, and contact data, telephone book data disappears Breath, picture, video etc..Memory 504 can be by any kind of volatibility or non-volatile memory device or their group Close and realize, such as static RAM(SRAM), Electrically Erasable Read Only Memory(EEPROM), it is erasable to compile Journey read-only storage(EPROM), programmable read only memory(PROM), read-only storage(ROM), magnetic memory, flash Device, disk or CD.
Electric power assembly 506 provides electric power for the various assemblies of device 500.Electric power assembly 506 can include power management system System, one or more power supplys, and other components associated with generating, managing and distributing electric power for device 500.
Multimedia groupware 508 is included in the screen of one output interface of offer between described device 500 and user.One In a little embodiments, screen can include liquid crystal display(LCD)And touch panel(TP).If screen includes touch panel, screen Curtain may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch sensings Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action Border, but also detection touches or slide related duration and pressure with described.In certain embodiments, many matchmakers Body component 508 includes a front camera and/or rear camera.When device 500 be in operator scheme, such as screening-mode or During video mode, front camera and/or rear camera can receive the multi-medium data of outside.Each front camera and Rear camera can be a fixed optical lens system or with focusing and optical zoom capabilities.
Audio-frequency assembly 510 is configured as output and/or input audio signal.For example, audio-frequency assembly 510 includes a Mike Wind(MIC), when device 500 be in operator scheme, when such as call model, logging mode and speech recognition mode, microphone by with It is set to reception external audio signal.The audio signal received can be further stored in memory 504 or via communication set Part 516 is sent.In certain embodiments, audio-frequency assembly 510 also includes a loudspeaker, for exports audio signal.
I/O interfaces 512 is provide interface between processing assembly 502 and peripheral interface module, above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 514 includes one or more sensors, and the state for providing various aspects for device 500 is commented Estimate.For example, sensor cluster 514 can detect opening/closed mode of device 500, the relative positioning of component is for example described Component is the display and keypad of device 500, and sensor cluster 514 can be with 500 1 components of detection means 500 or device Position change, the existence or non-existence that user contacts with device 500, the orientation of device 500 or acceleration/deceleration and device 500 Temperature change.Sensor cluster 514 can include proximity transducer, be configured to detect in not any physical contact The presence of neighbouring object.Sensor cluster 514 can also include optical sensor, such as CMOS or ccd image sensor, for into As being used in application.In certain embodiments, the sensor cluster 514 can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 516 is configured to facilitate the communication of wired or wireless way between device 500 and other equipment.Device 500 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary implementation In example, communication component 516 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 516 also includes near-field communication(NFC)Module, to promote junction service.Example Such as, radio frequency identification can be based in NFC module(RFID)Technology, Infrared Data Association(IrDA)Technology, ultra wide band(UWB)Technology, Bluetooth(BT)Technology and other technologies are realized.
In the exemplary embodiment, device 500 can be by one or more application specific integrated circuits(ASIC), numeral letter Number processor(DSP), digital signal processing appts(DSPD), PLD(PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components realize, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided Such as include the memory 504 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 520 of device 500.For example, The non-transitorycomputer readable storage medium can be ROM, random access memory(RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the computing device of terminal When so that terminal is able to carry out a kind of display methods of picture in webpage, and this method includes:
When receiving the instruction of display webpage, the attribute information per pictures in the webpage is obtained, the attribute information is extremely Include the text of the corresponding viewing area of picture and picture less;
Judge whether can completely show the text of the picture in the corresponding viewing area of the picture;
When it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into default font;
The text of default font is shown in the corresponding viewing area of the picture in the web page.
Showing the text of default font in the corresponding viewing area of the picture in the web page includes:
Judge the text of the default font whether can be completely shown in the viewing area;
When it is determined that can not completely show the text of the default font in the viewing area, the region of the viewing area is calculated The business of the font height of height and the default font, the default font is determined according to the business of the region height He the font height The display line number of text;
According to the peak width and the display line number, the text of the default font is divided into multistage text message, this is more The paragraph number of section text message is equal with the display line number, and to be not more than the region wide for the display width of every section of text message Degree;
Show the multistage text message in lines in the viewing area.
According to the peak width and the display line number, the text of the default font is divided into multistage text message includes:
The business of the peak width and the set width is calculated, determines that this shows according to the business of the peak width and the set width Show the number of characters that a line in region can completely be shown;
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text message is constituted, Completed until the text of the default font is all extracted, or until extraction time reaches the display line number.
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text message is constituted, Completed until the text of the default font is all extracted, or until extraction time reaches that the display line number includes:
Calculate the product of the peak width and the display line number;
Judge whether the product is more than total display width;
When the product is not more than total display width, extract corresponding with the number of characters from the text of the default font Character, constitute one section of text message;
Proceed to extract and stop when extraction time reaches the display line number, obtain multistage text message;
By remaining character deletion in the text of the default font, and the last character of extraction is replaced with into designated word Symbol, the designated character is imperfect for pointing out current text to show.
Judge whether the product is more than after total display width, this method also includes:
When the product is more than total display width, extract corresponding with the number of characters from the text of the default font Character, constitutes one section of text message;
Proceed to extract and completed until the text of the default font is all extracted, obtain multistage text message.
Judge that the text that the default font whether can be completely shown in the viewing area includes:
The product of the set width and the character number of the text is calculated, the total display for obtaining the text of the default font is wide Degree;
Judge whether the peak width of the viewing area is more than total display width;
When the peak width is more than total display width, determine completely show the default font in the viewing area Text;Or,
When the peak width is not more than total display width, determine completely show the predetermined word in the viewing area The text of body.
After the text for judging whether can completely to show the default font in the viewing area, this method also includes:
When it is determined that can completely show the text of the default font in the viewing area, single file shows in the viewing area Show the text of the default font.
Those skilled in the art will readily occur to its of the present invention after considering specification and putting into practice invention disclosed herein Its embodiment.The application be intended to the present invention any modification, purposes or adaptations, these modifications, purposes or Person's adaptations follow the general principle of the present invention and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and true scope and spirit of the invention are by following Claim is pointed out.
It should be appreciated that the invention is not limited in the precision architecture for being described above and being shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present invention is only limited by appended claim.

Claims (13)

1. the display methods of picture in a kind of webpage, it is characterised in that methods described includes:
When receiving the instruction of display webpage, the attribute information per pictures in the webpage is obtained, the attribute information is extremely Include the text of the corresponding viewing area of picture and picture less;
Judge whether can completely show the text of the picture in the corresponding viewing area of the picture;
When it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into predetermined word Body;
The text of default font is shown in the corresponding viewing area of picture described in the webpage;
Show that the text of default font includes in the corresponding viewing area of picture described in the webpage:
Judge whether can completely show the text of the default font in the viewing area;
When it is determined that can not completely show the text of the default font in the viewing area, the area of the viewing area is calculated The business of the font height of domain height and the default font, according to determining the business of the region height and the font height The display line number of the text of default font;
According to the peak width and the display line number, the text of the default font is divided into multistage text message, institute State that the paragraph number of multistage text message is equal with the display line number, and every section of text message display width be not more than it is described Peak width;
Show the multistage text message in lines in the viewing area.
2. according to the method described in claim 1, it is characterised in that according to the peak width and the display line number, by institute The text for stating default font is divided into multistage text message and included:
The business of the peak width and the set width is calculated, is determined according to the business of the peak width and the set width The number of characters that a line of the viewing area can completely be shown;
Character corresponding with the number of characters is repeatedly extracted from the text of the default font, multistage text message is constituted, Completed until the text of the default font is all extracted, or until extraction time reaches the display line number.
3. method according to claim 2, it is characterised in that repeatedly extracted from the text of the default font with it is described The corresponding character of number of characters, constitutes multistage text message, is completed until the text of the default font is all extracted, or Until extraction time reaches that the display line number includes:
Calculate the peak width and the product of the display line number;
Judge whether the product is more than total display width;
When the product is not more than total display width, extracted and the number of characters from the text of the default font Corresponding character, constitutes one section of text message;
Proceed to extract and stop when extraction time reaches the display line number, obtain multistage text message;
Designated word is replaced with by remaining character deletion in the text of the default font, and by the last character of extraction Symbol, the designated character is imperfect for pointing out current text to show.
4. method according to claim 3, it is characterised in that judge whether the product is more than after total display width, Methods described also includes:
When the product is more than total display width, extracted and the number of characters pair from the text of the default font The character answered, constitutes one section of text message;
Proceed to extract and completed until the text of the default font is all extracted, obtain multistage text message.
5. according to the method described in claim 1, it is characterised in that judge whether can completely show institute in the viewing area Stating the text of default font includes:
The product of the character number of the set width and the text is calculated, total display of the text of the default font is obtained Width;
Judge whether the peak width of the viewing area is more than total display width;
When the peak width is more than total display width, determine completely show described default in the viewing area The text of font;Or,
When the peak width is not more than total display width, determine completely show described pre- in the viewing area If the text of font.
6. method according to claim 5, it is characterised in that judge whether can completely show institute in the viewing area After the text for stating default font, methods described also includes:
When it is determined that can completely show the text of the default font in the viewing area, the single file in the viewing area Show the text of the default font.
7. the display device of picture in a kind of webpage, it is characterised in that described device includes:
Data obtaining module, for when receiving the instruction of display webpage, obtaining the attribute in the webpage per pictures and believing Breath, the attribute information at least includes the text of the corresponding viewing area of picture and picture;
Judge module, for judging whether can completely show the text of the picture in the corresponding viewing area of the picture;
Font adjusting module, for when it is determined that in the viewing area text completely can not be shown, by the text Font is reduced into default font;
Display module, the text for showing default font in the corresponding viewing area of picture described in the webpage;
The display module includes:
Judging unit, for judging whether can completely show the text of the default font in the viewing area;
Line number computing unit, for when it is determined that can not completely show the text of the default font in the viewing area, counting The business of the region height of the viewing area and the font height of the default font is calculated, according to the region height and the word The business of body height determines the display line number of the text of the default font;
Segmenting unit, for according to the peak width and the display line number, the text of the default font being divided into many Section text message, the paragraph number of the multistage text message is equal with the display line number, and the display of every section of text message Width is not more than the peak width;
Branch's display unit, for showing the multistage text message in lines in the viewing area.
8. device according to claim 7, it is characterised in that the segmenting unit includes:
Number of characters determination subelement, the business for calculating the peak width and the set width is wide according to the region The business of degree and the set width determines the number of characters that a line of the viewing area can completely be shown;
Character extracts subelement, for repeatedly extracting word corresponding with the number of characters from the text of the default font Symbol, constitutes multistage text message, is completed until the text of the default font is all extracted, or until extraction time reaches The display line number.
9. device according to claim 8, it is characterised in that it is wide for calculating the region that the character extracts subelement Degree and the product of the display line number;Judge whether the product is more than total display width;When the product be not more than it is described total During display width, character corresponding with the number of characters is extracted from the text of the default font, one section of text envelope is constituted Breath;Proceed to extract and stop when extraction time reaches the display line number, obtain multistage text message;Will be described default Remaining character deletion in the text of font, and the last character of extraction is replaced with into designated character, the designated character It is imperfect for pointing out current text to show.
10. device according to claim 9, it is characterised in that the character extracts subelement and is additionally operable to work as the product During more than total display width, character corresponding with the number of characters is extracted from the text of the default font, is constituted One section of text message;Proceed to extract and completed until the text of the default font is all extracted, obtain multistage text envelope Breath.
11. device according to claim 7, it is characterised in that the judging unit includes:
Overall width computation subunit, the product of the character number for calculating the set width and the text obtains described Total display width of the text of default font;
Width judgment sub-unit, for judging whether the peak width of the viewing area is more than total display width;
First determination subelement, for when the peak width is more than total display width, determining in the viewing area The text of the default font can completely be shown;Or,
Second determination subelement, for when the peak width is not more than total display width, determining the viewing area It is interior completely to show the text of the default font.
12. device according to claim 11, it is characterised in that described device also includes:
Single file display module, for when it is determined that can completely show the text of the default font in the viewing area, Single file shows the text of the default font in the viewing area.
13. the display device of picture in a kind of webpage, it is characterised in that including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
When receiving the instruction of display webpage, the attribute information per pictures in the webpage is obtained, the attribute information is extremely Include the text of the corresponding viewing area of picture and picture less;
Judge whether can completely show the text of the picture in the corresponding viewing area of the picture;
When it is determined that in the viewing area text completely can not be shown, the font of the text is reduced into predetermined word Body;
The text of default font is shown in the corresponding viewing area of picture described in the webpage;
Show that the text of default font includes in the corresponding viewing area of picture described in the webpage:
Judge whether can completely show the text of the default font in the viewing area;
When it is determined that can not completely show the text of the default font in the viewing area, the area of the viewing area is calculated The business of the font height of domain height and the default font, according to determining the business of the region height and the font height The display line number of the text of default font;
According to the peak width and the display line number, the text of the default font is divided into multistage text message, institute State that the paragraph number of multistage text message is equal with the display line number, and every section of text message display width be not more than it is described Peak width;
Show the multistage text message in lines in the viewing area.
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 CN103886025A (en) 2014-06-25
CN103886025B true 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)

Families Citing this family (11)

* 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
CN104598542B (en) * 2014-12-30 2018-12-21 广州酷狗计算机科技有限公司 The display methods and device of multimedia messages
JP2017024381A (en) * 2015-07-28 2017-02-02 東洋機械金属株式会社 Molding 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
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
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
CN114115779B (en) * 2021-11-22 2024-03-15 珠海格力电器股份有限公司 Parameter display control method and device, display panel and household appliance
CN116233540B (en) * 2023-03-10 2024-04-02 北京富通亚讯网络信息技术有限公司 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

Also Published As

Publication number Publication date
CN103886025A (en) 2014-06-25

Similar Documents

Publication Publication Date Title
CN103886025B (en) The display methods and device of picture in webpage
CN105138259B (en) Operation executes method and device
US10936798B2 (en) Text editing method, device, and electronic apparatus
US20120289290A1 (en) Transferring objects between application windows displayed on mobile terminal
CN105159871B (en) Text message detection method and device
WO2017084183A1 (en) Information displaying method and device
CN104536935B (en) Calculate display methods, calculate edit methods and device
WO2015143806A1 (en) Previous page return control method and device
CN104735243B (en) Contact list displaying method and device
CN107357779A (en) A kind of method and device for obtaining organization names
CN104156245B (en) list updating method and device
US8633895B2 (en) Apparatus and method for improving character input function in mobile terminal
KR20140016107A (en) Mobile terminal and control method thereof
CN107506246A (en) Information displaying method, device and computer-readable recording medium
CN104536787B (en) Resource preloads method and device
KR20140136820A (en) Mobile terminal and control method thereof
CN107450811A (en) Touch area amplification display method and system
CN105704322B (en) Weather information acquisition methods and device
CN106569937B (en) Page processing method and device
CN106774977A (en) Punctuation mark automatic matching method, device and terminal device
WO2022253132A1 (en) Information display method and apparatus, and electronic device
CN105022737B (en) Micro-blog method for information display and device
US9665279B2 (en) Electronic device and method for previewing content associated with an application
KR101984094B1 (en) Mobile terminal and control method thereof
CN106844717A (en) Webpage search display methods and device

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