CN109992749A - A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing - Google Patents

A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing Download PDF

Info

Publication number
CN109992749A
CN109992749A CN201711478866.3A CN201711478866A CN109992749A CN 109992749 A CN109992749 A CN 109992749A CN 201711478866 A CN201711478866 A CN 201711478866A CN 109992749 A CN109992749 A CN 109992749A
Authority
CN
China
Prior art keywords
string
target
font
character
electronic equipment
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
CN201711478866.3A
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.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
Guangzhou Jinshan Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Jinshan Mobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Guangzhou Jinshan Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201711478866.3A priority Critical patent/CN109992749A/en
Publication of CN109992749A publication Critical patent/CN109992749A/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/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography

Abstract

The embodiment of the invention provides a kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing.This method is applied to electronic equipment, this method comprises: the font name of font corresponding to the text in document to be shown is determined, as target font name;Character string corresponding to target font name is obtained, as target string;The editing distance of target string and each preset characters string is calculated using editing distance algorithm;Wherein, a preset characters string are as follows: character string corresponding to a kind of pre-stored font name of font in the electronic equipment;Text is shown using font corresponding to the corresponding preset characters string of smallest edit distance.Scheme is provided using the embodiment of the present invention, so that the text in the document can be shown when showing document using any electronic equipment, improves the document reading experience of user.

Description

A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing
Technical field
The present invention relates to word processing technical field, more particularly to a kind of character displaying method, device, electronic equipment and Readable storage medium storing program for executing.
Background technique
Currently, user is often through PDF (Portable Document Format, the Portable Document in electronic equipment Format), the documents editings software such as word and PPT (PowerPoint, PowerPoint) edit and show text.Wherein, it is compiling During collecting text, user can be according to actual needs configured the font type of text, such as the font of text is set It is set to the Song typeface.Wherein, a kind of font type and a font name are uniquely corresponding;Text includes but is not limited to Chinese and English Text.
But when user opens the document that editor obtains in other electronic equipments, usually it will appear: in the electronics The case where can not find the corresponding font of text in the document in equipment.In the case of this kind, will lead to text cannot be shown (such as A box is shown in the text position), seriously affect the document reading experience of user.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of character displaying method, device, electronic equipment and readable storage medium Matter, with when showing document using any electronic equipment, the text in the document can be shown, to promote the document of user Reading experience.Specific technical solution is as follows:
In a first aspect, being applied to electronic equipment, the method can the embodiment of the invention provides a kind of character displaying method To include the following steps:
The font name for determining font corresponding to the text in document to be shown, as target font name;
Character string corresponding to the target font name is obtained, as target string;
The editing distance of the target string Yu each preset characters string is calculated using editing distance algorithm;Wherein, One preset characters string are as follows: character string corresponding to a kind of pre-stored font name of font in the electronic equipment;
The text is shown using font corresponding to the corresponding preset characters string of smallest edit distance.
Optionally, described to obtain character string corresponding to the target font name, it, can the step of as target string To include:
Judge whether the target font name is English character string;
If so, judging in the English character string with the presence or absence of space character;
Space character present in the English character string is deleted, obtains target string by space character if it exists.
Optionally, described the step of space character present in the English character string is deleted, target string is obtained, May include:
Upper case character in the English character string is revised as lowercase character, and will be present in the English character string Space character is deleted, and target string is obtained.
Optionally, if judging, the target font name is not English character string, and the method can also include:
Judge whether the target font name is Chinese;
If Chinese, the Chinese is converted into phonetic, obtains target string.
Optionally, the editor that the target string Yu each preset characters string are calculated using editing distance algorithm Apart from the step of, may include:
Using editing distance algorithm, and the target string is successively calculated according to default computation sequence and is preset with each The editing distance of character string;
It, will be for zero editor when the editing distance that the target string and a preset characters string is calculated is zero Distance is used as smallest edit distance, and triggers and described show font corresponding to the corresponding preset characters string of smallest edit distance The step of showing the text.
Second aspect, the embodiment of the invention also provides a kind of character display apparatus, are applied to electronic equipment, described device May include:
Determination unit, for determining the font name of font corresponding to the text in document to be shown, as target font Title;
Obtaining unit, for obtaining character string corresponding to the target font name, as target string;
Computing unit, for calculating the volume of the target string Yu each preset characters string using editing distance algorithm Collect distance;Wherein, a preset characters string are as follows: in the electronic equipment corresponding to a kind of pre-stored font name of font Character string;
Display unit, for showing the text using font corresponding to the corresponding preset characters string of smallest edit distance Word.
Optionally, the obtaining unit may include:
First judgment sub-unit, for judging whether the target font name is English character string;
Second judgment sub-unit, for judging that the target font name is English character when first judgment sub-unit When string, judge in the English character string with the presence or absence of space character;
Subelement is deleted, for judging that there are space characters in the English character string when second judgment sub-unit When, space character present in the English character string is deleted, target string is obtained.
Optionally, the deletion subelement is specifically used for:
Upper case character in the English character string is revised as lowercase character, and will be present in the English character string Space character is deleted, and target string is obtained.
Optionally, in embodiments of the present invention, described device can also include:
Third judgment sub-unit, for judging that the target font name is not English words when first judgment sub-unit When symbol string, judge whether the target font name is Chinese;
Conversion subunit, for when the third judgment sub-unit judges the entitled Chinese of the target font, The Chinese is converted into phonetic, obtains target string.
Optionally, in embodiments of the present invention, the computing unit may include:
Computation subunit for utilizing editing distance algorithm, and successively calculates the target word according to default computation sequence The editing distance of symbol string and each preset characters string;
Subelement is triggered, for the target string and a preset characters string to be calculated when the sub- operator unit Editing distance will be zero editing distance as smallest edit distance when being zero, and trigger the display unit and compile minimum Volume font corresponding to the corresponding preset characters string shows the text.
The third aspect, the embodiment of the invention also provides a kind of electronic equipment, including processor, communication interface, memory And communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any one of first aspect text importing side The method and step that method embodiment provides.
Fourth aspect, the embodiment of the invention also provides a kind of readable storage medium storing program for executing, the readable storage medium storing program for executing is electronics Readable storage medium storing program for executing in equipment is stored with computer program in the readable storage medium storing program for executing, and the computer program is processed The method and step that any one of first aspect character displaying method embodiment provides is realized when device executes.
In the embodiment of the present invention, due to being that record has: the mapping relations of text and font name in document in document, Thus when electronic equipment needs to show the text in document to be shown, electronic equipment can determine the document to be shown In text correspond to the font name of font, and using the corresponding font name of the text as target font name.Then, may be used also To obtain character string corresponding to the target font name, and can be using the character string as target string.Later, Ke Yili With editing distance algorithm, it is corresponding to calculate the font name of each font stored in the target string and the electronic equipment The editing distance of preset characters string.It is then possible to determine the smallest edit distance in the editing distance being calculated, and utilizing should The corresponding preset characters string of smallest edit distance corresponding font shows the text.
In this way, be shown the text when showing document using any electronic equipment, in the document can, avoid Occur the case where text position shows box.And inventors have found that font name is more close in existing fontlib Then the form of font is also just closer, thus in embodiments of the present invention, it can find and the text in the document to be shown Originally the font that the form of font to display is closer to, and can use the font found to show the text, Improve the document reading experience of user.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of character displaying method provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of character display apparatus provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In order to solve the problems in the existing technology, the embodiment of the invention provides a kind of character displaying method, device, Electronic equipment and readable storage medium storing program for executing.
Character displaying method provided in an embodiment of the present invention is illustrated first below.
Referring to Fig. 1, character displaying method provided in an embodiment of the present invention be applied to electronic equipment, this method may include as Lower step:
S101: determining the font name of font corresponding to the text in document to be shown, as target font name;
S102: character string corresponding to the target font name is obtained, as target string;
S103: the editing distance of the target string Yu each preset characters string is calculated using editing distance algorithm;Its In, a preset characters string are as follows: character string corresponding to a kind of pre-stored font name of font in the electronic equipment;
S104: the text is shown using font corresponding to the corresponding preset characters string of smallest edit distance.
In the embodiment of the present invention, due to being that record has: the mapping relations of text and font name in document in document, Thus when electronic equipment needs to show the text in document to be shown, electronic equipment can determine the document to be shown In text correspond to the font name of font, and using the corresponding font name of the text as target font name.Then, may be used also To obtain character string corresponding to the target font name, and can be using the character string as target string.Later, Ke Yili With editing distance algorithm, it is corresponding to calculate the font name of each font stored in the target string and the electronic equipment The editing distance of preset characters string.It is then possible to determine the smallest edit distance in the editing distance being calculated, and utilizing should The corresponding preset characters string of smallest edit distance corresponding font shows the text.
In this way, be shown the text when showing document using any electronic equipment, in the document can, avoid Occur the case where text position shows box.And inventors have found that font name is more close in existing fontlib Then the form of font is also just closer, thus in embodiments of the present invention, it can find and the text in the document to be shown Originally the font that the form of font to display is closer to, and can use the font found to show the text, Improve the document reading experience of user.
Wherein, the document to be shown in the embodiment of the present invention includes but is not limited to: PDF (Portable Document Format, portable document format) document, word document, PPT (PowerPoint, PowerPoint) document and WPS (WPS Software, WPS software) document.Text in document to be shown includes but is not limited to Chinese, English and Arabic number Word.
In addition, editing distance refers to: referring between two character strings, changed into needed for another character string as a character string Minimum edit operation times.The edit operation of license includes: that a character is substituted for one another character, insertion character With one character of deletion.Wherein, editing distance is smaller, then shows that the similarity of two character strings is bigger.In the embodiment of the present invention In, editing distance is smaller, then shows that corresponding two character strings of two font names are closer, i.e., two font names more connect Closely.
Character displaying method provided in an embodiment of the present invention is illustrated below with reference to specific example.
Assuming that user edits in electronic equipment A obtains document a, also, the text recorded in document a is Chinese, and And font is the font of literary 2 version of ancient cooking vessel (i.e. Wingdings 2).And assume not stored in the fontlib in electronic equipment B have The font of literary 2 version of ancient cooking vessel (i.e. Wingdings 2).
When user needs to open the document a in electronic equipment B, document a is then document to be shown.Electronic equipment B can To determine the text in the document a according to the corresponding relationship of the text and font name (i.e. Wingdings 2) that store in document a The font name of font corresponding to word is Wingdings 2.
Wherein, in one implementation, in order to improve the speed for obtaining target string, electronic equipment B can be direct Font name Wingdings 2 is determined as the corresponding character string of the font name, and using the character string as target string.
In another implementation, electronic equipment B can first judge whether font name Wingdings 2 is English words Symbol string, since electronic equipment B can detecte in font name Wingdings 2 comprising English alphabet and Arabic numerals, Thus font name Wingdings 2 can be determined as English character string.In order to improve the standard for the editing distance being calculated Exactness can also detect in English character string whether include space character.As it can be seen that electronic equipment B can detecte English There are space characters in character string Wingdings 2, then can remove space character, obtain target string Wingdings2。
Further, the upper case character in English character string Wingdings 2 can also be revised as lowercase character, thus Available target string wingdings2.
Assuming that being previously stored in electronic equipment B: Vivaldi font, and 3 version Wingdings3 font of literary ancient cooking vessel.That , electronic equipment B can use editing distance algorithm and is calculated: be converted into another character string by character string Vivaldi Minimum editor's number (being denoted as first number) needed for Wingdings 2, and be converted by character string Wingdings 3 another Minimum editor's number (being denoted as second number) needed for character string Wingdings 2.Also, by editing distance calculate it is found that First time several numerical value is greater than second several numerical value.Thus, it can be known that font name Wingdings 3 and font name Wingdings 2 is closest, that is to say, that the form of font is closest.Therefore, it can use font name Wingdings Font corresponding to 3 shows the font in document a.
It is understood that being previously stored in electronic equipment B: Vivaldi font, and 3 version Wingdings of literary ancient cooking vessel 3 fonts are merely illustrative, are not limited to 3 font of Vivaldi font and Wingdings certainly.Also, carrying out editing distance It, can also be in the way of above-mentioned acquisition target string, to obtain pre-stored every kind of word in electronic equipment before calculating The corresponding preset characters string of the font name of body, so that the editing distance being calculated is more acurrate.
It is, of course, also possible to assume to be previously stored in electronic equipment B: Vivaldi font, 3 version Wingdings 3 of Wen Ding Font, and 2 version Wingdings of literary ancient cooking vessel, 2 font.And the font name of above-mentioned font is stored in the word in electronic equipment B In body title table, and successively record has from top to bottom in the font name table: font name Wingdings 2, font name Wingdings 3 and font name Vivaldi.It is possible to according to default computation sequence: carrying out matching primitives from top to bottom Sequence successively calculates editing distance.Wherein, it when electronic equipment B is calculated according to sequence from top to bottom, can calculate first To: being converted into minimum editor's number needed for another character string Wingdings 2 as character string Wingdings 2 is zero.At this In the case of kind, it can determine there is font identical with the font of text in document a in electronic equipment B, it at this time can should The editing distance for being zero is determined as smallest edit distance, and the corresponding character string Wingdings 2 of the smallest edit distance is right 2 font of Wingdings answered shows the text in the document a.
It should be noted that the font of all texts in document a is that 2 font of Wingdings is merely illustrative, certainly, The font of a part of text in document a can be Wingdings 2, and the font of another part text is the Song typeface, this is also to close Reason.Above-mentioned default computation sequence may be: carry out the sequence of matching primitives from the bottom up, this is also rational.
Wherein, distance editor algorithm can specifically be realized by dynamic programming algorithm, and be calculated by the Dynamic Programming Time needed for method can shorten calculating editing distance.
Furthermore it is also possible to assume that the font name of a text "Yes" in document a is the Song typeface, i.e., font type is Song Body.Thus, the font name Song typeface that electronic equipment B can recognize text "Yes" is Chinese.At this point, electronic equipment B can The Chinese Song typeface is converted to phonetic songti, and by fontname pre-stored in electronic equipment B, for Chinese Title is converted into phonetic, obtains preset characters corresponding to font name pre-stored, for Chinese in electronic equipment B String.And then phonetic songti can be calculated and carry out editing distance with each of electronic equipment preset characters string, this is also to close Reason.
It to sum up, can text when showing document using any electronic equipment, in the document using the embodiment of the present invention It can be shown, improve the document reading experience of user.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of character display apparatus, referring to fig. 2, should Device is applied to electronic equipment, the apparatus may include:
Determination unit 201, for determining the font name of font corresponding to the text in document to be shown, as target word Body title;
Obtaining unit 202, for obtaining character string corresponding to target font name, as target string;
Computing unit 203, for calculating the volume of target string and each preset characters string using editing distance algorithm Collect distance;Wherein, a preset characters string are as follows: word corresponding to a kind of pre-stored font name of font in electronic equipment Symbol string;
Display unit 204, for showing text using font corresponding to the corresponding preset characters string of smallest edit distance Word.
In the embodiment of the present invention, due to being that record has: the mapping relations of text and font name in document in document, Thus when electronic equipment needs to show the text in document to be shown, electronic equipment can determine the document to be shown In text correspond to the font name of font, and using the corresponding font name of the text as target font name.Then, may be used also To obtain character string corresponding to the target font name, and can be using the character string as target string.Later, Ke Yili With editing distance algorithm, it is corresponding to calculate the font name of each font stored in the target string and the electronic equipment The editing distance of preset characters string.It is then possible to determine the smallest edit distance in the editing distance being calculated, and utilizing should The corresponding preset characters string of smallest edit distance corresponding font shows the text.
In this way, be shown the text when showing document using any electronic equipment, in the document can, avoid Occur the case where text position shows box.And inventors have found that font name is more close in existing fontlib Then the form of font is also just closer, thus in embodiments of the present invention, it can find and the text in the document to be shown Originally the font that the form of font to display is closer to, and can use the font found to show the text, Improve the document reading experience of user.
Optionally, in embodiments of the present invention, which may include:
First judgment sub-unit, for judging whether target font name is English character string;
Second judgment sub-unit, for sentencing when the first judgment sub-unit judges that target font name is English character string It whether there is space character in disconnected English character string;
Subelement is deleted, it, will be English for judging in English character string there are when space character when the second judgment sub-unit Space character present in character string is deleted, and target string is obtained.
Optionally, in embodiments of the present invention, subelement is deleted to be specifically used for:
Upper case character in English character string is revised as lowercase character, and by space character present in English character string It deletes, obtains target string.
Optionally, in embodiments of the present invention, which can also include:
Third judgment sub-unit, for when it is English character string that the first judgment sub-unit, which judges target font name not, Judge whether target font name is Chinese;
Conversion subunit, for when third judgment sub-unit judges the entitled Chinese of target font, by Chinese name Title is converted to phonetic, obtains target string.
Optionally, in embodiments of the present invention, which may include:
Computation subunit for utilizing editing distance algorithm, and successively calculates target string according to default computation sequence With the editing distance of each preset characters string;
Trigger subelement, for group operator unit be calculated the editor of target string and a preset characters string away from It will be zero editing distance as smallest edit distance when from being zero, and it is corresponding by smallest edit distance to trigger display unit 204 Preset characters strings corresponding to font show text.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of electronic equipment, referring to Fig. 3, including place Manage device 301, communication interface 302, memory 303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 complete mutual communication by communication bus 304;
Memory 303, for storing computer program;
Processor 301 when for executing the program stored on memory, realizes that any of the above-described character displaying method is real The method and step of example offer is provided.
In the embodiment of the present invention, due to being that record has: the mapping relations of text and font name in document in document, Thus when electronic equipment needs to show the text in document to be shown, electronic equipment can determine the document to be shown In text correspond to the font name of font, and using the corresponding font name of the text as target font name.Then, may be used also To obtain character string corresponding to the target font name, and can be using the character string as target string.Later, Ke Yili With editing distance algorithm, it is corresponding to calculate the font name of each font stored in the target string and the electronic equipment The editing distance of preset characters string.It is then possible to determine the smallest edit distance in the editing distance being calculated, and utilizing should The corresponding preset characters string of smallest edit distance corresponding font shows the text.
In this way, be shown the text when showing document using any electronic equipment, in the document can, avoid Occur the case where text position shows box.And inventors have found that font name is more close in existing fontlib Then the form of font is also just closer, thus in embodiments of the present invention, it can find and the text in the document to be shown Originally the font that the form of font to display is closer to, and can use the font found to show the text, Improve the document reading experience of user.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of readable storage medium storing program for executing, readable storage mediums Matter is the readable storage medium storing program for executing in electronic equipment, is stored with computer program in readable storage medium storing program for executing, computer program is processed Device realizes the method and step that any of the above-described character displaying method embodiment provides when executing.
In the embodiment of the present invention, due to being that record has: the mapping relations of text and font name in document in document, Thus when electronic equipment needs to show the text in document to be shown, electronic equipment can determine the document to be shown In text correspond to the font name of font, and using the corresponding font name of the text as target font name.Then, may be used also To obtain character string corresponding to the target font name, and can be using the character string as target string.Later, Ke Yili With editing distance algorithm, it is corresponding to calculate the font name of each font stored in the target string and the electronic equipment The editing distance of preset characters string.It is then possible to determine the smallest edit distance in the editing distance being calculated, and utilizing should The corresponding preset characters string of smallest edit distance corresponding font shows the text.
In this way, be shown the text when showing document using any electronic equipment, in the document can, avoid Occur the case where text position shows box.And inventors have found that font name is more close in existing fontlib Then the form of font is also just closer, thus in embodiments of the present invention, it can find and the text in the document to be shown Originally the font that the form of font to display is closer to, and can use the font found to show the text, Improve the document reading experience of user.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment and readable storage medium storing program for executing embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simple Single, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (12)

1. a kind of character displaying method, which is characterized in that be applied to electronic equipment, which comprises
The font name for determining font corresponding to the text in document to be shown, as target font name;
Character string corresponding to the target font name is obtained, as target string;
The editing distance of the target string Yu each preset characters string is calculated using editing distance algorithm;Wherein, one Preset characters string are as follows: character string corresponding to a kind of pre-stored font name of font in the electronic equipment;
The text is shown using font corresponding to the corresponding preset characters string of smallest edit distance.
2. the method according to claim 1, wherein described obtain character corresponding to the target font name String, the step of as target string, comprising:
Judge whether the target font name is English character string;
If so, judging in the English character string with the presence or absence of space character;
Space character present in the English character string is deleted, obtains target string by space character if it exists.
3. according to the method described in claim 2, it is characterized in that, described by space character present in the English character string The step of deleting, obtaining target string, comprising:
Upper case character in the English character string is revised as lowercase character, and by space present in the English character string Character deletion obtains target string.
4. according to the method described in claim 2, it is characterized in that, the target font name is not English character if judging String, the method also includes:
Judge whether the target font name is Chinese;
If Chinese, the Chinese is converted into phonetic, obtains target string.
5. method according to any of claims 1-4, which is characterized in that described to calculate institute using editing distance algorithm The step of stating editing distance of the target string with each preset characters string, comprising:
The target string and each preset characters are successively calculated using editing distance algorithm, and according to default computation sequence The editing distance of string;
It, will be for zero editing distance when the editing distance that the target string and a preset characters string is calculated is zero As smallest edit distance, and trigger it is described by font corresponding to the corresponding preset characters string of smallest edit distance to show The step of stating text.
6. a kind of character display apparatus, which is characterized in that be applied to electronic equipment, described device includes:
Determination unit, for determining the font name of font corresponding to the text in document to be shown, as target font name;
Obtaining unit, for obtaining character string corresponding to the target font name, as target string;
Computing unit, for calculated using editing distance algorithm the editor of the target string and each preset characters string away from From;Wherein, a preset characters string are as follows: word corresponding to a kind of pre-stored font name of font in the electronic equipment Symbol string;
Display unit, for showing the text using font corresponding to the corresponding preset characters string of smallest edit distance.
7. device according to claim 6, which is characterized in that the obtaining unit includes:
First judgment sub-unit, for judging whether the target font name is English character string;
Second judgment sub-unit, for judging that the target font name is English character string when first judgment sub-unit When, judge in the English character string with the presence or absence of space character;
Subelement is deleted, for judge in the English character string there are when space character when second judgment sub-unit, general Space character present in the English character string is deleted, and target string is obtained.
8. device according to claim 7, which is characterized in that the deletion subelement is specifically used for:
Upper case character in the English character string is revised as lowercase character, and by space present in the English character string Character deletion obtains target string.
9. device according to claim 7, which is characterized in that described device further include:
Third judgment sub-unit, for judging that the target font name is not English character string when first judgment sub-unit When, judge whether the target font name is Chinese;
Conversion subunit, for when the third judgment sub-unit judges the entitled Chinese of the target font, by institute It states Chinese and is converted to phonetic, obtain target string.
10. the device according to any one of claim 6-9, which is characterized in that the computing unit includes:
Computation subunit for utilizing editing distance algorithm, and successively calculates the target string according to default computation sequence With the editing distance of each preset characters string;
Subelement is triggered, for the volume of the target string and a preset characters string to be calculated when the sub- operator unit To be zero editing distance as smallest edit distance when volume distance is zero, and trigger the display unit by it is minimum edit away from The text is shown from font corresponding to corresponding preset characters string.
11. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes method step as claimed in any one of claims 1 to 5 Suddenly.
12. a kind of readable storage medium storing program for executing, which is characterized in that the readable storage medium storing program for executing is the readable storage medium in electronic equipment Matter is stored with computer program in the readable storage medium storing program for executing, realizes that right is wanted when the computer program is executed by processor Seek any method and step in 1-5.
CN201711478866.3A 2017-12-29 2017-12-29 A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing Pending CN109992749A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711478866.3A CN109992749A (en) 2017-12-29 2017-12-29 A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711478866.3A CN109992749A (en) 2017-12-29 2017-12-29 A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN109992749A true CN109992749A (en) 2019-07-09

Family

ID=67109681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711478866.3A Pending CN109992749A (en) 2017-12-29 2017-12-29 A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN109992749A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579937A (en) * 2019-09-30 2021-03-30 北京国双科技有限公司 Character highlight display method and device
WO2023024376A1 (en) * 2021-08-26 2023-03-02 北京金山办公软件股份有限公司 Text typesetting

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025733A (en) * 2006-02-20 2007-08-29 佳能株式会社 Information processing apparatus and control method thereof
CN102541963A (en) * 2010-12-31 2012-07-04 北大方正集团有限公司 Method and device for inquiring character identification
CN102567431A (en) * 2010-12-31 2012-07-11 北大方正集团有限公司 Document processing method and device
CN102681978A (en) * 2012-05-15 2012-09-19 深圳市万兴软件有限公司 Method and system for displaying text in PDF (portable document format) document
CN103207755A (en) * 2012-01-13 2013-07-17 宇龙计算机通信科技(深圳)有限公司 Terminal and character font changing method
CN105224666A (en) * 2015-10-08 2016-01-06 广东欧珀移动通信有限公司 A kind of input method, device and terminal
CN106156103A (en) * 2015-04-02 2016-11-23 广州爱九游信息技术有限公司 A kind of search processing method and device
CN106297799A (en) * 2016-08-09 2017-01-04 乐视控股(北京)有限公司 Voice recognition processing method and device
CN106326484A (en) * 2016-08-31 2017-01-11 北京奇艺世纪科技有限公司 Error correction method and device for search terms
CN107220639A (en) * 2017-04-14 2017-09-29 北京捷通华声科技股份有限公司 The correcting method and device of OCR recognition results

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101025733A (en) * 2006-02-20 2007-08-29 佳能株式会社 Information processing apparatus and control method thereof
CN102541963A (en) * 2010-12-31 2012-07-04 北大方正集团有限公司 Method and device for inquiring character identification
CN102567431A (en) * 2010-12-31 2012-07-11 北大方正集团有限公司 Document processing method and device
CN103207755A (en) * 2012-01-13 2013-07-17 宇龙计算机通信科技(深圳)有限公司 Terminal and character font changing method
CN102681978A (en) * 2012-05-15 2012-09-19 深圳市万兴软件有限公司 Method and system for displaying text in PDF (portable document format) document
CN106156103A (en) * 2015-04-02 2016-11-23 广州爱九游信息技术有限公司 A kind of search processing method and device
CN105224666A (en) * 2015-10-08 2016-01-06 广东欧珀移动通信有限公司 A kind of input method, device and terminal
CN106297799A (en) * 2016-08-09 2017-01-04 乐视控股(北京)有限公司 Voice recognition processing method and device
CN106326484A (en) * 2016-08-31 2017-01-11 北京奇艺世纪科技有限公司 Error correction method and device for search terms
CN107220639A (en) * 2017-04-14 2017-09-29 北京捷通华声科技股份有限公司 The correcting method and device of OCR recognition results

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579937A (en) * 2019-09-30 2021-03-30 北京国双科技有限公司 Character highlight display method and device
WO2023024376A1 (en) * 2021-08-26 2023-03-02 北京金山办公软件股份有限公司 Text typesetting

Similar Documents

Publication Publication Date Title
KR101435265B1 (en) Method for disambiguating multiple readings in language conversion
CN105739981B (en) Code completion implementation method and device and computing equipment
JP5802292B2 (en) Shared language model
US20090109227A1 (en) System and method for independent font substitution of string characters
US8838657B1 (en) Document fingerprints using block encoding of text
CN110705302B (en) Named entity identification method, electronic equipment and computer storage medium
JP2010520531A (en) Integrated pinyin and image input
WO2019028990A1 (en) Code element naming method, device, electronic equipment and medium
CN104123091A (en) Character input apparatus and method, and program
CN110895961A (en) Text matching method and device in medical data
CN112784009A (en) Subject term mining method and device, electronic equipment and storage medium
JP2010520532A (en) Input stroke count
CN109992749A (en) A kind of character displaying method, device, electronic equipment and readable storage medium storing program for executing
CN110909247B (en) Text information pushing method, electronic equipment and computer storage medium
CN111046627B (en) Chinese character display method and system
CN109977423B (en) Method and device for processing word, electronic equipment and readable storage medium
CN110929749B (en) Text recognition method, text recognition device, text recognition medium and electronic equipment
US9305117B2 (en) String generation tool
CN111859089B (en) Wrong word detection control method for Internet information
JP3635230B2 (en) Speech synthesis apparatus and method, information processing apparatus, and program recording medium
CN105653912B (en) A kind of method and device for identifying batch registration behavior
JP5563706B1 (en) Document file generation apparatus, document file generation method, and document file generation program
CN112784593B (en) Document processing method and device, electronic equipment and readable storage medium
WO2017009900A1 (en) Document processing system and document processing method
CN109902277A (en) A kind of document edit method, device, electronic equipment and readable storage medium storing program for executing

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