Summary of the invention
The embodiment of the invention provides a kind of text conversion method and device, solve when making text, it usually needs
According to the standard in fontlib, and preset font shows form corresponding with fontlib, when needing to the outer of font
When shape is simply adjusted, the adjustment of direct font shape but can not be directly carried out to already present text, it is caused
Text writing process can not transform graphical the technical issues of.
A kind of text conversion method provided in an embodiment of the present invention, comprising:
The font information of the text of selection is extracted, the font information includes font name and literal code;
Corresponding font file is read according to the font name, and font content is read according to the literal code;
The font read is depicted as character and graphic by presetting pattern object approach.
Preferably, the font information for extracting the text of selection specifically includes:
Obtain text conversion instruction;
The text of selection or the font information of text box are extracted according to text conversion instruction.
Preferably, the font information of the text or text box that extract selection according to text conversion instruction has
Body includes:
It determines the text for the selection extracted or the number of words of text box, and enters circulation and extract process;
Extract the font information of text or text box described in the n-th of selection.
Preferably, corresponding font file is read according to the font name, and word is read according to the literal code
Shape content specifically includes:
The font name of text or text box according to the n-th of selection reads corresponding font file, and
Font content is read according to the literal code.
Preferably, the font read character and graphic is depicted as by presetting pattern object approach to specifically include:
The font read is depicted as character and graphic by the Drawing Object mode of system itself, and described in continuation
Circulation is extracted process and is extracted to the font information of the N+1 texts or text box.
A kind of text conversion device provided in the embodiment of the present invention, comprising:
Extraction unit, the font information of the text for extracting selection, the font information includes font name and text
Word coding;
Reading unit, for reading corresponding font file according to the font name, and according to the literal code
Read font content;
Drawing unit, for the font read to be depicted as character and graphic by presetting pattern object approach.
Preferably, extraction unit specifically includes:
First extracts subelement, for obtaining text conversion instruction;
Second extracts subelement, for extracting the text of selection or the institute of text box according to text conversion instruction
State font information.
Preferably, second subelement is extracted, specifically included:
Determining module for determining the text for the selection extracted or the number of words of text box, and enters circulation and extracts stream
Journey;
Extraction module, for extracting the font information of text or text box described in the n-th of selection.
Preferably, reading unit, specifically for text described in the n-th according to selection or the font name of text box
Corresponding font file is read, and font content is read according to the literal code.
Preferably, drawing unit, specifically for the Drawing Object mode that the font read is passed through system itself
It is depicted as character and graphic, and continues the circulation and extracts process to the font information of the N+1 texts or text box
It extracts.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
The embodiment of the invention provides a kind of text conversion method and devices, wherein text conversion method includes: to extract choosing
The font information for the text selected, font information include font name and literal code;It is read according to font name corresponding
Font file, and font content is read according to literal code;The font read is depicted as by presetting pattern object approach
Character and graphic.In the present embodiment, corresponding word is read by the font name of the font information according to the text for extracting selection
Body file, and font content is read according to the literal code of font information, and the font read is passed through into presetting pattern object
Mode is depicted as character and graphic, so that the subsequent adjustment that can carry out text shape by the character and graphic of conversion, solves
When making text, it usually needs according to the standard in fontlib, and preset font shows shape corresponding with fontlib
Formula but directly can not carry out direct font to already present text when needing the shape to font simply to be adjusted
The adjustment of shape, caused text writing process can not transform graphical the technical issues of.
Specific embodiment
The embodiment of the invention provides a kind of text conversion method and device, solve when making text, it usually needs
According to the standard in fontlib, and preset font shows form corresponding with fontlib, when needing to the outer of font
When shape is simply adjusted, the adjustment of direct font shape but can not be directly carried out to already present text, it is caused
Text writing process can not transform graphical the technical issues of.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field
Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention
Range.
Referring to Fig. 1, a kind of one embodiment of the text conversion method provided in the embodiment of the present invention includes:
101, the font information of the text of selection is extracted, font information includes font name and literal code;
In the present embodiment, when needing to the text editted, or the font of text edited carries out shape tune
When whole, need to extract the font information of the text of selection, font information includes font name and literal code, Ke Yili
Solution, the font information of the text above-mentioned for extracting rotation can be to be extracted from fontlib.
102, corresponding font file is read according to font name, and font content is read according to literal code;
When the font information for the text for extracting selection, after font information includes font name and literal code, need
Corresponding font file is read according to font name, and font content is read according to literal code.
103, the font read is depicted as character and graphic by presetting pattern object approach.
After reading corresponding font file according to font name, and read font content according to literal code, need
The font read is depicted as character and graphic by presetting pattern object approach.
In the present embodiment, corresponding font is read by the font name of the font information according to the text for extracting selection
File, and font content is read according to the literal code of font information, and the font read is passed through into presetting pattern object side
Formula is depicted as character and graphic, so that the subsequent adjustment that can carry out text shape by the character and graphic of conversion, solves and making
When composition notebook, it usually needs according to the standard in fontlib, and preset font shows form corresponding with fontlib,
When needing the shape to font simply to be adjusted, but direct font shape directly can not be carried out to already present text
Adjustment, caused text writing process can not transform graphical the technical issues of.
The process of text conversion method is described in detail above, will retouch below to specific conversion process further progress
It states, referring to Fig. 2, a kind of another embodiment of the text conversion method provided in the embodiment of the present invention includes:
201, text conversion instruction is obtained;
In the present embodiment, when needing to the text editted, or the font of text edited carries out shape tune
When whole, need to obtain text conversion instruction, it is to be understood that text conversion instruction can be to be triggered on interface.
202, the text for the selection extracted or the number of words of text box are determined, and enters circulation and extracts process;
After obtaining text conversion instruction, it is thus necessary to determine that the text of the selection of extraction or the number of words of text box, and enter
Circulation extracts process.
203, the n-th text of selection or the font information of text box are extracted;
When the number of words for the text or text box for determining the selection extracted, and enter after circulation extraction process, needs to extract
The n-th text of selection or the font information of text box, font information include font name and literal code, it is possible to understand that
It is that the font information of the text above-mentioned for extracting rotation can be to extract from fontlib.
204, according to the corresponding font file of the font name of the n-th text of selection or text box reading, and according to
Font content is read in literal code;
After the font information of the n-th text or text box that extract selection, need according to the n-th text of selection or
The font name of text box reads corresponding font file, and reads font content according to literal code.
205, the font read is depicted as character and graphic by the Drawing Object mode of system itself, and continued cycling through
Process is extracted to extract the font information of N+1 text or text box.
When reading corresponding font file according to the font name of the n-th text of selection or text box, and according to text
After word coding reads font content, the font that will be read is needed to be depicted as text by the Drawing Object mode of system itself
Figure, and extraction process is continued cycling through, continue step 203 and the font information of N+1 text or text box is extracted.
It should be noted that the Drawing Object mode of system above-mentioned itself can be office Drawing Object, have herein
Body is without limitation.
In the present embodiment, corresponding font is read by the font name of the font information according to the text for extracting selection
File, and font content is read according to the literal code of font information, and the font read is passed through into presetting pattern object side
Formula is depicted as character and graphic, so that the subsequent adjustment that can carry out text shape by the character and graphic of conversion, solves and making
When composition notebook, it usually needs according to the standard in fontlib, and preset font shows form corresponding with fontlib,
When needing the shape to font simply to be adjusted, but direct font shape directly can not be carried out to already present text
Adjustment, caused text writing process can not transform graphical the technical issues of, meanwhile, the font read is passed through into system
The Drawing Object mode of itself is depicted as character and graphic, and continues cycling through and extract process to the word of N+1 text or text box
The design that body information extracts is furthermore achieved and converts to multiple texts in whole text.
Referring to Fig. 3, a kind of one embodiment of the text conversion device provided in the embodiment of the present invention includes:
Extraction unit 301, the font information of the text for extracting selection, font information includes font name and text
Coding;
Reading unit 302 for reading corresponding font file according to font name, and reads word according to literal code
Shape content;
Drawing unit 303, for the font read to be depicted as character and graphic by presetting pattern object approach.
In the present embodiment, the word of the font information of the text of selection is extracted according to extraction unit 301 by reading unit 302
Body title reads corresponding font file, and reads font content according to the literal code of font information, and drawing unit 303 will
The font read is depicted as character and graphic by presetting pattern object approach, so that subsequent can pass through the character and graphic of conversion
The adjustment for carrying out text shape, solves when making text, it usually needs according to the standard in fontlib, and preset word
Body shows form corresponding with fontlib, but can not be directly right when needing the shape to font simply to be adjusted
Already present text carries out the adjustment of direct font shape, caused text writing process can not the technology of transform graphical ask
Topic.
The above is that each unit of text conversion device is described in detail, and sub-unit is carried out detailed retouch below
It states, referring to Fig. 4, a kind of one embodiment of the text conversion device provided in the embodiment of the present invention includes:
Extraction unit 401, the font information of the text for extracting selection, font information includes font name and text
Coding;
Wherein, extraction unit 401 can further include:
First extracts subelement 4011, for obtaining text conversion instruction;
Second extracts subelement 4012, and the font of text or text box for extracting selection according to text conversion instruction is believed
Breath.
Second extracts subelement 4012, specifically includes:
Determining module 4012a for determining the text for the selection extracted or the number of words of text box, and enters circulation and extracts stream
Journey;
Extraction module 4012b, for extracting the n-th text of selection or the font information of text box.
Reading unit 402 for reading corresponding font file according to font name, and reads word according to literal code
Shape content, specifically for reading corresponding font file, and root according to the n-th text of selection or the font name of text box
Font content is read according to literal code.
Drawing unit 403, for the font read to be depicted as character and graphic by presetting pattern object approach, specifically
For the font read to be depicted as character and graphic by the Drawing Object mode of system itself, and continue cycling through extraction process
The font information of N+1 text or text box is extracted.
In the present embodiment, the word of the font information of the text of selection is extracted according to extraction unit 401 by reading unit 402
Body title reads corresponding font file, and reads font content according to the literal code of font information, and drawing unit 403 will
The font read is depicted as character and graphic by presetting pattern object approach, so that subsequent can pass through the character and graphic of conversion
The adjustment for carrying out text shape, solves when making text, it usually needs according to the standard in fontlib, and preset word
Body shows form corresponding with fontlib, but can not be directly right when needing the shape to font simply to be adjusted
Already present text carries out the adjustment of direct font shape, caused text writing process can not the technology of transform graphical ask
Topic, meanwhile, the font read is depicted as character and graphic by the Drawing Object mode of system itself by drawing unit 403, and
It continues cycling through and extracts the design that extracts to the font information of N+1 text or text box of process, be furthermore achieved pair
Multiple texts in whole text are converted.
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 herein, 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 logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It 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 through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.