CN113609817B - Discontinuous Chinese and English font style setting method and device - Google Patents
Discontinuous Chinese and English font style setting method and device Download PDFInfo
- Publication number
- CN113609817B CN113609817B CN202110927579.6A CN202110927579A CN113609817B CN 113609817 B CN113609817 B CN 113609817B CN 202110927579 A CN202110927579 A CN 202110927579A CN 113609817 B CN113609817 B CN 113609817B
- Authority
- CN
- China
- Prior art keywords
- document
- chinese
- english
- font style
- user
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 13
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
- G06F40/129—Handling non-Latin characters, e.g. kana-to-kanji conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/166—Editing, e.g. inserting or deleting
Abstract
The invention provides a setting method and a setting device of discontinuous Chinese and English font style, comprising the steps of determining characters of a user in a document in a specified editing range through default specified range or user selection; reading Unicode coding values of words of a specified editing range through default specified ranges or selected by a user in a document; judging the size of the Unicode coding value of each word in the document, if the size is more than 256, marking the word as Chinese, and if the size is less than or equal to 256, marking the word as English; and rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through a SetFormat function. The invention reads the Unicode coding value of each word in the user selection range, recognizes Chinese and English according to the Unicode coding value and respectively marks and distinguishes the Chinese and the English, can simultaneously select the marked Chinese or the marked English, respectively sets the corresponding font style, and greatly improves the setting efficiency of the font style of document editing and planar design word typesetting.
Description
Technical Field
The invention relates to the field of document editing and planar design resource manufacturing, in particular to a method and a device for setting discontinuous Chinese and English font styles.
Background
In the document editing and planar design text typesetting process, if the mixed arrangement of Chinese and English exists, different fonts are required to be used for realizing discontinuous Chinese and English, chinese or English are required to be selected respectively, and are set independently, so that different fonts can be set respectively; if the font settings are selected together, they can only be set to the same font. The prior art can not quickly distinguish discontinuous Chinese and English, and greatly influences the operation efficiency.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: a method and a device for setting discontinuous Chinese and English font styles are provided, so that the setting efficiency of the discontinuous Chinese and English formats is improved.
In order to solve the technical problems, the invention adopts the following technical scheme: a method for setting discontinuous Chinese and English font style comprises the steps,
s10, determining characters of a specified editing range in a document through default specified ranges or user selection;
s20, reading Unicode coding values of characters of a specified editing range selected by a user through a default specified range or the user in the document;
s30, judging the size of the Unicode coding value of each word in the document, if the size is more than 256, marking the word as Chinese, and if the size is less than or equal to 256, marking the word as English;
s40, rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through a SetFormat function.
Further, the step S40 specifically includes,
s41, selecting all characters marked as Chinese in a document, and setting the selected Chinese characters as a preset Chinese font style through a SetFormat function;
s42, all English characters marked in the document are selected, and the selected English characters are set to be in a preconfigured English font style through a SetFormat function.
Further, in step S40, the chinese font style includes a chinese font style preset in the document or a chinese font style customized by the user, and the english font style includes an english font style preset in the document or an english font style customized by the user.
Further, in step S20, specifically,
and traversing the characters in the document one by one through a traversing function by a user in a default specified range or a user selected specified editing range, and reading the Unicode coding value of each character in the document.
Further, in step S10, the document includes a document in a Word format and a document in a PDF format.
The invention also provides a device for setting discontinuous Chinese and English font style, which comprises,
the text range determining module is used for determining the text of a specified editing range selected by a user through a default specified range or the user in the document;
the code value reading module is used for reading Unicode code values of characters of a specified editing range selected by a user through a default specified range or the user in the document;
the code value judging module is used for judging the size of the Unicode code value of each word in the document, if the size is larger than 256, the word is marked as Chinese, and if the size is smaller than or equal to 256, the word is marked as English;
and the font setting module is used for rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through the SetFormat function.
Further, the font setting module specifically comprises,
the Chinese font style setting unit is used for completely selecting the characters marked as Chinese in the document and setting the selected Chinese characters into a preset Chinese font style through a SetFormat function;
and the English font style setting unit is used for selecting all English-marked characters in the document, and setting the selected English-marked characters into a preconfigured English font style through a SetFormat function.
Further, in the font setting module, the Chinese font style comprises a Chinese font style preset in the document or a Chinese font style customized by the user, and the English font style comprises an English font style preset in the document or an English font style customized by the user.
Further, the code value reading module is specifically used for,
and traversing the characters in the document one by one through a traversing function by a user in a default specified range or a user selected specified editing range, and reading the Unicode coding value of each character in the document.
Further, in the text range determining module, the document includes a document in a Word format and a document in a PDF format.
The invention has the beneficial effects that: by reading the Unicode coding value of each word in the user selection range, chinese and English are identified according to the Unicode coding value and are respectively marked and distinguished, the marked Chinese or English can be selected at the same time, and corresponding font styles are respectively set, so that the setting efficiency of the font styles of document editing and planar design word typesetting is greatly improved, and the difficulty of distinguishing and setting different fonts of Chinese and English is solved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained from the mechanisms shown in these drawings without the need for inventive labour for a person skilled in the art.
FIG. 1 is a flow chart of a method for setting discontinuous Chinese and English font styles according to an embodiment of the present invention;
fig. 2 is a block diagram of a discontinuous chinese-english font style setting device according to an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that the description of "first," "second," etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
Referring to fig. 1, a first embodiment of the present invention is as follows: the setting method of discontinuous Chinese and English font style includes the steps,
s10, determining characters of a specified editing range in a document through default specified ranges or user selection;
in step S10, the document includes a document in a Word format and a document in a PDF format.
S20, reading Unicode coding values of characters of a specified editing range selected by a user through a default specified range or the user in the document;
the step S20 specifically refers to performing a character-by-character traversal on characters in the document in a default specified range or in an editing range selected by the user through a traversal function, and reading Unicode code values of each character in the document.
S30, judging the size of the Unicode coding value of each word in the document, if the size is more than 256, marking the word as Chinese, and if the size is less than or equal to 256, marking the word as English;
s40, rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through a SetFormat function.
Wherein, the step S40 specifically comprises the following steps,
s41, selecting all characters marked as Chinese in a document, and setting the selected Chinese characters as a preset Chinese font style through a SetFormat function;
s42, all English characters marked in the document are selected, and the selected English characters are set to be in a preconfigured English font style through a SetFormat function.
In step S40, the chinese font style includes a chinese font style preset in the document or a user-defined chinese font style, and the english font style includes an english font style preset in the document or a user-defined english font style.
In this embodiment, by reading the Unicode code value of each text in the user selection range, identifying the chinese and english according to the Unicode code value and respectively performing mark distinction, the marked chinese or english can be selected simultaneously, and the corresponding font style is respectively set, thereby greatly improving the setting efficiency of the font style of document editing and planar design text typesetting, and solving the difficulty of distinguishing and setting different fonts of chinese and english.
As shown in fig. 2, another embodiment of the present invention is: a discontinuous Chinese and English font style setting device comprises,
a text range determining module 10, configured to determine text in a document in which a user designates a range by default or selects a designated editing range;
in the text range determining module 10, the document includes a document in a Word format and a document in a PDF format.
The code value reading module 20 is configured to read Unicode code values of words in a document, where the words are specified by default or by user selection of a specified editing range;
the code value reading module 20 is specifically configured to traverse characters in the document one by one through a traversing function for characters in a default specified range or a specified editing range selected by a user, and read Unicode code values of each character in the document.
The code value judging module 30 is configured to judge the size of the Unicode code value of each word in the document, if the size is greater than 256, the word is marked as chinese, and if the size is less than or equal to 256, the word is marked as english;
and the font setting module 40 is used for quickly setting font styles of the discontinuous Chinese and English marked in the document in batches through the SetFormat function.
Wherein the font setting module 40 specifically includes,
the Chinese font style setting unit is used for completely selecting the characters marked as Chinese in the document and setting the selected Chinese characters into a preset Chinese font style through a SetFormat function;
and the English font style setting unit is used for selecting all English-marked characters in the document, and setting the selected English-marked characters into a preconfigured English font style through a SetFormat function.
In the font setting module 40, the chinese font style includes a chinese font style preset in the document or a chinese font style customized by the user, and the english font style includes an english font style preset in the document or an english font style customized by the user.
It should be noted that, as a person skilled in the art can clearly understand, the specific implementation process of the setting device of the discontinuous chinese-english font style may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, the description is omitted here.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present invention.
Claims (2)
1. A discontinuous Chinese and English font style setting method is characterized in that: comprising the steps of (a) a step of,
s10, determining characters of a specified editing range in a document through default specified ranges or user selection;
s20, reading Unicode coding values of characters of a specified editing range selected by a user through a default specified range or the user in the document;
s30, judging the size of the Unicode coding value of each word in the document, if the size is more than 256, marking the word as Chinese, and if the size is less than or equal to 256, marking the word as English;
s40, rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through a SetFormat function;
in step S10, the document comprises a document in a Word format and a document in a PDF format;
in particular, in step S20,
traversing characters of a user in a document one by one through a traversing function according to a default specified range or a specified editing range selected by the user, and reading Unicode coding values of each character in the document;
the step S40 specifically includes the steps of,
s41, selecting all characters marked as Chinese in a document, and setting the selected Chinese characters as a preset Chinese font style through a SetFormat function;
s42, selecting all English characters marked in the document, and setting the selected English characters into a preconfigured English font style through a SetFormat function;
in step S40, the chinese font style includes a chinese font style preset in the document or a user-defined chinese font style, and the english font style includes an english font style preset in the document or a user-defined english font style.
2. A setting device of discontinuous Chinese and English font style is characterized in that: comprising the steps of (a) a step of,
the text range determining module is used for determining the text of a specified editing range selected by a user through a default specified range or the user in the document;
the code value reading module is used for reading Unicode code values of characters of a specified editing range selected by a user through a default specified range or the user in the document;
the code value judging module is used for judging the size of the Unicode code value of each word in the document, if the size is larger than 256, the word is marked as Chinese, and if the size is smaller than or equal to 256, the word is marked as English;
the font setting module is used for rapidly setting font styles of discontinuous Chinese and English marked in the document in batches through a SetFormat function;
in the text range determining module, the document comprises a document in a Word format and a document in a PDF format;
the code value reading module is particularly used for,
traversing characters of a user in a document one by one through a traversing function according to a default specified range or a specified editing range selected by the user, and reading Unicode coding values of each character in the document;
the font setting module specifically comprises a font setting module,
the Chinese font style setting unit is used for completely selecting the characters marked as Chinese in the document and setting the selected Chinese characters into a preset Chinese font style through a SetFormat function;
an English font style setting unit, configured to select all English characters marked as English in the document, and set the selected English characters as preconfigured English font styles through a SetFormat function;
in the font setting module, the Chinese font style comprises a Chinese font style preset in the document or a user-defined Chinese font style, and the English font style comprises an English font style preset in the document or a user-defined English font style.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110927579.6A CN113609817B (en) | 2021-08-12 | 2021-08-12 | Discontinuous Chinese and English font style setting method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110927579.6A CN113609817B (en) | 2021-08-12 | 2021-08-12 | Discontinuous Chinese and English font style setting method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113609817A CN113609817A (en) | 2021-11-05 |
CN113609817B true CN113609817B (en) | 2023-10-27 |
Family
ID=78308383
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110927579.6A Active CN113609817B (en) | 2021-08-12 | 2021-08-12 | Discontinuous Chinese and English font style setting method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113609817B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002052435A2 (en) * | 2000-12-27 | 2002-07-04 | Intel Corporation | Large character set browser |
CA2421478A1 (en) * | 2002-11-01 | 2004-05-01 | Microsoft Corporation | Method for selecting a font |
CN106446280A (en) * | 2016-11-01 | 2017-02-22 | 青岛海信移动通信技术股份有限公司 | Song data processing method and device |
CN107563367A (en) * | 2017-09-08 | 2018-01-09 | 桂林加宏汽车修理有限公司 | A kind of character recognition method and system |
CN108536398A (en) * | 2018-01-18 | 2018-09-14 | 艾体威尔电子技术(北京)有限公司 | A method of realizing Chinese and English different fonts printing |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI262403B (en) * | 2004-10-01 | 2006-09-21 | Mediatek Inc | Multi-language system and method for quickly selecting a font file corresponding to a character from a font database |
US20150074522A1 (en) * | 2013-09-12 | 2015-03-12 | Monotype Imaging Inc. | Font Management for Editing Electronic Documents |
-
2021
- 2021-08-12 CN CN202110927579.6A patent/CN113609817B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002052435A2 (en) * | 2000-12-27 | 2002-07-04 | Intel Corporation | Large character set browser |
CA2421478A1 (en) * | 2002-11-01 | 2004-05-01 | Microsoft Corporation | Method for selecting a font |
CN106446280A (en) * | 2016-11-01 | 2017-02-22 | 青岛海信移动通信技术股份有限公司 | Song data processing method and device |
CN107563367A (en) * | 2017-09-08 | 2018-01-09 | 桂林加宏汽车修理有限公司 | A kind of character recognition method and system |
CN108536398A (en) * | 2018-01-18 | 2018-09-14 | 艾体威尔电子技术(北京)有限公司 | A method of realizing Chinese and English different fonts printing |
Also Published As
Publication number | Publication date |
---|---|
CN113609817A (en) | 2021-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7228501B2 (en) | Method for selecting a font | |
US7293229B2 (en) | Ensuring proper rendering order of bidirectionally rendered text | |
US7705848B2 (en) | Method of identifying semantic units in an electronic document | |
EP1730653B1 (en) | Systems and methods for identifying complex text in a presentation data stream | |
US8271873B2 (en) | Automatically detecting layout of bidirectional (BIDI) text | |
US8456688B2 (en) | Data generating device, scanner and non-transitory computer readable medium | |
KR930009761B1 (en) | Wordprocessor | |
US8078965B2 (en) | Automatic switching fonts on multilingual text runs | |
CN109117463B (en) | Text pinyin marking method, electronic equipment, storage medium | |
CN113609817B (en) | Discontinuous Chinese and English font style setting method and device | |
CN104516859B (en) | A kind of word modification method and system | |
CN106776527B (en) | Electronic book data display method and device and terminal equipment | |
CN109582934B (en) | Format document conversion method and device | |
CN112686000B (en) | Format conversion method of electronic book document, electronic equipment and storage medium | |
CN111104805A (en) | Translation processing method and device, computer storage medium and terminal | |
WO2008119253A1 (en) | Method and system for discriminating cheat by unicode | |
CN112699634B (en) | Typesetting processing method of electronic book, electronic equipment and storage medium | |
CN113283233A (en) | Text error correction method and device, electronic equipment and storage medium | |
CN117391045B (en) | Method for outputting file with portable file format capable of copying Mongolian | |
US20210303842A1 (en) | Information processing device and non-transitory computer readable medium | |
CN112001150A (en) | Document format conversion method and device, computer storage medium and terminal | |
JP3466761B2 (en) | Document processing apparatus and control method thereof | |
CN113688150A (en) | Keyword searching method and device, electronic equipment and storage medium | |
CN103942182A (en) | English text format optimization method and device | |
Sandmann | gCMAPWeb: a web interface for gene-set enrichment analysis |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |