CN104572822B - Text shows method and device - Google Patents

Text shows method and device Download PDF

Info

Publication number
CN104572822B
CN104572822B CN201410734243.8A CN201410734243A CN104572822B CN 104572822 B CN104572822 B CN 104572822B CN 201410734243 A CN201410734243 A CN 201410734243A CN 104572822 B CN104572822 B CN 104572822B
Authority
CN
China
Prior art keywords
text
content
client
server
style information
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
CN201410734243.8A
Other languages
Chinese (zh)
Other versions
CN104572822A (en
Inventor
郝茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

An embodiment of the present invention provides a kind of texts to show method and device.On the one hand, the embodiment of the present invention obtains content of text by server and shows style information;To which, the server sends the content of text to client and described shows style information;In turn so that the client can render the content of text according to the display properties for showing style information and the client.Therefore, technical solution provided in an embodiment of the present invention can be rendered by client in the text showed to needs according to the display properties for showing style information and client itself, can improve the flexibility that text shows pattern.

Description

Text shows method and device
【Technical field】
The present invention relates to Internet technical fields more particularly to a kind of text to show method and device.
【Background technology】
Currently, the client installed in terminal, such as browser client, news client, it needs to show limited Show content of text in region, for example, news list shown in FIG. 1.It is limited due to showing region, so can only generally show portion Non-textual content, remaining content of text needs to hide or block, as shown in Figure 1, Article 2 is to Article 5 headline Part text is hidden, and can not be showed completely.
In the prior art, it is limited show show the method for part content of text in region and be:Needs are showed Content of text carries out typesetting calculating by server to word, for example, the width that shows according to different literals, calculates predetermined width The number of the interior word that can show;Then, server will need the pattern of the text showed, the number for the word that can such as show The line number etc. of mesh, the word that can show, is sent to client.So for different clients, the text that is obtained from server The pattern that shows of word is the same, and server cannot be provided according to client shows pattern for the client, therefore, this The flexibility of kind ways of presentation is relatively low.
【Invention content】
In view of this, an embodiment of the present invention provides a kind of texts to show method and device, showed in foundation by client The text that style information and the display properties of client itself show needs renders, and can improve text and show pattern Flexibility.
The one side of the embodiment of the present invention provides a kind of text and shows method, including:
Server obtains content of text and shows style information;
The server to client send the content of text and it is described show style information, in order to the client Show style information and the display properties of the client according to described in, the content of text is rendered.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the server To client send the content of text and it is described show style information, including:
The server sends hypertext markup language html file and pattern file, the HTML texts to the client Part includes the content of text, and the pattern file shows style information comprising described;Alternatively,
The server sends html file to the client, and the html file includes the content of text;It is described Server receives the pattern request that the client is sent, and is asked to client transmission pattern text according to the pattern Part, the pattern file show style information comprising described;Alternatively,
The server sends html file to the client, and the html file includes the content of text and described Show style information.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, it is described to show sample Formula information includes at least one in following Style Attributes:It is used to indicate attribute that whether content of text enter a new line, is used to indicate Content of text overflows the attribute whether hidden when display box, is used to indicate whether show omission mark when content of text overflows display box The high attribute of the attribute of note, the row for being used to indicate content of text, be used to indicate display box where content of text type attribute, The attribute for showing line number for being used to indicate the attribute of the arrangement mode of content of text, being used to indicate content of text.
The one side of the embodiment of the present invention provides a kind of text and shows method, including:
Client receives the content of text and show style information that server is sent;
The client shows style information and the display properties of the client according to described in, to the content of text It is rendered.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the client The content of text and show style information that server is sent are received, including:
The client sends hypertext transfer protocol HTTP request to the server, in order to which the server obtains It is described to show style information, and obtain the content of text according to the HTTP request;
The client receives the hypertext markup language html file and pattern file that the server is sent, described Html file includes the content of text, and the pattern file shows style information comprising described;Alternatively, the client receives The html file that the server is sent, the html file include the content of text and described show style information.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the client The content of text and show style information that server is sent are received, including:
The client sends HTTP request to the server, in order to which the server is obtained according to the HTTP request Obtain the content of text;
The client receives the html file that the server is sent, and the html file includes the content of text;
The client sends pattern request to the server, in order to which the server is obtained according to pattern request Style information must be showed;
The client receives the pattern file that the server is sent, and the pattern file includes that the pattern that shows is believed Breath.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, it is described to show sample Formula information includes at least one in following Style Attributes:It is used to indicate attribute that whether content of text enter a new line, is used to indicate Content of text overflows the attribute whether hidden when display box, is used to indicate whether show omission mark when content of text overflows display box The high attribute of the attribute of note, the row for being used to indicate content of text, be used to indicate display box where content of text type attribute, The attribute for showing line number for being used to indicate the attribute of the arrangement mode of content of text, being used to indicate content of text.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the client Display properties be display box in the client size, the client shows style information and the visitor according to described in The display properties at family end renders the content of text, including:
The client shows the size of display box in style information and the client according to described in, in the text Hold and carries out typesetting;
The client shows the content of text obtained after typesetting.
The one side of the embodiment of the present invention provides a kind of text demonstration device, and described device is located at server, including:
Processing unit, for obtaining content of text and showing style information;
Output unit, for client send the content of text and it is described show style information, in order to the visitor Family end shows style information and the display properties of the client according to described in, is rendered to the content of text.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the output are single Member is specifically used for:
Hypertext markup language html file and pattern file are sent to the client, the html file includes described Content of text, the pattern file show style information comprising described;Alternatively,
Html file is sent to the client, the html file includes the content of text;The server receives The pattern request that the client is sent, and asked to client transmission pattern file, the sample according to the pattern Formula file shows style information described in including;Alternatively,
Html file is sent to the client, the html file includes that the content of text and the pattern that shows are believed Breath.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, it is described to show sample Formula information includes at least one in following Style Attributes:It is used to indicate attribute that whether content of text enter a new line, is used to indicate Content of text overflows the attribute whether hidden when display box, is used to indicate whether show omission mark when content of text overflows display box The high attribute of the attribute of note, the row for being used to indicate content of text, be used to indicate display box where content of text type attribute, The attribute for showing line number for being used to indicate the attribute of the arrangement mode of content of text, being used to indicate content of text.
The one side of the embodiment of the present invention provides a kind of text demonstration device, and described device is located at client, including:
Input-output unit, for receiving the content of text and show style information that server is sent;
Content rendering unit, for showing style information and the display properties of the client according to described in, to described Content of text is rendered.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the input are defeated Go out unit, is specifically used for:
Hypertext transfer protocol HTTP request is sent to the server, in order to show sample described in server acquisition Formula information, and obtain the content of text according to the HTTP request;
It receives hypertext markup language html file that the server is sent and pattern file, the html file includes The content of text, the pattern file show style information comprising described;Alternatively, receiving the HTML texts that the server is sent Part, the html file include the content of text and described show style information.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, the input are defeated Go out unit, is specifically used for:
HTTP request is sent to the server, in order to which the server obtains the text according to the HTTP request Content;
The html file that the server is sent is received, the html file includes the content of text;
Pattern request is sent to the server, shows pattern in order to which the server is obtained according to pattern request Information;
The pattern file that the server is sent is received, the pattern file shows style information comprising described.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization method, it is described to show sample Formula information includes at least one in following Style Attributes:It is used to indicate attribute that whether content of text enter a new line, is used to indicate Content of text overflows the attribute whether hidden when display box, is used to indicate whether show omission mark when content of text overflows display box The high attribute of the attribute of note, the row for being used to indicate content of text, be used to indicate display box where content of text type attribute, The attribute for showing line number for being used to indicate the attribute of the arrangement mode of content of text, being used to indicate content of text.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantages that:
The embodiment of the present invention obtains content of text by server and shows style information;To which, the server is to visitor Family end sends the content of text and described shows style information;In turn so that the client can show sample according to described The display properties of formula information and the client renders the content of text.Compared with prior art, the present invention is real The display properties of style information and client itself can be showed to needing by client in foundation by applying the technical solution of example offer The text to be showed is rendered, thus can solution must not be provided according to client and show asking for pattern for client Topic, may be implemented it is adaptive to content of text carry out interception show, so as to improve the flexibility that text shows pattern.
【Description of the drawings】
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this field For those of ordinary skill, without having to pay creative labor, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is to show the exemplary plot for only showing part content of text in region in the prior art;
Fig. 2 is the exemplary system figure that the technical solution that the embodiment of the present invention is provided uses;
Fig. 3 is the flow diagram for the embodiment one that the text that the embodiment of the present invention is provided shows method;
Fig. 4 is the flow diagram for the embodiment two that the text that the embodiment of the present invention is provided shows method;
Fig. 5 is the first exemplary plot that the client that the embodiment of the present invention is provided only shows segment word;
Fig. 6 is the second exemplary plot that the client that the embodiment of the present invention is provided only shows segment word;
Fig. 7 is the functional block diagram of the embodiment one for the text demonstration device that the embodiment of the present invention is provided;
Fig. 8 is the functional block diagram of the embodiment two for the text demonstration device that the embodiment of the present invention is provided.
【Specific implementation mode】
For a better understanding of the technical solution of the present invention, being retouched in detail to the embodiment of the present invention below in conjunction with the accompanying drawings It states.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base Embodiment in the present invention, those of ordinary skill in the art obtained without creative efforts it is all its Its embodiment, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is the purpose only merely for description specific embodiment, is not intended to be limiting The present invention.In the embodiment of the present invention and "an" of singulative used in the attached claims, " described " and "the" It is also intended to including most forms, unless context clearly shows that other meanings.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation of description affiliated partner, indicate There may be three kinds of relationships, for example, A and/or B, can indicate:Individualism A, exists simultaneously A and B, individualism B these three Situation.In addition, character "/" herein, it is a kind of relationship of "or" to typically represent forward-backward correlation object.
Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination " or " in response to detection ".Similarly, depend on context, phrase " if it is determined that " or " if detection (condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when the detection (condition of statement Or event) when " or " in response to detection (condition or event of statement) ".
The system that the technical solution that the embodiment of the present invention is provided uses is as shown in Fig. 2, mainly by client and server Composition.
The embodiment of the present invention provides a kind of text and shows method, referring to FIG. 3, its text for being provided by the embodiment of the present invention Originally show the flow diagram of the embodiment one of method, this method is the implementation method of server side.As shown, this method packet Include following steps:
S301, server obtain content of text and show style information.
S302, the server to client send the content of text and it is described show style information, in order to described Client shows style information and the display properties of the client according to described in, is rendered to the content of text.
Preferably, server obtains content of text and shows style information, and sends the content of text to client Following three kinds are can include but is not limited to the method for showing style information:
The first:First, server receives client, such as the network in browser, the hypertext transfer protocol of transmission (Hypertext Transfer Protocol, HTTP) is asked, and the identifier of resource is included in the HTTP request.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, and from default Text show to obtain in the configuration file of pattern and show style information, it includes to be used to indicate in the text that this, which shows style information, The information for showing pattern held, server can show style information by this, and control client is using which kind of pattern to text Content carries out typesetting.
Finally, the server sends hypertext markup language (Hypertext Mark-up to the client Language, HTML) file and pattern file, wherein the content of text obtained is carried by the html file, passes through the pattern What file carrying obtained shows style information.
It is understood that server is that html file and pattern file are supplied to client together in this method.
Second:First, server receives client, and such as the network in browser, the HTTP request of transmission, which asks Include the identifier of resource in asking.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, then to described Client sends html file, and carries the text content obtained by the html file.
Finally, the server receives the pattern request that the client is sent, and then server is asked according to the pattern, Know that client needs to obtain and show style information, so server is obtained from the configuration file that preset text shows pattern Show style information, then sends pattern file to the client, and show pattern by what pattern file carrying obtained Information.
It is understood that in this method server be html file and pattern file are supplied separately to client, and And pattern file therein can just be supplied to client after the pattern request for receiving client.
The third:First, server receives client, and such as the network in browser, the HTTP request of transmission, which asks Include the identifier of resource in asking.
Then, server obtains corresponding content of text according to the identifier of the resource in HTTP request, and from default Text show to obtain in the configuration file of pattern and show style information, it includes to be used to indicate in the text that this, which shows style information, The information for showing pattern held, server can show style information by this, and control client is using which kind of pattern to text Content carries out typesetting.
Finally, the server sends html file to the client, wherein carries acquisition by the html file Content of text and show style information.
It is understood that individual pattern file is not used to show style information to carry in this method, but it is logical It crosses html file and carries this and show style information and content of text.
Preferably, in the embodiment of the present invention, the style information that shows includes at least one in following Style Attributes:For Indicate content of text whether enter a new line attribute, be used to indicate content of text overflow display box when whether hide attribute, use Whether shown when indicating that content of text overflows display box and omits the attribute of label, is used to indicate the high category of the row of content of text Property, be used to indicate display box where content of text type attribute, be used to indicate content of text arrangement mode attribute, use In the attribute for showing line number of instruction content of text.
It should be noted that the executive agent of S301~S302 can be text demonstration device, which can be located at clothes Business device.
Referring to FIG. 4, it is showed the flow diagram of the embodiment two of method by the text that the embodiment of the present invention provides, This method is the implementation method of client-side.As shown, this approach includes the following steps:
S401, client receive the content of text and show style information that server is sent.
S402, the client shows style information and the display properties of the client according to described in, to the text This content is rendered.
Preferably, the content of text that the client reception server is sent and the method for showing style information may include But it is not limited to following three kinds of methods:
The first:Client can send HTTP request, which asks such as the network in browser to the server The identifier for including resource in asking, in order to which the server is showed from the configuration file that preset text shows pattern Style information, it includes the information for showing pattern for being used to indicate text content that this, which shows style information, and client can foundation This shows style information, determines which kind of pattern to carry out typesetting to content of text using.And server is according to the HTTP request In resource identifier, obtain corresponding content of text.
The client receives the html file and pattern file that the server is sent, and the html file includes described Content of text, the pattern file show style information comprising described.
Client receives html file and pattern file simultaneously from server in this method.
Second:Client sends HTTP request to server, includes in the HTTP request such as the network in browser The identifier of resource, the identifier in order to server according to the resource in the HTTP request obtain corresponding content of text, so Html file is sent to client afterwards, the content of text of acquisition is carried in the html file, in this way, client can receive The html file that server is sent, obtains content of text from html file.Then, which sends pattern and asks It asks, in order to which server is asked according to the pattern, is obtained from the configuration file that preset text shows pattern and show pattern Information, then sends pattern file to client, and what pattern file carrying obtained shows style information.In this way, the client The pattern file of server transmission can be received, and is obtained from the pattern file and shows style information.
It should be noted that client obtains html file and pattern file from server in this method, it is to separate acquisition , and pattern file therein can just be asked to server after receiving content of text.
The third:Client can send HTTP request, which asks such as the network in browser to the server The identifier for including resource in asking, in order to which the server is showed from the configuration file that preset text shows pattern Style information, it includes the information for showing pattern for being used to indicate text content that this, which shows style information, and client can foundation This shows style information, determines which kind of pattern to carry out typesetting to content of text using.And server is according to the HTTP request In resource identifier, obtain corresponding content of text.
The client receives the html file that the server is sent, the html file include the content of text with And described show style information.
Preferably, the style information that shows includes at least one in following Style Attributes:Being used to indicate content of text is The attribute whether hidden when content of text spilling display box be used to indicate, is used to indicate content of text for the no attribute to enter a new line Whether shown when overflowing display box and omits the attribute of label, be used to indicate the high attribute of the row of content of text, be used to indicate text The attribute of the type of display box where content, be used to indicate content of text arrangement mode attribute, be used to indicate content of text The attribute for showing line number.
Preferably, if the display properties of the client be the client in display box size, the client according to Show the method that style information renders the content of text according to described and can include but is not limited to:The client, such as Rendering engine in browser client, after being obtained from server and showing style information, so that it may to know to content of text such as What carries out typesetting, so as to show the size of display box in style information and client according to this, executes to content of text Typesetting operation, for example, hide display box outside content of text, after the last one word of display addition omit mark etc., Then client can show the content of text obtained after typesetting, to realize the Rendering operations of content of text.
It should be noted that the executive agent of S401~S402 can be text demonstration device, which can be located at this The application of ground terminal, or can also be the plug-in unit being located locally in the application of terminal or Software Development Kit (Software Development Kit, SDK) etc. functional units, the embodiment of the present invention is to this without being particularly limited to.
It is understood that the application can be mounted in the application program (nativeApp) in terminal, or may be used also To be a web page program (webApp) of browser in terminal, the embodiment of the present invention is to this without limiting.
It should be noted that terminal involved in the embodiment of the present invention can include but is not limited to personal computer (Personal Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), wireless handheld Equipment, tablet computer (Tablet Computer), mobile phone, MP3 player, MP4 players etc..
Include below grade to show in style information for the style information that shows in above-described embodiment one and embodiment two Connection style sheet (Cascading Style Sheets, CSS) attribute, content of text are illustrated for single file text:
It can be white-space attributes to be used to indicate the attribute whether content of text enters a new line.If necessary to control Content of text does not enter a new line, then white-space attributes are configurable to:white-space:nowrap.
It can be overflow attributes to be used to indicate content of text the attribute whether hidden when display box overflowed.If necessary Control content of text needs to hide the content of text of spilling when overflowing display box, then overflow attributes are configurable to: overflow:hidden。
It is used to indicate when content of text overflows display box and whether shows that it can be text-overflow to omit the attribute of label Attribute.Omission label is shown after the last one word of display when overflowing display box if necessary to control content of text, Then text-overflow attributes are configurable to:text-overflow:ellipsis.
The high attribute of row for being used to indicate content of text can be line-height attributes.If necessary to control in text The row height of appearance then needs for line-height attribute configuration numerical value, row height of the numerical value for indicating content of text, example As line-height attributes are configurable to:line-height:25px, 25px indicate that row height is 25 pixels.It needs to illustrate , if it is single file text, then the row height of single file text can be identical as the height of display box in client.
For the style information that shows in above-described embodiment one and embodiment two, include to show in style information below CSS attributes, content of text are illustrated for multiline text:
The high attribute of row for being used to indicate content of text can be line-height attributes.If necessary to control in text Every this row height of style of writing in appearance, then need for line-height attribute configuration numerical value, which is used to indicate every style of writing originally Row height, such as line-height attributes are configurable to:line-height:25px, 25px indicate that row height is 25 pixels. It should be noted that if it is multiline text, then the row height of multiline text can be equal to display box height and text line number Ratio.
It can be overflow attributes to be used to indicate content of text the attribute whether hidden when display box overflowed.If necessary Control content of text needs to hide the content of text of spilling when overflowing display box, then overflow attributes are configurable to: overflow:hidden.It should be noted that if it is multiline text, then control content of text is needed to be entered a new line automatically, When content of text overflows the lower edge of display box, the last at least a line content of text for hiding content of text is needed.Such as Fig. 5 and Shown in Fig. 6, content of text can be controlled and show ellipsis after the last one word of display when overflowing display box.
The attribute of the type of display box can be display attributes where being used to indicate content of text.If necessary to control The type of display box where content of text is BOX Model, then display attributes are configurable to display:-webkit-box. Wherein, after being configured to BOX Model, display box can take the display screen of terminal.
The attribute for being used to indicate the arrangement mode of content of text can be-webkit-box-orient attributes, content of text Arrangement mode may include up vertically and horizontally.For example, vertical in display box if necessary to control content of text Arrangement, then-webkit-box-orient attributes are configurable to-webkit-box-orient:vertical.
The attribute for showing line number for being used to indicate content of text can be-webkit-line-clamp attributes.If needed The line number that can be shown for controlling content of text needs for-webkit-line-clamp attribute configuration numerical value, numerical value use The content of text beyond the line number needs in the line number threshold value for the content of text that can be shown in instruction display box, content of text It is omitted.For example,-webkit-line-clamp attributes are configurable to-webkit-line-clamp:4, indicate display The line number of the content of text shown in frame is 4, and the content of text omission since the 5th row is not shown.
The embodiment of the present invention, which further provides, realizes the device embodiment of each step and method in above method embodiment.
Referring to FIG. 7, the functional block diagram of the embodiment one of its text demonstration device provided by the embodiment of the present invention. As shown, the device is located at server side, which includes:
Processing unit 701, for obtaining content of text and showing style information;
Output unit 702, for client send the content of text and it is described show style information, in order to described Client shows style information and the display properties of the client according to described in, is rendered to the content of text.
Preferably, the output unit 702, is specifically used for:
Hypertext markup language html file and pattern file are sent to the client, the html file includes described Content of text, the pattern file show style information comprising described;Alternatively,
Html file is sent to the client, the html file includes the content of text;The server receives The pattern request that the client is sent, and asked to client transmission pattern file, the sample according to the pattern Formula file shows style information described in including;Alternatively,
Html file is sent to the client, the html file includes that the content of text and the pattern that shows are believed Breath.
Preferably, the style information that shows includes at least one in following Style Attributes:Being used to indicate content of text is The attribute whether hidden when content of text spilling display box be used to indicate, is used to indicate content of text for the no attribute to enter a new line Whether shown when overflowing display box and omits the attribute of label, be used to indicate the high attribute of the row of content of text, be used to indicate text The attribute of the type of display box where content, be used to indicate content of text arrangement mode attribute, be used to indicate content of text The attribute for showing line number.
Method shown in Fig. 2 is able to carry out by each unit in this present embodiment, the part that the present embodiment is not described in detail, It can refer to the related description to Fig. 2.
Referring to FIG. 8, the functional block diagram of the embodiment two of its text demonstration device provided by the embodiment of the present invention. As shown, the device is located at client-side, which includes:
Input-output unit 801, for receiving the content of text and show style information that server is sent;
Content rendering unit 802, for showing style information and the display properties of the client according to described in, to institute Content of text is stated to be rendered.
Preferably, the input-output unit 801, is specifically used for:
Hypertext transfer protocol HTTP request is sent to the server, in order to show sample described in server acquisition Formula information, and obtain the content of text according to the HTTP request;
It receives hypertext markup language html file that the server is sent and pattern file, the html file includes The content of text, the pattern file show style information comprising described;Alternatively, receiving the HTML texts that the server is sent Part, the html file include the content of text and described show style information.
Preferably, the input-output unit 801, is specifically used for:
HTTP request is sent to the server, in order to which the server obtains the text according to the HTTP request Content;
The html file that the server is sent is received, the html file includes the content of text;
Pattern request is sent to the server, shows pattern in order to which the server is obtained according to pattern request Information;
The pattern file that the server is sent is received, the pattern file shows style information comprising described.
Preferably, the style information that shows includes at least one in following Style Attributes:Being used to indicate content of text is The attribute whether hidden when content of text spilling display box be used to indicate, is used to indicate content of text for the no attribute to enter a new line Whether shown when overflowing display box and omits the attribute of label, be used to indicate the high attribute of the row of content of text, be used to indicate text The attribute of the type of display box where content, be used to indicate content of text arrangement mode attribute, be used to indicate content of text The attribute for showing line number.
Preferably, the display properties of the client is the size of display box in the client, and the content renders single Member 802, is specifically used for:
The size for showing display box in style information and the client according to described in, arranges the content of text Version;
Show the content of text obtained after typesetting.
Method shown in Fig. 3 is able to carry out by each unit in this present embodiment, the part that the present embodiment is not described in detail, It can refer to the related description to Fig. 3.
The technical solution of the embodiment of the present invention has the advantages that:
The embodiment of the present invention obtains content of text by server and shows style information;To which, the server is to visitor Family end sends the content of text and described shows style information;In turn so that the client can show sample according to described The display properties of formula information and the client renders the content of text.
Compared with prior art, technical solution provided in an embodiment of the present invention can show pattern letter by client in foundation Breath and the display properties of client itself render the text that shows of needs, thus can solution must not be according to client There is provided be directed to the problem of showing pattern of client, may be implemented it is adaptive to content of text carry out interception show, so as to To improve the flexibility that text shows pattern.
In addition, for the content of text that needs show, typesetting calculating is carried out to word by client, it is possible to reduce server To the processing pressure that the typesetting of content of text calculates, mitigate server burden.
Moreover, in the prior art, showing style information, such as CSS attributes, it is pre-configured in client local, in this way, When client is obtained from server needs content of text to be shown, so that it may show style information with what foundation was locally stored, in fact Show the typesetting of content of text and shows.However, in this technical solution, the file where showing style information is usually to be used as to face When file be stored in terminal where client, it is soft that file where showing style information in this way is possible to the safety installed by terminal Part is cleaned up when clearing up temporary file, leads to the loss for showing style information, to be reconfigured.In addition, working as When showing style information and needing to be updated, as when the display size of client changes, text shows demand and changes, It needs manually to carry out showing reconfiguring for style information, therefore the flexibility ratio of this mode is relatively low, update is more inconvenient, more New efficiency is relatively low.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, for example, multiple units or group Part can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown Or the mutual coupling, direct-coupling or communication connection discussed can be by some interfaces, device or unit it is indirect Coupling or communication connection can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can be stored in one and computer-readable deposit In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer It is each that device (can be personal computer, server or network equipment etc.) or processor (Processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. it is various The medium of program code can be stored.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention With within principle, any modification, equivalent substitution, improvement and etc. done should be included within the scope of protection of the invention god.

Claims (12)

1. a kind of text shows method, which is characterized in that the method includes:
Server obtains content of text and shows style information;
The server to client send the content of text and it is described show style information, in order to the client foundation The display properties for showing style information and the client, renders the content of text, the client Display properties includes the size of display box in the client;
Wherein, the style information that shows includes at least one in following Style Attributes:It is used to indicate whether content of text carries out The attribute of line feed, be used to indicate content of text overflow the attribute whether hidden when display box, be used to indicate content of text overflow it is aobvious Show whether show the attribute of omission label when frame, be used to indicate the high attribute of the row of content of text, be used to indicate content of text institute The type of display box attribute, be used to indicate content of text arrangement mode attribute, be used to indicate showing for content of text Show the attribute of line number.
2. according to the method described in claim 1, it is characterized in that, the server to client send the content of text and It is described to show style information, including:
The server sends hypertext markup language html file and pattern file, the html file packet to the client Containing the content of text, the pattern file shows style information comprising described;Alternatively,
The server sends html file to the client, and the html file includes the content of text;The service Device receives the pattern request that the client is sent, and is asked to client transmission pattern file according to the pattern, The pattern file shows style information described in including;Alternatively,
The server sends html file to the client, and the html file includes the content of text and described shows Style information.
3. a kind of text shows method, which is characterized in that the method includes:
Client receives the content of text and show style information that server is sent;
The client shows style information and the display properties of the client according to described in, is carried out to the content of text It renders, the display properties of the client includes the size of display box in the client;
Wherein, the style information that shows includes at least one in following Style Attributes:It is used to indicate whether content of text carries out The attribute of line feed, be used to indicate content of text overflow the attribute whether hidden when display box, be used to indicate content of text overflow it is aobvious Show whether show the attribute of omission label when frame, be used to indicate the high attribute of the row of content of text, be used to indicate content of text institute The type of display box attribute, be used to indicate content of text arrangement mode attribute, be used to indicate showing for content of text Show the attribute of line number.
4. according to the method described in claim 3, it is characterized in that, the client receive server send content of text and Show style information, including:
The client sends hypertext transfer protocol HTTP request to the server, described in server acquisition Show style information, and the content of text is obtained according to the HTTP request;
The client receives the hypertext markup language html file and pattern file that the server is sent, the HTML texts Part includes the content of text, and the pattern file shows style information comprising described;Alternatively, the client receives the clothes It is engaged in the html file that device sends, the html file includes the content of text and described shows style information.
5. according to the method described in claim 3, it is characterized in that, the client receive server send content of text and Show style information, including:
The client sends HTTP request to the server, in order to which the server obtains institute according to the HTTP request State content of text;
The client receives the html file that the server is sent, and the html file includes the content of text;
The client sends pattern request to the server, in order to which the server asks acquisition exhibition according to the pattern Existing style information;
The client receives the pattern file that the server is sent, and the pattern file shows style information comprising described.
6. according to the method described in claim 3, it is characterized in that, the client shows style information and institute according to described in The display properties for stating client renders the content of text, including:
The client shows the size of display box in style information and the client according to described in, to the content of text into Row typesetting;
The client shows the content of text obtained after typesetting.
7. a kind of text demonstration device, which is characterized in that described device is located at server, and described device includes:
Processing unit, for obtaining content of text and showing style information;
Output unit, for client send the content of text and it is described show style information, in order to the client Show style information and the display properties of the client according to described in, the content of text is rendered, the client The display properties at end includes the size of display box in the client;
Wherein, the style information that shows includes at least one in following Style Attributes:It is used to indicate whether content of text carries out The attribute of line feed, be used to indicate content of text overflow the attribute whether hidden when display box, be used to indicate content of text overflow it is aobvious Show whether show the attribute of omission label when frame, be used to indicate the high attribute of the row of content of text, be used to indicate content of text institute The type of display box attribute, be used to indicate content of text arrangement mode attribute, be used to indicate showing for content of text Show the attribute of line number.
8. device according to claim 7, which is characterized in that the output unit is specifically used for:
Hypertext markup language html file and pattern file are sent to the client, the html file includes the text Content, the pattern file show style information comprising described;Alternatively,
Html file is sent to the client, the html file includes the content of text;Described in the server receives The pattern request that client is sent, and asked to client transmission pattern file, the pattern text according to the pattern Part shows style information described in including;Alternatively,
Html file is sent to the client, the html file includes the content of text and described shows style information.
9. a kind of text demonstration device, which is characterized in that described device is located at client, and described device includes:
Input-output unit, for receiving the content of text and show style information that server is sent;
Content rendering unit, for showing style information and the display properties of the client according to described in, to the text Content is rendered, and the display properties of the client includes the size of display box in the client;
Wherein, the style information that shows includes at least one in following Style Attributes:It is used to indicate whether content of text carries out The attribute of line feed, be used to indicate content of text overflow the attribute whether hidden when display box, be used to indicate content of text overflow it is aobvious Show whether show the attribute of omission label when frame, be used to indicate the high attribute of the row of content of text, be used to indicate content of text institute The type of display box attribute, be used to indicate content of text arrangement mode attribute, be used to indicate showing for content of text Show the attribute of line number.
10. device according to claim 9, which is characterized in that the input-output unit is specifically used for:
Hypertext transfer protocol HTTP request is sent to the server, in order to show pattern letter described in server acquisition Breath, and obtain the content of text according to the HTTP request;
The hypertext markup language html file and pattern file that the server is sent are received, the html file includes described Content of text, the pattern file show style information comprising described;Alternatively, the html file that the server is sent is received, The html file includes the content of text and described shows style information.
11. device according to claim 9, which is characterized in that the input-output unit is specifically used for:
HTTP request is sent to the server, in order to which the server is obtained according to the HTTP request in the text Hold;
The html file that the server is sent is received, the html file includes the content of text;
Pattern request is sent to the server, shows pattern letter in order to which the server is obtained according to pattern request Breath;
The pattern file that the server is sent is received, the pattern file shows style information comprising described.
12. device according to claim 9, which is characterized in that the content rendering unit is specifically used for:
The size for showing display box in style information and the client according to described in carries out typesetting to the content of text;
Show the content of text obtained after 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 CN104572822A (en) 2015-04-29
CN104572822B true 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)

Families Citing this family (10)

* 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
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
US20180191798A1 (en) * 2016-12-30 2018-07-05 Google Inc. Methods and systems for server-side rendering of native content for presentation
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
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

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412928A (en) * 2013-08-16 2013-11-27 北京乐动卓越科技有限公司 Method and device for realizing browser page intelligent response-type layout on mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2366037B (en) * 2000-02-24 2004-01-21 Ibm Customising an HTML document
JP4398462B2 (en) * 2003-06-30 2010-01-13 インターナショナル・ビジネス・マシーンズ・コーポレーション Method and system for improving the presentation of HTML pages on web devices
US7653875B2 (en) * 2005-04-07 2010-01-26 Microsoft Corporation Browser sensitive web content delivery

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412928A (en) * 2013-08-16 2013-11-27 北京乐动卓越科技有限公司 Method and device for realizing browser page intelligent response-type layout on mobile terminal

Also Published As

Publication number Publication date
CN104572822A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
CN104572822B (en) Text shows method and device
DE112018000226T5 (en) Mobile cloud computing device and operating method
CN103218115B (en) The optimization display packing of a kind of informing and mobile terminal
CN103955495B (en) The method for down loading and device of page child resource
CN102364460B (en) Automatic page amplification method and system based on mobile terminal
WO2015027800A1 (en) Method and device for displaying notification message
CN103365840A (en) Web-based screenshot taking method and device
US20160196008A1 (en) Implementing desktops on a mobile terminal
JP2022518724A (en) Document input processing methods, devices, electronic devices and storage media
CN104461052B (en) Character input method and device between smart machine
CN103076955A (en) Method, device and terminal for adjusting characters of application
CN107277244A (en) Screenshot processing method and device
CN105607800A (en) Method and device for input display of terminal screen
CN104899212B (en) Web page display method, server and system
CN102932791A (en) Method for collaboratively processing information through WIFI wireless network between smart phone and computer
CN104731897B (en) A kind of implementation method that information shows and device
US9781065B2 (en) Lightweight application integration for mobile cloud computing
CN105009115B (en) The method and apparatus for obtaining Internet resources
EP2905686A1 (en) Method and device for enlarging mobile application edit box based on event monitor
CN104252309B (en) A kind of method and system for realizing intelligent terminal Chinese version editor
JP6383847B2 (en) Web server
DE602004012707T2 (en) System and method for processing font data
CN108632069B (en) Client configuration method, system and related equipment
US10261979B2 (en) Method and apparatus for rendering a screen-representation of an electronic document
US11822872B2 (en) Rendering based on a document object model

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