CN108763188A - Text display method, device, equipment and storage medium - Google Patents

Text display method, device, equipment and storage medium Download PDF

Info

Publication number
CN108763188A
CN108763188A CN201810507301.1A CN201810507301A CN108763188A CN 108763188 A CN108763188 A CN 108763188A CN 201810507301 A CN201810507301 A CN 201810507301A CN 108763188 A CN108763188 A CN 108763188A
Authority
CN
China
Prior art keywords
text
character
display
dimensional array
rule
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.)
Pending
Application number
CN201810507301.1A
Other languages
Chinese (zh)
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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810507301.1A priority Critical patent/CN108763188A/en
Publication of CN108763188A publication Critical patent/CN108763188A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the invention discloses a text display method, a text display device, text display equipment and a storage medium. The method comprises the following steps: determining a text control; acquiring at least one constraint condition of the text control; calculating an accommodating parameter corresponding to the text control, wherein the constraint condition is used as a calculation basis of the accommodating parameter; generating a text grouping rule, wherein the text grouping rule is matched with the accommodation parameters and is used for grouping texts to be displayed; and grouping and displaying the texts to be displayed. The embodiment of the invention realizes the simple and rapid typesetting of the text to be displayed, enables the typesetting result to be matched with the text control and to better meet the use requirement, improves the typesetting performance and has more beautiful display effect.

Description

A kind of text display method, device, equipment and storage medium
Technical field
The present invention relates to text-processing technology more particularly to a kind of text display method, device, equipment and storage mediums.
Background technology
Currently, through being shown to word frequently with intelligent terminal, in order to improve aesthetics and readability, generally require pair Word to be shown carries out typesetting.Especially for the text (such as classic poetry) for having portrait to show demand, rational typesetting is more Added with necessity.In the prior art, the entire text of control can be used to rotate clockwise 90 degree of this modes, text is shown again Show, this mode is unable to reach the desired display effect of user.Therefore, how typesetting more reasonably is carried out to word and is shown Show, is research staff's project that it is necessary to be inquired into.
Invention content
A kind of text display method of offer of the embodiment of the present invention, device, equipment and storage medium, to realize more reasonably Typesetting is carried out to word.
In a first aspect, an embodiment of the present invention provides a kind of text display method, this method includes:
Determine text control;
Obtain at least one constraints of the text control;
Calculate the corresponding receiving parameter of the text control, wherein the constraints is calculated as the receiving parameter Foundation;
Text packets rule is generated, the text packets rule is matched with the receiving parameter, for treating display text It is grouped;
Display text is treated to be grouped and show.
Second aspect, the embodiment of the present invention additionally provide a kind of textual display device, which includes:
Control determining module, for determining text control;
Adjust acquisition module, at least one constraints for obtaining the text control;
Parameter calculating module, for calculating the corresponding receiving parameter of the text control, wherein the constraints conduct The receiving parameter calculation basis;
Rule generation module, for generating text packets rule, the text packets rule is matched with the receiving parameter, It is grouped for treating display text;
Text display module is grouped and shows for treating display text.
The third aspect, the embodiment of the present invention additionally provide a kind of computer equipment, including memory, processor and are stored in On memory and the computer program that can run on a processor, the processor are realized when executing described program as the present invention is real Apply the text display method described in example.
Fourth aspect, the embodiment of the present invention also provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes the text display method as described in any in the embodiment of the present invention when program is executed by processor.
Text display method provided in an embodiment of the present invention calculates text control pair according to the constraints of text control The receiving parameter answered generates the text packets rule with receiving match parameters, text to be shown is grouped and is shown, real The quickly and easily typesetting for treating display text is showed, has enable typesetting result with text control to match and more meet to use to need It asks, improves typesetting performance, display effect is more beautiful.
Description of the drawings
Fig. 1 a are a kind of flow charts for text display method that the embodiment of the present invention one provides;
Fig. 1 b are that a kind of text that the embodiment of the present invention one provides shows display effect schematic diagram
Fig. 2 a are a kind of text display method flow charts provided by Embodiment 2 of the present invention;
Fig. 2 b are that two-dimensional array fills schematic diagram in a kind of text display method provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of text display method flow chart that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural schematic diagram for textual display device that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram for computer equipment that the embodiment of the present invention five provides.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 a are a kind of flow charts for text display method that the embodiment of the present invention one provides, and the present embodiment is applicable to pair Text to be shown carries out the case where typesetting, and specific application scenarios can be in teaching process to the writing in classical Chinese or classic poetry etc. Show that the text of demand carries out typesetting with portrait, this method can execute by textual display device, and the wherein device can be by Software and or hardware realization, and may generally serve as on the computer equipment of plug-in unit teaching demonstration function.
In the present embodiment, the computer equipment can be specifically that the mobile terminals such as mobile phone, tablet computer, notebook are set It is standby, can also be the fixed terminal device with interactive function such as desktop computer, intelligent tutoring blank.The present embodiment is excellent Its application scenarios that set of choosing are shown to learner by the teaching demonstration application of function on computer equipment as instructor and wait showing Before showing text, the case where display text carries out typesetting is treated, more particularly to can be and the relevant writing in classical Chinese, the ancient poetry of imparting knowledge to students Word, distich or report etc..In general, it may include the big of adjustment word that typesetting is carried out before text being shown to text control Each generic operation such as small, position, back gauge, frame or background, and the embodiment of the present invention especially for be with portrait show need The text asked makes typesetting result meet the reading requirement of learner, with teaching involved in scene be consistent.Illustratively, scheme 1b is a kind of text typesetting display effect schematic diagram that the embodiment of the present invention one provides, and text display method is mainly used under the scene The classic poetry text stored in database carries out typesetting and is shown to learner.In scene of imparting knowledge to students, classic poetry is with portrait Typesetting shows relatively reasonable, meets the writing style in period residing for classic poetry author, is shown with portrait typesetting to learn Person can preferably experience classic poetry artistic conception.Signal of the text shown in text control only as corresponding classic poetry uses, when When learner has the demand of study full text, the full text that text control gets classic poetry can be clicked, for classic poetry full text Display mode this is not restricted.
Specifically, a kind of text display method provided in an embodiment of the present invention, includes the following steps:
S110, text control is determined.
In general, control refers to the encapsulation to data and method, has oneself attribute and method, be frequently used for realization one A little simple visible functions.And the effect of text control is just to provide one can input word or the component of other characters. Text control has self attributes, can be used for constraining the Show Styles of text.It can simply be understood as, each text control It can be equivalent to a kind of word template, text can be made to be shown according to the form of template defined.
S120, at least one constraints for obtaining the text control.
In the present embodiment, constraints can be contained in text control self attributes, be the display shape for treating display text Formula constitutes the condition influenced, such as can be the corresponding font size size of text control, word space, font, the height of control or width Degree and the conditions such as text control maximum character capacity, due to the above attribute display format of text can all be played it is certain Effect of contraction, because of the referred to herein as corresponding constraints of text control.
S130, the corresponding receiving parameter of the text control is calculated, wherein the constraints is as the receiving parameter Calculation basis.
It is understood that it can be the parameter that open ended character carries out refinement limitation in text control to accommodate parameter, It can be specifically the max number of characters of the most columns and each column that can show in display text in text control.According to upper The constraints obtained in step receiving parameter corresponding to text control is stated to calculate, can specifically be carried out by call function in terms of It calculates, such as rendering class FormattedText can be drawn by text and calculated, specific calculating process complexity is low, herein Without repeating.
S140, text packets rule is generated, the text packets rule is matched with the receiving parameter, for to be shown Text is grouped.
In the present embodiment, text packets rule can be generated according to the corresponding receiving parameter of text control.Text packets are advised The packet mode for each character for treating display text can then be embodied, can specifically be to determine by text packets quantity to be shown with And every group of character quantity etc. for including.
S150, it treats display text and is grouped and shows.
Wherein, after generating text packets rule, display text can be treated according to text packets rule and be grouped. Specifically, display text can be treated to be parsed, is parsed into the form of character, further according to text packets rule to each character It is grouped, and the character after grouping is shown in text control.Particularly shown result can show every group of character Cheng Yilie makes the display effect of text to be shown that portrait layout be presented.
Text display method provided in an embodiment of the present invention calculates text control pair according to the constraints of text control The receiving parameter answered generates the text packets rule with receiving match parameters, text to be shown is grouped and is shown, real The quickly and easily typesetting for treating display text is showed, has enable typesetting result with text control to match and more meet to use to need It asks, improves typesetting performance, display effect is more beautiful.
Embodiment two
Fig. 2 a are a kind of text display method flow charts provided by Embodiment 2 of the present invention, and the embodiment of the present invention is with above-mentioned reality It applies and optimizes based on example, in the present embodiment, refined to accommodating parameter, the receivings parameter includes that columns is maximum The max number of characters of value and each column, while further refinement has been carried out to " display text for the treatment of is grouped and shows ", This method comprises the following steps:
S210, text control is determined.
S220, at least one constraints for obtaining the text control.
S230, the corresponding receiving parameter of the text control is calculated, wherein the constraints is as the receiving parameter Calculation basis.
S240, text packets rule is generated, the text packets rule is matched with the receiving parameter, for to be shown Text is grouped.
S250, the character in text to be shown is sequentially filled to two-dimensional array, until the two-dimensional array fills up or institute The Character Filling stated in text to be shown finishes.
Wherein, the columns of the two-dimensional array is equal to the columns maximum value, and the line number of the two-dimensional array is equal to described Max number of characters;The Character Filling is from left to right filled from top to bottom to preferential to arrange when the two-dimensional array.
Wherein, the max number of characters that parameter includes columns maximum value and each column is accommodated, for the convenience of description, most by columns Big value indicates that the max number of characters of each column is indicated with N with M, can simply be interpreted as, M can be at most accommodated in text control Row, each column can at most accommodate N number of character.Thus a two-dimensional array A is produced, the columns of two-dimensional array is M, line number N, Any character in two-dimensional array can be indicated with A (i, j), wherein i indicates that row coordinate, j indicate row coordinate.Illustratively, What A (1,1) was indicated is then the character of the first column position of the first row in two-dimensional array.By the character of text to be shown be sequentially filled into In the two-dimensional array, specific fill order can be from left to right filled from top to bottom according to arrange preferentially, that is, according to The sequence of row coordinate from small to large is filled, and filling every time is further continued for filling next column, until will wait for by after row filling completely Character Filling in display text is finished or is filled two-dimensional array full.It is equivalent to from A (1,1) and fills to A (1, N), then fill out A (2,1) is filled, until filling is finished to A (M, N) or by the Character Filling in all texts to be shown.In order to make it easy to understand, lifting The process that example carries out Character Filling explains, and illustratively, text to be shown is " 1234567890 ", M=4, N=3, Fig. 2 b It is that two-dimensional array fills schematic diagram in a kind of text display method provided by Embodiment 2 of the present invention, it can be from Fig. 2 b clearly Find out filling principle, details are not described herein.
Preferably, the character in two-dimensional array fills up but text to be shown is not filled by when finishing, using default special word Symbol replaces the last character in two-dimensional array.Can be specifically, in the filling process, when filling is last to two-dimensional array When one position, judge whether the remaining quantity for being not filled by character is more than 1, it is if more than 1, then last in two-dimensional array One upper preset spcial character of position filling.Alternatively, can also be after filling up two-dimensional array, it is determined whether exist and do not fill out Fill character, and if it exists, the character deletion then being had been filled in two-dimensional array, again the last one position in two-dimensional array fill out Fill preset spcial character with., since control accommodation space is limited, to exist and character be not shown to user's characterization.Wherein, in advance If spcial character can beDue to text control can be arranged it is associated with other display controls, in this case, It can show that complete text to be shown can click text control when user has query demand in other display controls, touch Hair association control pops up and shows text full text to be shown.
After all Character Fillings in text to be shown finish, if being still not filled by region in two-dimensional array, often A region that is not filled by is filled using space as filling character, and is filled up until by two-dimensional array.Illustratively, in upper example, A (2,4) and at A (3,4) it is filled using space.
S260, character often capable in the two-dimensional array is reversed in the position of the row.
It is understood that reversing the character of every row in the position of the row, it is equivalent to the character for every a line, is adjusted Its row coordinate.Can be specifically the sequence with every line character of two-dimensional array according to row coordinate, inverted order arranges, and this is operated Traversal is to all rows, the two-dimensional array after being reversed.It is further described using above-mentioned example, above-mentioned text to be shown First behavior " 1470 " in " 1234567890 ", the row becomes " 0741 " after reversing, and the inversion process and the first row of other rows are former It manages identical.
S270, the character merged in the two-dimensional array after reversing obtain target display text, in the target display text Newline is added between per line character.
Wherein, after being reversed to the character in two-dimensional array, it can add and change after the last character of every row Row symbol, merging obtain target display text.For the above example, the character after reversing is merged, and be added into newline, then Target display text " 0741/r/n852/r/n963 " is obtained, wherein "/r/n " expression is newline.Preferably, " by institute State target display text and be refreshed by row and shown in the text control " before, further include for text between the column and the column The parametrization setting that spacing is shown.Specifically, it can be the spacing pre-set between each column character.In addition newline process Before, when merging the character of two-dimensional array, a fixed number is added in reference paper control/interface display style, each two character centre The space of amount.Such as between A (i, j) and A (i, j+1), 1 space is added, illustratively, if being filled with character in A (i, j) " I " is filled with character " you " in A (i, j+1), adds behind space to get to " I you ".The specific effect that presents can refer to Form shown in Fig. 1 b, specific space quantity can depend on specific business need or interactive requirements.Pass through above-mentioned behaviour Make, keeps the display of text more beautiful.
S280, it the target display text is refreshed by row is shown in the text control.
Wherein, after obtaining target display text, target display text is refreshed by row, makes target display text in text It is shown in this control, the effect being finally reached is to be filled character to arrange, but display is refreshed by row, and reaches portrait row The visual effect of version effect.
Text display method provided in an embodiment of the present invention is treated display text using two-dimensional array and is filled, passes through By the preferential filling of row, the mode of display is refreshed by row, realizes the typesetting for treating display text, reaches regarding for portrait typesetting effect Feel effect, scheme is simply easily realized and compatibility is strong.
Embodiment three
Fig. 3 is a kind of text display method flow chart that the embodiment of the present invention three provides, and the embodiment of the present invention is with above-mentioned reality Apply and optimize based on example, in the present embodiment, " by the target display text be refreshed by row the text control into Row display " increases " for the different type character in the target display text, matching different character display rules ", and Further refinement is carried out to " being shown to the text to be shown ", this method comprises the following steps:
S310, text control is determined.
S320, at least one constraints for obtaining the text control.
S330, the corresponding receiving parameter of the text control is calculated, wherein the constraints is as the receiving parameter Calculation basis.
S340, text packets rule is generated, the text packets rule is matched with the receiving parameter, for to be shown Text is grouped.
S350, the character in text to be shown is sequentially filled to two-dimensional array, until the two-dimensional array fills up or institute The Character Filling stated in text to be shown finishes.
S360, character often capable in the two-dimensional array is reversed in the position of the row.
S370, the character merged in the two-dimensional array after reversing obtain target display text, in the target display text Newline is added between per line character.
S380, for the different type character in the target display text, match different character display rules.
It is understood that may relate to different types of character in target display text, for example, may include Chinese character, English alphabet, English symbol or spcial character etc..It, can be to different types of character in order to reach better visual display effect Provide different display rules.Optionally, rule match process can be specifically:Analyze at least one of described target text The corresponding character types of character, and determine and shown with the presence or absence of standard character corresponding with the character types in preset rules library Rule;If it is present the character with standard character display rule as the character is shown rule;If it does not, Then the character by the default character being recorded in preset rules library display rule as the character shows rule.Wherein, in advance If rule base can be defined by the user or be generated by system self study, including various characters type corresponding standard character is aobvious Show rule, preset rules library can be updated according to analysis user's use habit.
S390, according to the character show rule, by the target display text be refreshed by row the text control into Row display.
Wherein, character display rule embodies specific rules when character is shown, illustratively, if character type is Chinese character When, the display rule that matching obtains Chinese character in preset rules library is:Each Chinese character occupies three character positions and is shown.And Character types are English character, and the character display rule that matching obtains English character in preset rules library is:In former character Left and right one space of each addition is shown then when display in such a way that each Chinese character occupies three character positions Chinese character, and space and English character itself are shown respectively, to realize the display of English character, the effect visually reached is exactly English character is in centered position.
Text display method provided in an embodiment of the present invention, it is regular using different displays for different character types, Keep the interface that text is shown more beautiful, improves the usage experience of user.
Example IV
Fig. 4 is a kind of structural schematic diagram for textual display device that the embodiment of the present invention four provides, which can be by software And/or hardware is realized, the text display method of any embodiment offer of the present invention is can perform, which includes:
Control determining module 410, for determining text control;
Adjust acquisition module 420, at least one constraints for obtaining the text control;
Parameter calculating module 430, for calculating the corresponding receiving parameter of the text control, wherein the constraints As the receiving parameter calculation basis;
Rule generation module 440, for generating text packets rule, the text packets rule and the receiving parameter Match, is grouped for treating display text;
Text display module 450 is grouped and shows for treating display text.
Further, described to accommodate the max number of characters that parameter includes columns maximum value and each column;
Text display module 450, is specifically used for:
Character in text to be shown is sequentially filled to two-dimensional array, until the two-dimensional array fills up or described waits showing Show that the Character Filling in text finishes;The columns of the two-dimensional array is equal to the columns maximum value, the row of the two-dimensional array Number is equal to the max number of characters;The Character Filling to preferential to arrange when the two-dimensional array, from top to bottom from left to right into Row filling;
Character often capable in the two-dimensional array is reversed in the position of the row;
The character merged in the two-dimensional array after reversing obtains target display text, every row word in the target display text Newline is added between symbol;
The target display text is refreshed by row and is shown in the text control.
Further, further include:Rule match module, is specifically used for:
It is refreshed by row before the text control is shown by the target display text, it is aobvious for the target Show the different type character in text, matches different character display rules;
Correspondingly, the text display module, is specifically used for:
Rule is shown according to the character, and at least one character in the text to be shown is shown.
Further, rule match module is specifically used for:
Analyze the corresponding character types of at least one of target text character, and determine in preset rules library whether Rule is shown in the presence of standard character corresponding with the character types;
If it is present the character with standard character display rule as the character is shown rule;
If it does not exist, then the word by the default character being recorded in preset rules library display rule as the character Symbol display rule.
Further, further include that character replaces module, be specifically used for:
When the two-dimensional array fills up but character in the text to be shown is not filled by when finishing, using default special word Symbol replaces the last character in the two-dimensional array.
Above-mentioned textual display device can perform the text display method that any embodiment of the present invention is provided, and has and executes text The corresponding function module of this display methods and advantageous effect.
Embodiment five
Fig. 5 is a kind of structural schematic diagram for computer equipment that the embodiment of the present invention five provides.Fig. 5 is shown suitable for being used for Realize the block diagram of the exemplary computer device 12 of embodiment of the present invention.The computer equipment 12 that Fig. 5 is shown is only one Example should not bring any restrictions to the function and use scope of the embodiment of the present invention.
As shown in figure 5, computer equipment 12 is showed in the form of universal computing device.The component of computer equipment 12 can be with Including but not limited to:One or more processor or processing unit 16, system storage 28 connect different system component The bus 18 of (including system storage 28 and processing unit 16).
Bus 18 indicates one or more in a few class bus structures, including memory bus or Memory Controller, Peripheral bus, graphics acceleration port, processor or the local bus using the arbitrary bus structures in a variety of bus structures.It lifts For example, these architectures include but not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC) Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Computer equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by The usable medium that computer equipment 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access Memory (RAM) 30 and/or cache memory 32.Computer equipment 12 may further include it is other it is removable/can not Mobile, volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing not Movably, non-volatile magnetic media (Fig. 5 do not show, commonly referred to as " hard disk drive ").It, can be with although being not shown in Fig. 5 It provides for the disc driver to moving non-volatile magnetic disk (such as " floppy disk ") read-write, and to removable non-volatile The CD drive of CD (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driving Device can be connected by one or more data media interfaces with bus 18.Memory 28 may include at least one program production There is one group of (for example, at least one) program module, these program modules to be configured to perform of the invention each for product, the program product The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can be stored in such as memory 28 In, such program module 42 includes --- but being not limited to --- operating system, one or more application program, other programs Module and program data may include the realization of network environment in each or certain combination in these examples.Program mould Block 42 usually executes function and/or method in embodiment described in the invention.
Computer equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 Deng) communication, can also be enabled a user to one or more equipment interact with the computer equipment 12 communicate, and/or with make The computer equipment 12 any equipment (such as network interface card, the modulatedemodulate that can be communicated with one or more of the other computing device Adjust device etc.) communication.This communication can be carried out by input/output (I/O) interface 22.Also, computer equipment 12 may be used also To pass through network adapter 20 and one or more network (such as LAN (LAN), wide area network (WAN) and/or public network Network, such as internet) communication.As shown, network adapter 20 is logical by bus 18 and other modules of computer equipment 12 Letter.It should be understood that although being not shown in Fig. 5, other hardware and/or software module, packet can be used in conjunction with computer equipment 12 It includes but is not limited to:Microcode, device driver, redundant processing unit, external disk drive array, RAID system, magnetic tape drive Device and data backup storage system etc..
Processing unit 16 is stored in program in system storage 28 by operation, to perform various functions application and Data processing, such as realize the text display method that the embodiment of the present invention is provided:
Namely:The processing unit is realized when executing described program:
Determine text control;
Obtain at least one constraints of the text control;
Calculate the corresponding receiving parameter of the text control, wherein the constraints is calculated as the receiving parameter Foundation;
Text packets rule is generated, the text packets rule is matched with the receiving parameter, for treating display text It is grouped;
Display text is treated to be grouped and show.
Embodiment six
The embodiment of the present invention six provides a kind of computer readable storage medium, is stored thereon with computer program, the journey The text display method provided such as all inventive embodiments of the application is provided when sequence is executed by processor:
That is, the program is realized when being executed by processor:
Determine text control;
Obtain at least one constraints of the text control;
Calculate the corresponding receiving parameter of the text control, wherein the constraints is calculated as the receiving parameter Foundation;
Text packets rule is generated, the text packets rule is matched with the receiving parameter, for treating display text It is grouped;
Display text is treated to be grouped and show.
The arbitrary combination of one or more computer-readable media may be used.Computer-readable medium can be calculated Machine readable signal medium or computer readable storage medium.Computer readable storage medium for example can be --- but it is unlimited In --- electricity, system, device or the device of magnetic, optical, electromagnetic, infrared ray or semiconductor, or the arbitrary above combination.It calculates The more specific example (non exhaustive list) of machine readable storage medium storing program for executing includes:Electrical connection with one or more conducting wires, just It takes formula computer disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In this document, can be any include computer readable storage medium or storage journey The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.
Computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated, Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including --- but It is not limited to --- electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be Any computer-readable medium other than computer readable storage medium, which can send, propagate or Transmission for by instruction execution system, device either device use or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited In --- wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
It can be write with one or more programming languages or combinations thereof for executing the computer that operates of the present invention Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++, Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion Divide and partly executes or executed on a remote computer or server completely on the remote computer on the user computer.? Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or Wide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as carried using Internet service It is connected by internet for quotient).
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation, It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of text display method, which is characterized in that including:
Determine text control;
Obtain at least one constraints of the text control;
Calculate the corresponding receiving parameter of the text control, wherein the constraints is as the receiving parameter calculation basis;
Text packets rule is generated, the text packets rule is matched with the receiving parameter, is carried out for treating display text Grouping;
Display text is treated to be grouped and show.
2. according to the method described in claim 1, it is characterized in that, the receiving parameter include columns maximum value and each column most Big number of characters;
The display text for the treatment of is grouped and shows, specially:
Character in text to be shown is sequentially filled to two-dimensional array, until the two-dimensional array fills up or the text to be shown Character Filling in this finishes;The columns of the two-dimensional array is equal to the columns maximum value, the line number etc. of the two-dimensional array In the max number of characters;The Character Filling is from left to right filled out from top to bottom to preferential to arrange when the two-dimensional array It fills;
Character often capable in the two-dimensional array is reversed in the position of the row;
The character merged in the two-dimensional array after reversing obtains target display text, in the target display text per line character it Between be added with newline;
The target display text is refreshed by row and is shown in the text control.
3. according to the method described in claim 2, it is characterized in that, being refreshed by row in the text by the target display text Before this control is shown, further include:
For the different type character in the target display text, different character display rules is matched;
Correspondingly, being shown to the text to be shown, specially:
Rule is shown according to the character, and at least one character in the text to be shown is shown.
4. according to the method described in claim 3, it is characterized in that, for the inhomogeneity type-word in the target display text Symbol matches different character display rules, including:
The corresponding character types of at least one of target text character are analyzed, and determines and whether there is in preset rules library Standard character display rule corresponding with the character types;
If it is present the character with standard character display rule as the character is shown rule;
If it does not exist, then the default character being recorded in preset rules library display rule is shown as the character of the character Show rule.
5. according to the method described in claim 2, it is characterized in that, further including:
When the two-dimensional array fills up but character in the text to be shown is not filled by when finishing, using default spcial character generation For the last character in the two-dimensional array.
6. a kind of textual display device, which is characterized in that including:
Control determining module, for determining text control;
Adjust acquisition module, at least one constraints for obtaining the text control;
Parameter calculating module, for calculating the corresponding receiving parameter of the text control, wherein described in the constraints is used as Accommodate parameter calculation basis;
Rule generation module, for generating text packets rule, the text packets rule is matched with the receiving parameter, is used for Display text is treated to be grouped;
Text display module is grouped and shows for treating display text.
7. device according to claim 6, which is characterized in that the receiving parameter include columns maximum value and each column most Big number of characters;
The text display module, is specifically used for:
Character in text to be shown is sequentially filled to two-dimensional array, until the two-dimensional array fills up or the text to be shown Character Filling in this finishes;The columns of the two-dimensional array is equal to the columns maximum value, the line number etc. of the two-dimensional array In the max number of characters;The Character Filling is from left to right filled out from top to bottom to preferential to arrange when the two-dimensional array It fills;
Character often capable in the two-dimensional array is reversed in the position of the row;
The character merged in the two-dimensional array after reversing obtains target display text, in the target display text per line character it Between be added with newline;
The target display text is refreshed by row and is shown in the text control.
8. device according to claim 7, which is characterized in that further include rule match module, be specifically used for:
It is refreshed by row before the text control is shown by the target display text, text is shown for the target Different type character in this matches different character display rules;
Correspondingly, the text display module, is specifically used for:
Rule is shown according to the character, and at least one character in the text to be shown is shown.
9. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, which is characterized in that the processor realizes the text as described in any in claim 1-5 when executing described program Display methods.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor The text display method as described in any in claim 1-5 is realized when execution.
CN201810507301.1A 2018-05-24 2018-05-24 Text display method, device, equipment and storage medium Pending CN108763188A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810507301.1A CN108763188A (en) 2018-05-24 2018-05-24 Text display method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810507301.1A CN108763188A (en) 2018-05-24 2018-05-24 Text display method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108763188A true CN108763188A (en) 2018-11-06

Family

ID=64006483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810507301.1A Pending CN108763188A (en) 2018-05-24 2018-05-24 Text display method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108763188A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110609981A (en) * 2019-08-30 2019-12-24 北京金堤科技有限公司 Text processing method and device, electronic equipment and computer readable storage medium
CN111259640A (en) * 2018-11-15 2020-06-09 零氪科技(北京)有限公司 Dynamic list layout method based on text content
CN113436298A (en) * 2021-07-05 2021-09-24 深圳软牛科技有限公司 Method, device and related components for automatically generating Chinese character stroke order animation
CN113705190A (en) * 2021-09-02 2021-11-26 北京字节跳动网络技术有限公司 Text processing method, device and equipment
CN114077824A (en) * 2020-08-20 2022-02-22 西安诺瓦星云科技股份有限公司 Text display method, device and system
CN114444438A (en) * 2021-12-23 2022-05-06 北京罗克维尔斯科技有限公司 Text drawing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6055550A (en) * 1996-03-21 2000-04-25 Oracle Corporation Auto sizing of fields for displaying computer forms
CN102436439A (en) * 2010-09-29 2012-05-02 鸿富锦精密工业(深圳)有限公司 Text box and text display method
CN103914443A (en) * 2013-01-09 2014-07-09 北大方正集团有限公司 Mixed typesetting method and device for plurilingual characters
CN106484669A (en) * 2016-10-14 2017-03-08 大连理工大学 A kind of automatic composing method of Classification Oriented informative advertising newspaper
CN107066440A (en) * 2016-12-19 2017-08-18 广州视源电子科技股份有限公司 Input control method and system for vertical text

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6055550A (en) * 1996-03-21 2000-04-25 Oracle Corporation Auto sizing of fields for displaying computer forms
CN102436439A (en) * 2010-09-29 2012-05-02 鸿富锦精密工业(深圳)有限公司 Text box and text display method
CN103914443A (en) * 2013-01-09 2014-07-09 北大方正集团有限公司 Mixed typesetting method and device for plurilingual characters
CN106484669A (en) * 2016-10-14 2017-03-08 大连理工大学 A kind of automatic composing method of Classification Oriented informative advertising newspaper
CN107066440A (en) * 2016-12-19 2017-08-18 广州视源电子科技股份有限公司 Input control method and system for vertical text

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
云冰: "Android TextView 横排文字变竖排的简单方法", 《HTTPS://BLOG.CSDN.NET/MIDONG2000/ARTICLE/DETAILS/25662105》 *
极客分享: "Android TextView 横排文字变竖排的简单方法", 《HTTPS://WWW.GEEK-SHARE.COM/DETAIL/2610911960.HTML》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111259640A (en) * 2018-11-15 2020-06-09 零氪科技(北京)有限公司 Dynamic list layout method based on text content
CN111259640B (en) * 2018-11-15 2023-06-20 零氪科技(北京)有限公司 Dynamic list layout method based on text content
CN110609981A (en) * 2019-08-30 2019-12-24 北京金堤科技有限公司 Text processing method and device, electronic equipment and computer readable storage medium
CN114077824A (en) * 2020-08-20 2022-02-22 西安诺瓦星云科技股份有限公司 Text display method, device and system
CN113436298A (en) * 2021-07-05 2021-09-24 深圳软牛科技有限公司 Method, device and related components for automatically generating Chinese character stroke order animation
CN113436298B (en) * 2021-07-05 2023-09-19 深圳软牛科技有限公司 Method and device for automatically generating Chinese character stroke order animation and related components thereof
CN113705190A (en) * 2021-09-02 2021-11-26 北京字节跳动网络技术有限公司 Text processing method, device and equipment
CN114444438A (en) * 2021-12-23 2022-05-06 北京罗克维尔斯科技有限公司 Text drawing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108763188A (en) Text display method, device, equipment and storage medium
US11928419B2 (en) Information display method and apparatus, and storage medium and electronic device
US20110171617A1 (en) System and method for teaching pictographic languages
CN111240669B (en) Interface generation method and device, electronic equipment and computer storage medium
CN101410885B (en) Iteratively solving constraints in a font-hinting language
CN108961361B (en) Method and system for generating special effect text image and computer equipment
CN109359308A (en) Machine translation method, device and readable storage medium storing program for executing
CN108958731A (en) Application program interface generation method, device, equipment and storage medium
CN107562331A (en) Display method, device and equipment of handwritten characters and storage medium
US20180196597A1 (en) Prompted touchscreen for teaching user input and data entry
US11100722B2 (en) Method, apparatus, electronic device, and storage medium for displaying 3D shape in expanded manner
US9619126B2 (en) Computer-readable non-transitory storage medium with image processing program stored thereon, element layout changed material generating device, image processing device, and image processing system
Taranta et al. A dynamic pen-based interface for writing and editing complex mathematical expressions with math boxes
CN106648367A (en) Touch reading method and touch reading device
King Visual storytelling with D3: an introduction to data visualization in JavaScript
US11670018B2 (en) Method for replaying vector image
CN110135583A (en) The generation method of markup information, the generating means of markup information and electronic equipment
CN112256175B (en) Text display method, text display device, electronic equipment and computer readable storage medium
CN110163975B (en) Method, device and equipment for drawing space straight line and storage medium
Kuo et al. Mobilizing 3D virtual artifacts exhibition system of National Palace Museum
JP6286897B2 (en) Document display device, document display method, and document display program
KR20200018053A (en) Teaching materials for study of English
TW201435825A (en) Electronic apparatus, learning method, and computer program product thereof
JPH06274303A (en) Multiwindow display method
CN109493401A (en) PowerPoint generation method, device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181106