Summary of the invention
Embodiments provide a kind of text conversion method and device, solve when making text,
Typically require according to the standard in fontlib, and the most preset font shows the shape corresponding with fontlib
Formula, when needing simply to adjust the profile of font, but cannot directly enter already present text
The adjustment of the direct font profile of row, the text writing process caused cannot the technical problem of transform graphical.
A kind of text conversion method that the embodiment of the present invention provides, including:
Extracting the font information of the text selected, described font information includes font name and literal code;
Read corresponding font file according to described font name, and read word according to described literal code
Shape content;
The described font read is depicted as character and graphic by presetting pattern object approach.
Preferably, the font information extracting the text selected specifically includes:
Obtain text conversion instruction;
The described text or the described font information of text box selected is extracted according to described text conversion instruction.
Preferably, the described text or the described word of text box selected is extracted according to described text conversion instruction
Body information specifically includes:
Determine described text or the number of words of text box of the selection of extraction, and enter circulation extraction flow process;
Extract text or the described font information of text box described in the n-th selected.
Preferably, read corresponding font file according to described font name, and compile according to described word
Code reads font content and specifically includes:
Described font name according to text described in the n-th selected or text box reads corresponding font
File, and read font content according to described literal code.
Preferably, by presetting pattern object approach, the described font read is depicted as character and graphic to have
Body includes:
The described font read is depicted as character and graphic by the Drawing Object mode of system self, and
Continue described circulation extraction flow process the described font information of N+1 described text or text box is carried
Take.
A kind of text conversion device provided in the embodiment of the present invention, including:
Extraction unit, for extracting the font information of the text of selection, described font information includes font
Title and literal code;
Read unit, for reading corresponding font file according to described font name, and according to described
Font content is read in literal code;
Drawing unit, for being depicted as word by the described font read by presetting pattern object approach
Figure.
Preferably, extraction unit specifically includes:
First extracts subelement, is used for obtaining text conversion instruction;
Second extracts subelement, for extracting the described text or literary composition selected according to described text conversion instruction
The described font information of this frame.
Preferably, second extracts subelement, specifically includes:
Determining module, for determining described text or the number of words of text box of the selection of extraction, and entrance follows
Ring extracts flow process;
Extraction module, for extracting text or the described font information of text box described in the n-th of selection.
Preferably, read unit, specifically for according to text or the institute of text box described in the n-th selected
State font name and read corresponding font file, and read font content according to described literal code.
Preferably, drawing unit, the described font specifically for reading passes through the figure of system self
Object approach is depicted as character and graphic, and continue described circulation extract flow process to N+1 described text or
The described font information of text box extracts.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
Embodiments provide a kind of text conversion method and device, wherein, text conversion method bag
Include: extracting the font information of the text selected, font information includes font name and literal code;Root
Read corresponding font file according to font name, and read font content according to literal code;To read
To font be depicted as character and graphic by presetting pattern object approach.In the present embodiment, by according to carrying
The font name of the font information taking the text of selection reads corresponding font file, and believes according to font
Font content is read in the literal code of breath, and is drawn by presetting pattern object approach by the font read
Become character and graphic so that the follow-up adjustment that can be carried out word profile by the character and graphic of conversion, solve
When making text, it usually needs according to the standard in fontlib, and the most preset font shows and word
Form corresponding in body storehouse, when needing the profile of font is simply adjusted, but cannot be direct
Already present text carries out the adjustment of direct font profile, and the text writing process caused cannot turn
Change the technical problem of figure.
Detailed description of the invention
Embodiments provide a kind of text conversion method and device, solve when making text,
Typically require according to the standard in fontlib, and the most preset font shows the shape corresponding with fontlib
Formula, when needing simply to adjust the profile of font, but cannot directly enter already present text
The adjustment of the direct font profile of row, the text writing process caused cannot the technical problem of transform graphical.
For making the goal of the invention of the present invention, feature, the advantage can be the most obvious and understandable, below will
In conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground describes, it is clear that the embodiments described below are only a part of embodiment of the present invention, and not all
Embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creativeness
The all other embodiments obtained under work premise, broadly fall into the scope of protection of the invention.
Refer to Fig. 1, an embodiment bag of a kind of text conversion method provided in the embodiment of the present invention
Include:
101, extracting the font information of the text selected, font information includes font name and literal code;
In the present embodiment, when needing the word editted, or the font of the text edited is entered
The when that row profile adjusting, needing to extract the font information of the text selected, font information includes font
Title and literal code, it is to be understood that the font information of the text that aforesaid extraction rotates can be
Extract from fontlib.
102, read corresponding font file according to font name, and read in font according to literal code
Hold;
When extracting the font information of text selected, font information include font name and literal code it
After, need to read corresponding font file according to font name, and read in font according to literal code
Hold.
103, the font read is depicted as character and graphic by presetting pattern object approach.
When reading corresponding font file according to font name, and read font content according to literal code
Afterwards, need by presetting pattern object approach, the font read is depicted as character and graphic.
In the present embodiment, by reading relatively according to the font name of the font information extracting the text selected
The font file answered, and read font content, and the word that will read according to the literal code of font information
Shape is depicted as character and graphic by presetting pattern object approach so that the follow-up word graph that can pass through conversion
Shape carries out the adjustment of word profile, solves when making text, it usually needs according to the mark in fontlib
Standard, and the most preset font shows the form corresponding with fontlib, when needing to enter the profile of font
When row simply adjusts, but directly already present text cannot be carried out the adjustment of direct font profile,
The text writing process caused cannot the technical problem of transform graphical.
The process of text conversion method is described in detail above, concrete transformation process will be entered one below
Stepping line description, refers to Fig. 2, another of a kind of text conversion method provided in the embodiment of the present invention
Embodiment includes:
201, text conversion instruction is obtained;
In the present embodiment, when needing the word editted, or the font of the text edited is entered
The when that row profile adjusting, need to obtain text conversion instruction, it is to be understood that text conversion instruction
Can be to trigger on interface.
202, determine the text of the selection of extraction or the number of words of text box, and enter circulation extraction flow 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 extraction flow process.
203, the n-th text selected or the font information of text box are extracted;
When determining the text of selection or the number of words of text box of extraction, and enter after circulation extracts flow process,
Needing to extract the n-th text selected or the font information of text box, font information includes font name
And literal code, it is to be understood that the font information of the text that aforesaid extraction rotates can be from word
Body storehouse is extracted.
204, corresponding font literary composition is read according to the font name of the n-th text selected or text box
Part, and read font content according to literal code;
After the font information extracting n-th text or the text box selected, need according to the selected
The font name of N number of text or text box reads corresponding font file, and reads according to literal code
Font content.
205, the font read is depicted as character and graphic by the Drawing Object mode of system self, and
Continue cycling through extraction flow process the font information of N+1 text or text box is extracted.
When the font name according to the n-th text selected or text box reads corresponding font file,
And after reading font content according to literal code, need to pass through the font read the figure of system self
Shape object approach is depicted as character and graphic, and continues cycling through extraction flow process, continues step 203 to N+1
The font information of individual text or text box extracts.
It should be noted that the Drawing Object mode of aforesaid system self can be office Drawing Object,
Specifically do not limit herein.
In the present embodiment, by reading relatively according to the font name of the font information extracting the text selected
The font file answered, and read font content, and the word that will read according to the literal code of font information
Shape is depicted as character and graphic by presetting pattern object approach so that the follow-up word graph that can pass through conversion
Shape carries out the adjustment of word profile, solves when making text, it usually needs according to the mark in fontlib
Standard, and the most preset font shows the form corresponding with fontlib, when needing to enter the profile of font
When row simply adjusts, but directly already present text cannot be carried out the adjustment of direct font profile,
The text writing process caused cannot the technical problem of transform graphical, the font read is led to meanwhile
The Drawing Object mode crossing system self is depicted as character and graphic, and continues cycling through extraction flow process to N+1
The font information of individual text or text box carries out the design extracted, and furthermore achieved that in overall text
Multiple words are changed.
Refer to Fig. 3, an embodiment bag of a kind of text conversion device provided in the embodiment of the present invention
Include:
Extraction unit 301, for extracting the font information of the text of selection, font information includes fontname
Claim and literal code;
Read unit 302, for reading corresponding font file according to font name, and compile according to word
Code reads font content;
Drawing unit 303, for being depicted as word graph by the font read by presetting pattern object approach
Shape.
In the present embodiment, extract the word of the text selected according to extraction unit 301 by reading unit 302
The font name of body information reads corresponding font file, and reads according to the literal code of font information
Font content, the font read is depicted as word by presetting pattern object approach by drawing unit 303
Figure so that the follow-up adjustment that can be carried out word profile by the character and graphic of conversion, is solved in system
During composition notebook, it usually needs according to the standard in fontlib, and the most preset font show with fontlib in
Corresponding form, when needing the profile of font is simply adjusted, but cannot be directly to depositing
Text carry out the adjustment of direct font profile, the text writing process caused cannot transform graphical
Technical problem.
The above is that each unit to text conversion device is described in detail, and is carried out by sub-unit below
Detailed description, refers to Fig. 4, a reality of a kind of text conversion device provided in the embodiment of the present invention
Execute example to include:
Extraction unit 401, for extracting the font information of the text of selection, font information includes fontname
Claim and literal code;
Wherein, extraction unit 401 can further include:
First extracts subelement 4011, is used for obtaining text conversion instruction;
Second extracts subelement 4012, for extracting the text or text box selected according to text conversion instruction
Font information.
Second extracts subelement 4012, specifically includes:
Determining module 4012a, for determining text or the number of words of text box of the selection of extraction, and entrance follows
Ring extracts flow process;
Extraction module 4012b, for extracting n-th text or the font information of text box of selection.
Read unit 402, for reading corresponding font file according to font name, and compile according to word
Code reads font content, reads specifically for the font name according to the n-th text selected or text box
Corresponding font file, and read font content according to literal code.
Drawing unit 403, for being depicted as word graph by the font read by presetting pattern object approach
Shape, specifically for the font read is depicted as character and graphic by the Drawing Object mode of system self,
And continue cycling through extraction flow process the font information of N+1 text or text box is extracted.
In the present embodiment, extract the word of the text selected according to extraction unit 401 by reading unit 402
The font name of body information reads corresponding font file, and reads according to the literal code of font information
Font content, the font read is depicted as word by presetting pattern object approach by drawing unit 403
Figure so that the follow-up adjustment that can be carried out word profile by the character and graphic of conversion, is solved in system
During composition notebook, it usually needs according to the standard in fontlib, and the most preset font show with fontlib in
Corresponding form, when needing the profile of font is simply adjusted, but cannot be directly to depositing
Text carry out the adjustment of direct font profile, the text writing process caused cannot transform graphical
Technical problem, meanwhile, drawing unit 403 is by Drawing Object by system self of the font that reads
Mode is depicted as character and graphic, and continues cycling through extraction flow process to N+1 text or the font of text box
Information carries out the design extracted, and furthermore achieved that and changes the multiple words in overall text.
Those skilled in the art is it can be understood that arrive, and for convenience and simplicity of description, above-mentioned retouches
The specific works process of the system stated, device and unit, is referred to the correspondence in preceding method embodiment
Process, does not repeats them here.
In several embodiments provided herein, it should be understood that disclosed system, device and
Method, can realize by another way.Such as, device embodiment described above is only shown
Meaning property, such as, the division of described unit, be only a kind of logic function and divide, actual can when realizing
There to be other dividing mode, the most multiple unit or assembly can in conjunction with or be desirably integrated into another
System, or some features can ignore, or do not perform.Another point, shown or discussed each other
Coupling direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, device or unit
Or communication connection, can be electrical, machinery or other form.
The described unit illustrated as separating component can be or may not be physically separate, makees
The parts shown for unit can be or may not be physical location, i.e. may be located at a place,
Or can also be distributed on multiple NE.Can select according to the actual needs part therein or
The whole unit of person realizes the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit,
Can also be that unit is individually physically present, it is also possible to two or more unit are integrated in a list
In unit.Above-mentioned integrated unit both can realize to use the form of hardware, it would however also be possible to employ software function list
The form of unit realizes.
If described integrated unit realizes and as independent production marketing using the form of SFU software functional unit
Or when using, can be stored in a computer read/write memory medium.Based on such understanding, this
The part that the most in other words prior art contributed of technical scheme of invention or this technical scheme
Completely or partially can embody with the form of software product, this computer software product is stored in one
In storage medium, including some instructions with so that computer equipment (can be personal computer,
Server, or the network equipment etc.) perform completely or partially walking of method described in each embodiment of the present invention
Suddenly.And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD
Etc. the various media that can store program code.
The above, above example only in order to technical scheme to be described, is not intended to limit;
Although being described in detail the present invention with reference to previous embodiment, those of ordinary skill in the art should
Work as understanding: the technical scheme described in foregoing embodiments still can be modified by it, or to it
Middle part technical characteristic carries out equivalent;And these amendments or replacement, do not make appropriate technical solution
Essence depart from various embodiments of the present invention technical scheme spirit and scope.