CN104572822A - Method and device for displaying text - Google Patents

Method and device for displaying text Download PDF

Info

Publication number
CN104572822A
CN104572822A CN201410734243.8A CN201410734243A CN104572822A CN 104572822 A CN104572822 A CN 104572822A CN 201410734243 A CN201410734243 A CN 201410734243A CN 104572822 A CN104572822 A CN 104572822A
Authority
CN
China
Prior art keywords
text
content
client
style information
attribute
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
CN201410734243.8A
Other languages
Chinese (zh)
Other versions
CN104572822B (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.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201410734243.8A priority Critical patent/CN104572822B/en
Publication of CN104572822A publication Critical patent/CN104572822A/en
Application granted granted Critical
Publication of CN104572822B publication Critical patent/CN104572822B/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/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor

Abstract

The embodiment of the invention provides a method and a device for displaying a text. The method comprises the following steps of on one hand, obtaining text content and displaying type information through a server; enabling the server to send the text content and the displaying type information to a client end, and then enabling the client end to render the text content according to the displaying type information and the displaying attribute of the client end. By adopting the technical scheme, the method provided by the embodiment has the advantages that the to-be-displayed text is rendered according to the displaying type information and the displaying attribute of the client end, and the flexibility of the text displaying type is improved.

Description

Text exhibiting method and device
[technical field]
The present invention relates to Internet technical field, particularly relate to a kind of text exhibiting method and device.
[background technology]
At present, the client that terminal is installed, as browser client, news client etc., needs to represent content of text in limited representing in region, such as, and the news list shown in Fig. 1.Limited owing to representing region, so generally can only represent part content of text, remaining content of text needs to hide or block, and as shown in Figure 1, Article 2 is hidden to the part text of Article 5 headline, cannot represent completely.
In prior art, in the limited method representing part content of text that represents in region be: the content of text that needs are represented, by server, typesetting calculating carried out to word, such as, represent width according to different literals, calculate in predetermined width the number of the word that can represent; Then, server will need the pattern of text represented, and as number, the line number etc. of word that can represent of the word that can represent, send to client.So for different clients, the pattern that represents of the word obtained from server is all the same, and server can not provide according to client and represent pattern for this client, and therefore, the dirigibility of this ways of presentation is lower.
[summary of the invention]
In view of this, embodiments providing a kind of text exhibiting method and device, by client playing up the text that needs represent according to the display properties representing style information and client self, the dirigibility that text represents pattern can be improved.
The one side of the embodiment of the present invention, provides a kind of text exhibiting method, comprising:
Server obtains content of text and represents style information;
Described server sends described content of text to client and describedly represents style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, and described server sends described content of text to client and describedly represents style information, comprising:
Described server sends HTML (Hypertext Markup Language) html file and pattern file to described client, and described html file comprises described content of text, represents style information described in described pattern file comprises; Or,
Described server sends html file to described client, and described html file comprises described content of text; Described server receives the pattern request that described client sends, and sends pattern file according to described pattern request to described client, represents style information described in described pattern file comprises; Or,
Described server sends html file to described client, and described html file comprises described content of text and describedly represents style information.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
The one side of the embodiment of the present invention, provides a kind of text exhibiting method, comprising:
Client reception server send content of text and represent style information;
Represent the display properties of style information and described client described in described client foundation, described content of text is played up.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, the content of text that described client reception server sends and represent style information, comprising:
Described client sends HTTP HTTP request to described server, so that represent style information described in the acquisition of described server, and obtains described content of text according to described HTTP request;
Described client receives HTML (Hypertext Markup Language) html file and the pattern file of the transmission of described server, and described html file comprises described content of text, represents style information described in described pattern file comprises; Or described client receives the html file that described server sends, described html file comprises described content of text and describedly represents style information.
Aspect as above and arbitrary possible implementation, provide a kind of implementation further, the content of text that described client reception server sends and represent style information, comprising:
Described client sends HTTP request, so that described server obtains described content of text according to described HTTP request to described server;
Described client receives the html file that described server sends, and described html file comprises described content of text;
Described client sends pattern request to described server, so that described server obtains according to described pattern request represent style information;
Described client receives the pattern file that described server sends, and represents style information described in described pattern file comprises.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the display properties of described client is the size of display box in described client, the display properties of style information and described client is represented described in described client foundation, described content of text is played up, comprising:
Represent the size of display box in style information and described client described in described client foundation, typesetting is carried out to described content of text;
The described content of text that described client obtains after representing typesetting.
The one side of the embodiment of the present invention, provide a kind of text demonstration device, described device is positioned at server, comprising:
Processing unit, for obtaining content of text and representing style information;
Output unit, for sending described content of text to client and describedly representing style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described output unit further, specifically for:
Send HTML (Hypertext Markup Language) html file and pattern file to described client, described html file comprises described content of text, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text; Described server receives the pattern request that described client sends, and sends pattern file according to described pattern request to described client, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text and describedly represents style information.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
The one side of the embodiment of the present invention, provide a kind of text demonstration device, described device is positioned at client, comprising:
Input-output unit, for reception server send content of text and represent style information;
Content rendering unit, for representing the display properties of style information and described client described in foundation, plays up described content of text.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described input-output unit further, specifically for:
Send HTTP HTTP request to described server, so that represent style information described in the acquisition of described server, and obtain described content of text according to described HTTP request;
Receive HTML (Hypertext Markup Language) html file and the pattern file of the transmission of described server, described html file comprises described content of text, represents style information described in described pattern file comprises; Or receive the html file that described server sends, described html file comprises described content of text and describedly represents style information.
Aspect as above and arbitrary possible implementation, provide a kind of implementation, described input-output unit further, specifically for:
HTTP request is sent, so that described server obtains described content of text according to described HTTP request to described server;
Receive the html file that described server sends, described html file comprises described content of text;
Pattern request is sent, so that described server obtains according to described pattern request represent style information to described server;
Receive the pattern file that described server sends, described in described pattern file comprises, represent style information.
Aspect as above and arbitrary possible implementation, a kind of implementation is provided further, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
As can be seen from the above technical solutions, the embodiment of the present invention has following beneficial effect:
The embodiment of the present invention obtains content of text by server and represents style information; Thus described server sends described content of text to client and describedly represents style information; And then, described client according to the described display properties representing style information and described client, can be played up described content of text.Compared with prior art, the technical scheme that the embodiment of the present invention provides can played up the text that needs represent according to the display properties representing style information and client self by client, therefore, it is possible to solution must not provide the problem representing pattern for client according to client, can realize adaptively carrying out intercepting to content of text and representing, thus the dirigibility that text represents pattern can be improved.
[accompanying drawing explanation]
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 represents the exemplary plot only representing part content of text in region in prior art;
Fig. 2 is the exemplary system figure of the technical scheme use that the embodiment of the present invention provides;
Fig. 3 is the schematic flow sheet of the embodiment one of the text exhibiting method that the embodiment of the present invention provides;
Fig. 4 is the schematic flow sheet of the embodiment two of the text exhibiting method that the embodiment of the present invention provides;
Fig. 5 is the first exemplary plot that client that the embodiment of the present invention provides only represents segment word;
Fig. 6 is the second exemplary plot that client that the embodiment of the present invention provides only represents segment word;
Fig. 7 is the functional block diagram of the embodiment one of the text demonstration device that the embodiment of the present invention provides;
Fig. 8 is the functional block diagram of the embodiment two of the text demonstration device that the embodiment of the present invention provides.
[embodiment]
Technical scheme for a better understanding of the present invention, is described in detail the embodiment of the present invention below in conjunction with accompanying drawing.
Should be clear and definite, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The term used in embodiments of the present invention is only for the object describing specific embodiment, and not intended to be limiting the present invention." one ", " described " and " being somebody's turn to do " of the singulative used in the embodiment of the present invention and appended claims is also intended to comprise most form, unless context clearly represents other implications.
Should be appreciated that term "and/or" used herein is only a kind of incidence relation describing affiliated partner, can there are three kinds of relations in expression, and such as, A and/or B, can represent: individualism A, exists A and B simultaneously, these three kinds of situations of individualism B.In addition, character "/" herein, general expression forward-backward correlation is to the relation liking a kind of "or".
Depend on linguistic context, word as used in this " if " can be construed as into " ... time " or " when ... time " or " in response to determining " or " in response to detection ".Similarly, depend on linguistic context, phrase " if determination " or " if detecting (the conditioned disjunction event of statement) " can be construed as " when determining " or " in response to determining " or " when detecting (the conditioned disjunction event of statement) " or " in response to detection (the conditioned disjunction event of statement) ".
The system that the technical scheme that the embodiment of the present invention provides uses as shown in Figure 2, forms primarily of client and server.
The embodiment of the present invention provides a kind of text exhibiting method, please refer to Fig. 3, and the schematic flow sheet of the embodiment one of its text exhibiting method provided for the embodiment of the present invention, the method is the implementation method of server side.As shown in the figure, the method comprises the following steps:
S301, server obtains content of text and represents style information.
S302, described server sends described content of text to client and describedly represents style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
Preferably, server obtains content of text and represent style information, and sends described content of text to client and the described method representing style information can include but not limited to following three kinds:
The first: first, server receives client, as the network in browser, HTTP (Hypertext Transfer Protocol, the HTTP) request of transmission, comprises the identifier of resource in this HTTP request.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, and represent the configuration file of pattern to obtain represent style information from the text preset, this represents style information and comprises the information representing pattern being used to indicate text content, server can represent style information by this, controls client and uses which kind of pattern to carry out typesetting to content of text.
Finally, described server sends HTML (Hypertext Markup Language) (Hypertext Mark-upLanguage, HTML) file and pattern file to described client, wherein, carried the content of text of acquisition by this html file, that carries acquisition by this pattern file represents style information.
Be understandable that, in this method, server is that html file and pattern file are supplied to client in the lump.
The second: first, server receives client, as the network in browser, the HTTP request of transmission, comprises the identifier of resource in this HTTP request.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, then sends html file to described client, and is carried the text content of acquisition by this html file.
Finally, described server receives the pattern request that described client sends, then server is according to this pattern request, know that client needs acquisition to represent style information, so server represents the configuration file of pattern to obtain from the text preset represent style information, then send pattern file to described client, and carry acquisition by this pattern file represent style information.
Be understandable that, in this method, server is separated with pattern file by html file to be supplied to client, and pattern file wherein can be just be supplied to client after the pattern request receiving client.
The third: first, server receives client, as the network in browser, the HTTP request of transmission, comprises the identifier of resource in this HTTP request.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, and represent the configuration file of pattern to obtain represent style information from the text preset, this represents style information and comprises the information representing pattern being used to indicate text content, server can represent style information by this, controls client and uses which kind of pattern to carry out typesetting to content of text.
Finally, described server sends html file to described client, wherein, carries the content of text of acquisition and represent style information by this html file.
Be understandable that, do not use independent pattern file to carry in this method and represent style information, but carry this by html file and represent style information and content of text.
Preferably, in the embodiment of the present invention, described in represent style information and comprise at least one in following Style Attributes: be used to indicate attribute that whether content of text carry out entering a new line, be used to indicate whether hide when content of text overflows display box attribute, be used to indicate whether to show when content of text overflows display box omit mark attribute, be used to indicate the high attribute of the row of content of text, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
It should be noted that, the executive agent of S301 ~ S302 can be text demonstration device, and this device can be positioned at server.
Please refer to Fig. 4, the schematic flow sheet of the embodiment two of its text exhibiting method provided for the embodiment of the present invention, the method is the implementation method of client-side.As shown in the figure, the method comprises the following steps:
S401, client reception server send content of text and represent style information.
S402, represents the display properties of style information and described client, plays up described content of text described in described client foundation.
Preferably, the content of text that described client reception server sends can include but not limited to following three kinds of methods with the method representing style information:
The first: client, as the network in browser, HTTP request can be sent to described server, the identifier of resource is comprised in this HTTP request, so that described server represents the configuration file of pattern to obtain from the text preset represent style information, this represents style information and comprises the information representing pattern being used to indicate text content, and client can represent style information according to this, determines to use which kind of pattern to carry out typesetting to content of text.And server, according to the identifier of the resource in described HTTP request, obtains corresponding content of text.
Described client receives html file and the pattern file of the transmission of described server, and described html file comprises described content of text, represents style information described in described pattern file comprises.
In this method, client receives html file and pattern file from server simultaneously.
The second: client, as the network in browser, send HTTP request to server, comprise the identifier of resource in this HTTP request, so that server is according to the identifier of the resource in this HTTP request, obtain corresponding content of text, then send html file to client, carry the content of text of acquisition in this html file, like this, client just can receive the html file that server sends, from html file, obtain content of text.Then, this user end to server sends pattern request, so that server is according to described pattern request, represents the configuration file of pattern to obtain represent style information from the text preset, then send pattern file to client, what this pattern file carried acquisition represents style information.Like this, this client just can receive the pattern file that server sends, and obtains from this pattern file and represent style information.
It should be noted that, in this method, client obtains html file and pattern file from server, is separately to obtain, and pattern file wherein can just to server request after receiving content of text.
The third: client, as the network in browser, HTTP request can be sent to described server, the identifier of resource is comprised in this HTTP request, so that described server represents the configuration file of pattern to obtain from the text preset represent style information, this represents style information and comprises the information representing pattern being used to indicate text content, and client can represent style information according to this, determines to use which kind of pattern to carry out typesetting to content of text.And server, according to the identifier of the resource in described HTTP request, obtains corresponding content of text.
Described client receive described server send html file, described html file comprise described content of text and described in represent style information.
Preferably, represent style information described in and comprise at least one in following Style Attributes: be used to indicate attribute that whether content of text carry out entering a new line, be used to indicate whether hide when content of text overflows display box attribute, be used to indicate whether to show when content of text overflows display box omit mark attribute, be used to indicate the high attribute of the row of content of text, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
Preferably, if the display properties of described client is the size of display box in described client, represent style information described in described client foundation can include but not limited to the method that described content of text is played up: described client, as the render engine in browser client, after obtaining from server and representing style information, just can know and how typesetting is carried out to content of text, thus the size of display box in style information and client can be represented according to this, perform and the typesetting of content of text is operated, such as, hide the content of text outside display box, add after last word of display and omit mark etc., then the content of text that obtains after just can representing typesetting of client, thus realize the Rendering operations of content of text.
It should be noted that, the executive agent of S401 ~ S402 can be text demonstration device, this device can be positioned at the application of local terminal, or can also for being arranged in plug-in unit or SDK (Software Development Kit) (the Software Development Kit of the application of local terminal, the functional unit such as SDK), the embodiment of the present invention is not particularly limited this.
Be understandable that, described application can be mounted in the application program (nativeApp) in terminal, or can also be a web page program (webApp) of browser in terminal, and the embodiment of the present invention does not limit this.
It should be noted that, terminal involved in the embodiment of the present invention can include but not limited to personal computer (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), radio hand-held equipment, panel computer (Tablet Computer), mobile phone, MP3 player, MP4 player etc.
For representing style information in above-described embodiment one and embodiment two, comprising Cascading Style Sheet (Cascading Style Sheets, CSS) attribute to represent in style information below, content of text be that single file text is described:
Being used to indicate the attribute whether content of text carry out entering a new line can be white-space attribute.If need to control content of text not enter a new line, then white-space attribute can be configured to: white-space:nowrap.
Being used to indicate the attribute whether hidden when content of text overflows display box can be overflow attribute.If need to control content of text needs when overflowing display box to hide the content of text overflowed, then overflow attribute can be configured to: overflow:hidden.
Being used to indicate the attribute whether showing omission mark when content of text overflows display box can be text-overflow attribute.If need to control content of text to show omission mark when overflowing display box after last word of display, then text-overflow attribute can be configured to: text-overflow:ellipsis.
Being used to indicate the high attribute of the row of content of text can be line-height attribute.If need the line height controlling content of text, then need for line-height attribute configuration numerical value, this numerical value is for representing the line height of content of text, and such as line-height attribute can be configured to: line-height:25px, 25px represent that line height is 25 pixels.It should be noted that, if single file text, then the line height of single file text can be identical with the height of display box in client.
For representing style information in above-described embodiment one and embodiment two, comprising CSS attribute to represent in style information below, content of text be that multiline text is described:
Being used to indicate the high attribute of the row of content of text can be line-height attribute.If need to control often to compose a piece of writing in content of text line height originally, then need for line-height attribute configuration numerical value, this numerical value is for representing line height originally of often composing a piece of writing, and such as line-height attribute can be configured to: line-height:25px, 25px represent that line height is 25 pixels.It should be noted that, if multiline text, then the line height of multiline text can equal the ratio of display box height and text line number.
Being used to indicate the attribute whether hidden when content of text overflows display box can be overflow attribute.If need to control content of text needs when overflowing display box to hide the content of text overflowed, then overflow attribute can be configured to: overflow:hidden.It should be noted that, if multiline text, then need to control content of text and automatically enter a new line, when content of text overflows the lower limb of display box, need last at least one row content of text of hidden text content.As shown in Figure 5 and Figure 6, content of text can be controlled and after last word of display, show suspension points when overflowing display box.
The attribute being used to indicate the type of content of text place display box can be display attribute.If need the type controlling content of text place display box to be BOX Model, then display attribute can be configured to display:-webkit-box.Wherein, after being configured to BOX Model, display box can take the display screen of terminal.
The attribute being used to indicate the arrangement mode of content of text can be-webkit-box-orient attribute, and the arrangement mode of content of text can comprise homeotropic alignment with horizontal.Such as, if need to control content of text homeotropic alignment in display box, then-webkit-box-orient attribute can be configured to-webkit-box-orient:vertical.
The attribute being used to indicate the shown line number of content of text can be-webkit-line-clamp attribute.If need the line number that can show controlling content of text, need for-webkit-line-clamp attribute configuration numerical value, this numerical value is used to indicate the line number threshold value of the content of text that can show in display box, and the content of text needs exceeding this line number in content of text omit.Such as ,-webkit-line-clamp attribute can be configured to-webkit-line-clamp:4, represents that the line number of the content of text of display in display box is 4, and the content of text from the 5th row omits and do not show.
The embodiment of the present invention provides the device embodiment realizing each step and method in said method embodiment further.
Please refer to Fig. 7, the functional block diagram of the embodiment one of its text demonstration device provided for the embodiment of the present invention.As shown in the figure, this device is positioned at server side, and this device comprises:
Processing unit 701, for obtaining content of text and representing style information;
Output unit 702, for sending described content of text to client and describedly representing style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
Preferably, described output unit 702, specifically for:
Send HTML (Hypertext Markup Language) html file and pattern file to described client, described html file comprises described content of text, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text; Described server receives the pattern request that described client sends, and sends pattern file according to described pattern request to described client, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text and describedly represents style information.
Preferably, represent style information described in and comprise at least one in following Style Attributes: be used to indicate attribute that whether content of text carry out entering a new line, be used to indicate whether hide when content of text overflows display box attribute, be used to indicate whether to show when content of text overflows display box omit mark attribute, be used to indicate the high attribute of the row of content of text, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
Because each unit in the present embodiment can perform the method shown in Fig. 2, the part that the present embodiment is not described in detail, can with reference to the related description to Fig. 2.
Please refer to Fig. 8, the functional block diagram of the embodiment two of its text demonstration device provided for the embodiment of the present invention.As shown in the figure, this device is positioned at client-side, and this device comprises:
Input-output unit 801, for reception server send content of text and represent style information;
Content rendering unit 802, for representing the display properties of style information and described client described in foundation, plays up described content of text.
Preferably, described input-output unit 801, specifically for:
Send HTTP HTTP request to described server, so that represent style information described in the acquisition of described server, and obtain described content of text according to described HTTP request;
Receive HTML (Hypertext Markup Language) html file and the pattern file of the transmission of described server, described html file comprises described content of text, represents style information described in described pattern file comprises; Or receive the html file that described server sends, described html file comprises described content of text and describedly represents style information.
Preferably, described input-output unit 801, specifically for:
HTTP request is sent, so that described server obtains described content of text according to described HTTP request to described server;
Receive the html file that described server sends, described html file comprises described content of text;
Pattern request is sent, so that described server obtains according to described pattern request represent style information to described server;
Receive the pattern file that described server sends, described in described pattern file comprises, represent style information.
Preferably, represent style information described in and comprise at least one in following Style Attributes: be used to indicate attribute that whether content of text carry out entering a new line, be used to indicate whether hide when content of text overflows display box attribute, be used to indicate whether to show when content of text overflows display box omit mark attribute, be used to indicate the high attribute of the row of content of text, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
Preferably, the display properties of described client is the size of display box in described client, described content rendering unit 802, specifically for:
Represent the size of display box in style information and described client described in foundation, typesetting is carried out to described content of text;
The described content of text obtained after representing typesetting.
Because each unit in the present embodiment can perform the method shown in Fig. 3, the part that the present embodiment is not described in detail, can with reference to the related description to Fig. 3.
The technical scheme of the embodiment of the present invention has following beneficial effect:
The embodiment of the present invention obtains content of text by server and represents style information; Thus described server sends described content of text to client and describedly represents style information; And then, described client according to the described display properties representing style information and described client, can be played up described content of text.
Compared with prior art, the technical scheme that the embodiment of the present invention provides can played up the text that needs represent according to the display properties representing style information and client self by client, therefore, it is possible to solution must not provide the problem representing pattern for client according to client, can realize adaptively carrying out intercepting to content of text and representing, thus the dirigibility that text represents pattern can be improved.
In addition, for the content of text needing to represent, by client, typesetting calculating is carried out to word, the processing pressure that server calculates the typesetting of content of text can be reduced, alleviate server burden.
And, in prior art, represent style information, as CSS attribute, be pre-configured in client this locality, like this, when client obtains from server the content of text needing display, what just can store according to this locality represents style information, realizes the typesetting of content of text and represents.But, in this technical scheme, the file representing style information place is generally be stored in client place terminal as temporary file, represent style information place file so just likely to be cleaned out when clearing up temporary file by the fail-safe software that terminal is installed, cause the loss representing style information, thus need to reconfigure.In addition, when representing style information needs and upgrading, the display size as client changes, text represents demand when changing, need manually to carry out representing reconfiguring of style information, therefore the flexibility ratio of this mode is lower, upgrades more inconvenient, upgrades efficiency comparison low.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiment provided by the present invention, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, is only a kind of logic function and divides, and actual can have other dividing mode when realizing, such as, multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form that hardware also can be adopted to add SFU software functional unit realizes.
The above-mentioned integrated unit realized with the form of SFU software functional unit, can be stored in a computer read/write memory medium.Above-mentioned SFU software functional unit is stored in a storage medium, comprising some instructions in order to make a computer installation (can be personal computer, server, or network equipment etc.) or processor (Processor) perform the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (16)

1. a text exhibiting method, is characterized in that, described method comprises:
Server obtains content of text and represents style information;
Described server sends described content of text to client and describedly represents style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
2. method according to claim 1, is characterized in that, described server sends described content of text to client and describedly represents style information, comprising:
Described server sends HTML (Hypertext Markup Language) html file and pattern file to described client, and described html file comprises described content of text, represents style information described in described pattern file comprises; Or,
Described server sends html file to described client, and described html file comprises described content of text; Described server receives the pattern request that described client sends, and sends pattern file according to described pattern request to described client, represents style information described in described pattern file comprises; Or,
Described server sends html file to described client, and described html file comprises described content of text and describedly represents style information.
3. method according to claim 1 and 2, it is characterized in that, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
4. a text exhibiting method, is characterized in that, described method comprises:
Client reception server send content of text and represent style information;
Represent the display properties of style information and described client described in described client foundation, described content of text is played up.
5. method according to claim 4, is characterized in that, the content of text that described client reception server sends and represent style information, comprising:
Described client sends HTTP HTTP request to described server, so that represent style information described in the acquisition of described server, and obtains described content of text according to described HTTP request;
Described client receives HTML (Hypertext Markup Language) html file and the pattern file of the transmission of described server, and described html file comprises described content of text, represents style information described in described pattern file comprises; Or described client receives the html file that described server sends, described html file comprises described content of text and describedly represents style information.
6. method according to claim 4, is characterized in that, the content of text that described client reception server sends and represent style information, comprising:
Described client sends HTTP request, so that described server obtains described content of text according to described HTTP request to described server;
Described client receives the html file that described server sends, and described html file comprises described content of text;
Described client sends pattern request to described server, so that described server obtains according to described pattern request represent style information;
Described client receives the pattern file that described server sends, and represents style information described in described pattern file comprises.
7. the method according to any one of claim 4 to 6, it is characterized in that, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
8. method according to claim 4, it is characterized in that, the display properties of described client is the size of display box in described client, represents the display properties of style information and described client described in described client foundation, described content of text is played up, comprising:
Represent the size of display box in style information and described client described in described client foundation, typesetting is carried out to described content of text;
The described content of text that described client obtains after representing typesetting.
9. a text demonstration device, is characterized in that, described device is positioned at server, and described device comprises:
Processing unit, for obtaining content of text and representing style information;
Output unit, for sending described content of text to client and describedly representing style information so that described client according to described in represent the display properties of style information and described client, described content of text is played up.
10. device according to claim 9, is characterized in that, described output unit, specifically for:
Send HTML (Hypertext Markup Language) html file and pattern file to described client, described html file comprises described content of text, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text; Described server receives the pattern request that described client sends, and sends pattern file according to described pattern request to described client, represents style information described in described pattern file comprises; Or,
Send html file to described client, described html file comprises described content of text and describedly represents style information.
11. devices according to claim 9 or 10, it is characterized in that, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
12. 1 kinds of text demonstration devices, it is characterized in that, described device is positioned at client, described device comprises:
Input-output unit, for reception server send content of text and represent style information;
Content rendering unit, for representing the display properties of style information and described client described in foundation, plays up described content of text.
13. devices according to claim 12, is characterized in that, described input-output unit, specifically for:
Send HTTP HTTP request to described server, so that represent style information described in the acquisition of described server, and obtain described content of text according to described HTTP request;
Receive HTML (Hypertext Markup Language) html file and the pattern file of the transmission of described server, described html file comprises described content of text, represents style information described in described pattern file comprises; Or receive the html file that described server sends, described html file comprises described content of text and describedly represents style information.
14. devices according to claim 12, is characterized in that, described input-output unit, specifically for:
HTTP request is sent, so that described server obtains described content of text according to described HTTP request to described server;
Receive the html file that described server sends, described html file comprises described content of text;
Pattern request is sent, so that described server obtains according to described pattern request represent style information to described server;
Receive the pattern file that described server sends, described in described pattern file comprises, represent style information.
15. according to claim 12 to the device according to any one of 14, it is characterized in that, the described style information that represents comprises at least one in following Style Attributes: be used to indicate the attribute whether content of text carries out entering a new line, be used to indicate the attribute whether hidden when content of text overflows display box, be used to indicate when content of text overflows display box and whether show the attribute omitting mark, be used to indicate the attribute that the row of content of text is high, be used to indicate the attribute of the type of content of text place display box, be used to indicate the attribute of the arrangement mode of content of text, be used to indicate the attribute of the shown line number of content of text.
16. devices according to claim 12, is characterized in that, the display properties of described client is the size of display box in described client, described content rendering unit, specifically for:
Represent the size of display box in style information and described client described in foundation, typesetting is carried out to described content of text;
The described content of text obtained after representing typesetting.
CN201410734243.8A 2014-12-04 2014-12-04 Text shows method and device Active CN104572822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410734243.8A CN104572822B (en) 2014-12-04 2014-12-04 Text shows method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410734243.8A CN104572822B (en) 2014-12-04 2014-12-04 Text shows method and device

Publications (2)

Publication Number Publication Date
CN104572822A true CN104572822A (en) 2015-04-29
CN104572822B CN104572822B (en) 2018-09-04

Family

ID=53088884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410734243.8A Active CN104572822B (en) 2014-12-04 2014-12-04 Text shows method and device

Country Status (1)

Country Link
CN (1) CN104572822B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955637A (en) * 2016-04-25 2016-09-21 北京小米移动软件有限公司 Method and apparatus for processing a text input box
CN106656743A (en) * 2016-10-08 2017-05-10 腾讯科技(深圳)有限公司 Message display method, device and system
CN106708852A (en) * 2015-11-13 2017-05-24 阿里巴巴集团控股有限公司 Client long text display method and apparatus
CN107590118A (en) * 2017-08-03 2018-01-16 天脉聚源(北京)传媒科技有限公司 A kind of method and device of the intelligent typesetting of news
CN109640148A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 A kind of method and device by text box text exhibition content
CN109863527A (en) * 2016-12-30 2019-06-07 谷歌有限责任公司 The method and system of the server side rendering of local content for showing
CN110020289A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 Text display method, device and equipment in a kind of browser
CN110929188A (en) * 2018-09-19 2020-03-27 北京国双科技有限公司 Method and device for rendering server page
CN111460349A (en) * 2020-03-31 2020-07-28 北京金山云网络技术有限公司 Text display method and device and user terminal
CN111915705A (en) * 2019-05-07 2020-11-10 百度在线网络技术(北京)有限公司 Picture visual editing method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310415A (en) * 2000-02-24 2001-08-29 国际商业机器公司 Custom HTML of service device terminal based on form and a target equipment
CN1826600A (en) * 2003-06-30 2006-08-30 国际商业机器公司 A method and system for improving presentation of html pages in web devices
US20060230344A1 (en) * 2005-04-07 2006-10-12 Microsoft Corporation Browser sensitive web content delivery
CN103412928A (en) * 2013-08-16 2013-11-27 北京乐动卓越科技有限公司 Method and device for realizing browser page intelligent response-type layout on mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310415A (en) * 2000-02-24 2001-08-29 国际商业机器公司 Custom HTML of service device terminal based on form and a target equipment
CN1826600A (en) * 2003-06-30 2006-08-30 国际商业机器公司 A method and system for improving presentation of html pages in web devices
US20060230344A1 (en) * 2005-04-07 2006-10-12 Microsoft Corporation Browser sensitive web content delivery
CN103412928A (en) * 2013-08-16 2013-11-27 北京乐动卓越科技有限公司 Method and device for realizing browser page intelligent response-type layout on mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
阮一峰: "自适应网页设计(Responsive Web Design),", 《HTTP://WWW.RUANYIFENG.COM/BLOG/2012/05/RESPONSIVE_WEB_DESIGN.HTML》 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708852A (en) * 2015-11-13 2017-05-24 阿里巴巴集团控股有限公司 Client long text display method and apparatus
CN105955637A (en) * 2016-04-25 2016-09-21 北京小米移动软件有限公司 Method and apparatus for processing a text input box
CN105955637B (en) * 2016-04-25 2020-06-19 北京小米移动软件有限公司 Method and device for processing text input box
CN106656743B (en) * 2016-10-08 2020-02-14 腾讯科技(深圳)有限公司 Message display method, device and system
CN106656743A (en) * 2016-10-08 2017-05-10 腾讯科技(深圳)有限公司 Message display method, device and system
CN109863527B (en) * 2016-12-30 2023-04-04 谷歌有限责任公司 Method and system for server-side rendering of rendered local content
CN109863527A (en) * 2016-12-30 2019-06-07 谷歌有限责任公司 The method and system of the server side rendering of local content for showing
CN107590118A (en) * 2017-08-03 2018-01-16 天脉聚源(北京)传媒科技有限公司 A kind of method and device of the intelligent typesetting of news
CN110020289A (en) * 2017-09-30 2019-07-16 北京国双科技有限公司 Text display method, device and equipment in a kind of browser
CN109640148A (en) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 A kind of method and device by text box text exhibition content
CN110929188A (en) * 2018-09-19 2020-03-27 北京国双科技有限公司 Method and device for rendering server page
CN111915705A (en) * 2019-05-07 2020-11-10 百度在线网络技术(北京)有限公司 Picture visual editing method, device, equipment and medium
CN111915705B (en) * 2019-05-07 2023-07-28 百度在线网络技术(北京)有限公司 Picture visual editing method, device, equipment and medium
CN111460349A (en) * 2020-03-31 2020-07-28 北京金山云网络技术有限公司 Text display method and device and user terminal

Also Published As

Publication number Publication date
CN104572822B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN104572822A (en) Method and device for displaying text
CN106462403B (en) Pre-acquiring grid blocks according to user intention
AU2011101579B4 (en) Selective rendering of off-screen content
KR102132137B1 (en) Custom optimization of web pages
CN107656768B (en) Method and system for controlling page jump
US20120240063A1 (en) Web site sectioning for mobile web browser usability
CN104636434A (en) Search result processing method and device
CN103268257A (en) Hardware resource access system and method for accessing hardware resource of electric device
CN104572843A (en) Page loading method and device
US10620803B2 (en) Selecting at least one graphical user interface item
CN103076955B (en) Method, device and terminal for adjusting characters of application
CN104113567A (en) Content distribution network data processing method, device and system
CN104765539A (en) Message display method and device
US11113455B2 (en) Web page rendering on wireless devices
CN111651700B (en) Message display method and device, electronic equipment and storage medium
US20140304580A1 (en) Adjusting layout size of hyperlink
CN104598571A (en) Method and device for playing multimedia resource
US20150199329A1 (en) Text display method and apparatus of electronic device
CN115309470A (en) Method, device and equipment for loading widgets and storage medium
CN105205100A (en) Data synchronization method based on MTP between terminals and terminals
EP3043251A1 (en) Method of displaying content and electronic device implementing same
US20160192106A1 (en) Lightweight application integration for mobile cloud computing
CN102469109B (en) Display method of browser homepage in mobile terminal and apparatus thereof
CN116578219A (en) Form page self-adaptive display method and device suitable for left and right double screens, computer equipment and computer readable storage medium
EP3559826B1 (en) Method and system providing contextual functionality in static web pages

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