CN108536398A - A method of realizing Chinese and English different fonts printing - Google Patents

A method of realizing Chinese and English different fonts printing Download PDF

Info

Publication number
CN108536398A
CN108536398A CN201810049521.4A CN201810049521A CN108536398A CN 108536398 A CN108536398 A CN 108536398A CN 201810049521 A CN201810049521 A CN 201810049521A CN 108536398 A CN108536398 A CN 108536398A
Authority
CN
China
Prior art keywords
font
english
chinese
fonts
setting
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
CN201810049521.4A
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.)
Vanstone Electronic Beijing Co Ltd
Original Assignee
Vanstone Electronic Beijing 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 Vanstone Electronic Beijing Co Ltd filed Critical Vanstone Electronic Beijing Co Ltd
Priority to CN201810049521.4A priority Critical patent/CN108536398A/en
Publication of CN108536398A publication Critical patent/CN108536398A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1206Improving or facilitating administration, e.g. print management resulting in increased flexibility in input data format or job format or job type
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a kind of methods for realizing Chinese and English different fonts printing, are related to printing technique field.This method, by adding respectively, interface is arranged in Chinese font and interface is arranged in english font, and judge Chinese and English classification by the data to input, call corresponding font setting interface, carry out corresponding font setting respectively to Chinese text or English text, to which the different classes of text of Chinese and English is arranged to different font styles so that the Chinese text that prints and English text data therefore greatly improve the usage experience of user in turn all in the state of clear beauty.

Description

A method of realizing Chinese and English different fonts printing
Technical field
The present invention relates to printing technique field more particularly to a kind of methods for realizing Chinese and English different fonts printing.
Background technology
Currently, the text data inputted on mobile consumption terminal can only be arranged to a kind of font, then connect with consumption terminal When the printer print data connect, if including only a kind of literal type in text, the data strip after printing also compares It is more beautiful and clear, and if existed simultaneously comprising two kinds of literal types, such as Chinese and English in text, then use above-mentioned side Method, by Chinese and English be all provided be set to same font when, if the font style be suitble to Chinese text, in printing Text is very beautiful to be apparent from, and English text will seem unsightly unintelligible, and if the font style of setting is suitble to English text, then the English text printed is very beautiful to be apparent from, and Chinese text will seem unsightly unintelligible.
So the data to be printed inputted on mobile consumption terminal are arranged to the method for same font style, it can not Ensure that the Chinese and English text printed is all clear beautiful, to reduce the usage experience of user.
Invention content
The purpose of the present invention is to provide a kind of methods for realizing Chinese and English different fonts printing, to solve the prior art Present in foregoing problems.
To achieve the goals above, the technical solution adopted by the present invention is as follows:
A method of it realizing Chinese and English different fonts printing, includes the following steps:
S1 changes configuration file in the framework layers of Mobile payment terminal;
Interface is arranged in S2, addition Chinese font setting interface and english font;
S3 obtains the setting demand of text data and Chinese and English font;
The text data got is split into single word, and carries out Chinese and English judgement to each word by S4, if it is in Text then calls the Chinese font setting interface to carry out the setting of Chinese font according to the setting demand of Chinese font;If It is English, then the english font setting interface is called to carry out the setting of english font according to the setting demand of english font;
S5 calls printing interface and printing to drive, printer according to the setting of the Chinese and English font of S4 as a result, to text into Row printing.
Preferably, in S1, the configuration file includes:Frameworks/base/data/fonts/fonts.mk files With frameworks/base/data/fonts/fonts.xml files, frameworks/base/data/fonts/ Fonts.mk files are for adding the font style of needs, frameworks/base/data/fonts/fonts.xml File, the name for setting font understand the font name that be arranged according to this file when application layer needs to set font pattern Come the pattern that sets font.
Preferably, in S2, the Chinese font setting interface and english font setting interface are:setFont(String familyName,int style)。
Preferably, S4 is completed in such as lower interface:addText(Bundle format,List<Intchar> stsList)。
The beneficial effects of the invention are as follows:The method provided in an embodiment of the present invention for realizing Chinese and English different fonts printing, leads to Addition Chinese font setting interface respectively and english font setting interface are crossed, and judges Chinese and English class by the data to input , do not call corresponding font setting interface, corresponding font setting carried out respectively to Chinese text or English text, to will in The different classes of text of English is arranged to different font styles so that the Chinese text and English text data printed is all State in clear beauty, therefore the usage experience of user is greatly improved in turn.
Description of the drawings
Fig. 1 is the method flow schematic diagram provided in an embodiment of the present invention for realizing Chinese and English different fonts printing.
Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with attached drawing, to the present invention into Row is further described.It should be appreciated that the specific embodiments described herein are only used to explain the present invention, it is not used to Limit the present invention.
In consumption terminal equipment input data print procedure, in order to make the font of the data printed meet the need of user Ask, and keep font more beautiful clear and arrangement it is reasonable, it is sometimes desirable to Chinese and English data are arranged to different fonts.
As shown in Figure 1, an embodiment of the present invention provides a kind of method for realizing Chinese and English different fonts printing, including it is as follows Step:
S1 changes configuration file in the framework layers of Mobile payment terminal;
Interface is arranged in S2, addition Chinese font setting interface and english font;
S3 obtains the setting demand of text data and Chinese and English font;
The text data got is split into single word, and carries out Chinese and English judgement to each word by S4, if it is in Text then calls the Chinese font setting interface to carry out the setting of Chinese font according to the setting demand of Chinese font;If It is English, then the english font setting interface is called to carry out the setting of english font according to the setting demand of english font;
S5 calls printing interface and printing to drive, printer according to the setting of the Chinese and English font of S4 as a result, to text into Row printing.
The method provided in an embodiment of the present invention for realizing Chinese and English different fonts printing, can transport in consumption terminal equipment Row, the consumption terminal equipment include mainly display screen, touch screen, Wireless LAN module, can with read non-to connect smart card communications Card reading module, the print module of strip, and the power module for powering for equipment can be printed.
Android system may be used in consumption terminal equipment, and Android system can support the setting of different fonts, can The text of Chinese and English classification to be arranged to different font styles.The font being arranged can print on bitmap, on bitmap Data printed by the printer of connection.
In the above method provided in an embodiment of the present invention, interface and English are set by adding Chinese font respectively at the ends sdk Interface is arranged in word body, and judges Chinese and English classification by the data to input, corresponding font setting interface is called, to Chinese Text or English text carry out corresponding font setting respectively, to which the different classes of text of Chinese and English is arranged to different words Body pattern so that the Chinese text that prints and English text data all in clear beauty state, therefore greatly into And improve the usage experience of user.
Wherein, in S1, the configuration file includes:Frameworks/base/data/fonts/fonts.mk files and Frameworks/base/data/fonts/fonts.xml files, frameworks/base/data/fonts/fonts.mk File is for adding the font style of needs, frameworks/base/data/fonts/fonts.xml files, uses In the name to set font, when application layer needs to set font pattern, can the font name that be arranged according to this file be arranged Font style.
Different fonts is come with inside Android system can support to be configured Chinese and English according to demand.In addition Can also be as needed, it downloads the font of needs from the Internet, then the font of these needs is downloaded in system.Make The font downloaded to can support the setting of font, can modify to some configuration files at framework layers, work as modification After the completion, so that it may for different font demands, the setting of font is carried out in the corresponding interface of sdk.
In practical operation, by frameworks/base/data/fonts/fonts.mk files and frameworks/ It, can be related character library copy to the frameworks/ of download after the completion of base/data/fonts/fonts.xml file modifications Under this file of data/fonts, the storage to character library is completed.
Wherein, in S2, the Chinese font setting interface and english font setting interface are:setFont(String familyName,int style)。
In the above method, at the ends sdk, interface is arranged in addition font:setFont(String familyName,int Style), by calling this interface that can complete the setting to corresponding font,
In the embodiment of the present invention, S4 is completed in such as lower interface:addText(Bundle format,List<Intchar> stsList)。
In the above method, addText (Bundle format, List at the ends sdk<Intchar>StsList) in interface Data are divided into single word by the data sent according to application layer, and to the classification of each word cycle criterion Chinese and English, and according to Judging result, call font setting interface setFont (String familyName, int style), centering English text into The font of row correspondence is arranged.
The use principle of the above method is:
Printer printing is that apk calls the corresponding interfaces of sdk, and then sdk is called by jni to bottom printer driver It is printed, method provided by the invention, is exactly used to solve the problems, such as follows:When print data, Chinese and English can beaten Print when be arranged to different fonts, and printed according to the font of setting.By the different classes of text difference of Chinese and English It is arranged to different fonts, flow is:The font of the text and Chinese and English that obtain string types from apk first, which is arranged, to be needed It asks, while being added at the ends sdk for Chinese and English different fonts interface to be arranged;If it is intended to Chinese and English is arranged to different fonts Format, then with regard to needing that the text of string types is carried out to split into single word, and the judgement of Chinese and English is carried out to each word, After judging to complete, it is configured demand is arranged according to the font of different classes of text, for example, if text is Chinese, Demand is then arranged according to the font of Chinese text, calls Chinese font that interface is set, Chinese font pattern is set as desired, together Demand then is arranged according to the font of English text if it is English text in reason, calls english font that interface is arranged, as desired English font pattern is set.
So in the embodiment of the present invention, by judging the Chinese and English classification of text data, using being deposited in consumption terminal equipment Chinese and English text is arranged respectively to different font styles, and then print different words by the different character libraries of storage in printing The Chinese and English text of body pattern.
Specific embodiment:
The example made a reservation with dining room illustrates to realize the method for Chinese and English different fonts printing, can in accordance with the following steps into Row is implemented:
Step 1, consumer order, and waiter orders food input in equipment, and input setting for Chinese and English font style Set requirement;
Step 2, will the order requirement of data and the setting of Chinese and English font of system are transmitted to the ends sdk;
Step 3, after the ends sdk receive data, the data that will order split into single word, and carry out Chinese and English class to each word Other judgement then calls Chinese font setting interface to carry out Chinese font setting, for example Chinese is arranged if it is Chinese data English font setting interface is then called to carry out english font setting, for example English is set if it is English data for Song typeface pattern It is set to regular script pattern;
Step 4, the ends sdk call printing interface and the printing of bottom are called to drive
Step 5, printing driving are called printer to come out the data-printing for setting font style, are then printed in strip, Chinese display is the Song typeface, and English display is regular script.
As it can be seen that using method provided in an embodiment of the present invention, can to print the Chinese and English clear data in strip and It is beautiful.
By using above-mentioned technical proposal disclosed by the invention, following beneficial effect has been obtained:The embodiment of the present invention carries The method of the Chinese and English different fonts printing of realization of confession, by adding respectively, interface is arranged in Chinese font and english font setting connects Mouthful, and judge Chinese and English classification by the data to input, corresponding font setting interface is called, to Chinese text or English text This carries out corresponding font setting respectively, to which the different classes of text of Chinese and English is arranged to different font styles so that The Chinese text that prints and English text data therefore greatly and then improve user all in the state of clear beauty Usage experience.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered Depending on protection scope of the present invention.

Claims (4)

1. a kind of method for realizing Chinese and English different fonts printing, which is characterized in that include the following steps:
S1 changes configuration file in the framework layers of Mobile payment terminal;
Interface is arranged in S2, addition Chinese font setting interface and english font;
S3 obtains the setting demand of text data and Chinese and English font;
The text data got is split into single word, and carries out Chinese and English judgement to each word by S4, if it is Chinese, then The Chinese font setting interface is called to carry out the setting of Chinese font according to the setting demand of Chinese font;If it is English Text then calls the english font setting interface to carry out the setting of english font according to the setting demand of english font;
S5 calls printing interface and printing to drive, and printer is according to the setting of the Chinese and English font of S4 as a result, beating text Print.
2. the method according to claim 1 for realizing Chinese and English different fonts printing, which is characterized in that described to match in S1 Setting file includes:Frameworks/base/data/fonts/fonts.mk files and frameworks/base/data/ Fonts/fonts.xml files, frameworks/base/data/fonts/fonts.mk files are used for the font sample needs Formula adds, frameworks/base/data/fonts/fonts.xml files, and the name for setting font works as application Layer need to set font pattern when, can the font name that be arranged according to this file come the pattern that sets font.
3. the method according to claim 1 for realizing Chinese and English different fonts printing, which is characterized in that in S2, in described Interface is arranged in word body and english font setting interface is:setFont(String familyName,int style).
4. the method according to claim 1 for realizing Chinese and English different fonts printing, which is characterized in that S4 is in such as lower interface Middle completion:addText(Bundle format,List<Intchar>stsList).
CN201810049521.4A 2018-01-18 2018-01-18 A method of realizing Chinese and English different fonts printing Pending CN108536398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810049521.4A CN108536398A (en) 2018-01-18 2018-01-18 A method of realizing Chinese and English different fonts printing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810049521.4A CN108536398A (en) 2018-01-18 2018-01-18 A method of realizing Chinese and English different fonts printing

Publications (1)

Publication Number Publication Date
CN108536398A true CN108536398A (en) 2018-09-14

Family

ID=63485423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810049521.4A Pending CN108536398A (en) 2018-01-18 2018-01-18 A method of realizing Chinese and English different fonts printing

Country Status (1)

Country Link
CN (1) CN108536398A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609817A (en) * 2021-08-12 2021-11-05 深圳市方直科技股份有限公司 Method and device for setting discontinuous Chinese and English font styles

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345933A (en) * 2007-07-09 2009-01-14 上海基信通讯技术有限公司 Dynamic alternation and loading/unloading method for mobile phone display font style and font size
CN102567295A (en) * 2010-12-21 2012-07-11 北大方正集团有限公司 Font processing method and device for embedded device
CN103365894A (en) * 2012-03-29 2013-10-23 天津书生软件技术有限公司 Font format conversion method and device
CN104021026A (en) * 2014-06-17 2014-09-03 无锡久源软件科技有限公司 Language adding method based on Android system
CN106033412A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Text conversion method and device
CN107423004A (en) * 2017-06-20 2017-12-01 上海慧银信息科技有限公司 The method and POS terminal of POS terminal printed tickets

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345933A (en) * 2007-07-09 2009-01-14 上海基信通讯技术有限公司 Dynamic alternation and loading/unloading method for mobile phone display font style and font size
CN102567295A (en) * 2010-12-21 2012-07-11 北大方正集团有限公司 Font processing method and device for embedded device
CN103365894A (en) * 2012-03-29 2013-10-23 天津书生软件技术有限公司 Font format conversion method and device
CN104021026A (en) * 2014-06-17 2014-09-03 无锡久源软件科技有限公司 Language adding method based on Android system
CN106033412A (en) * 2015-03-20 2016-10-19 广州金山移动科技有限公司 Text conversion method and device
CN107423004A (en) * 2017-06-20 2017-12-01 上海慧银信息科技有限公司 The method and POS terminal of POS terminal printed tickets

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609817A (en) * 2021-08-12 2021-11-05 深圳市方直科技股份有限公司 Method and device for setting discontinuous Chinese and English font styles
CN113609817B (en) * 2021-08-12 2023-10-27 深圳市方直科技股份有限公司 Discontinuous Chinese and English font style setting method and device

Similar Documents

Publication Publication Date Title
CN104583931B (en) A kind of printing server and Printing Qptions display methods
CN105278894B (en) Print control, print system and printing control method
CN108037920A (en) Client customizing form generation method, storage medium
CN101582860B (en) Method for replacing user interface skins of different communication equipment
CN101094118B (en) Test system for peripheral equipment of terminal
CN104899184B (en) Literal processing method, apparatus and system
CN102270224A (en) Information system data output device and method
WO2017054629A1 (en) Method and device for editing printed receipt based on pos terminal
CN105607880A (en) Printing method and device for examined and approved documents
JP2003523022A (en) Imaging document with static content and variable data
CN110244921A (en) Label printing method, device, electronic equipment and system
CN111062195A (en) File processing method, file processing device, equipment and storage medium
CN107632799A (en) A kind of print processing method and system
JPH11134148A (en) Computer system
CN108536398A (en) A method of realizing Chinese and English different fonts printing
CN106569984A (en) Method, apparatus, and system for generating and transmitting color word stock automatically
CN109190078A (en) Webpage construction method, device and storage medium
CN101145094A (en) Host apparatus to set N-up function and control method thereof
JP2012113710A (en) Apparatus and method for changing electronic book contents
JP6024168B2 (en) Data processing apparatus, recording apparatus, and control method for data processing apparatus
CN102880595A (en) System and method for providing online reading
CN107391054A (en) Tape deck and control method
CN112395529A (en) Page loading method, device, equipment and storage medium
CN116088776A (en) Data printing method and system supporting multi-service scene multiplexing
JP6833419B2 (en) Information processing equipment, methods and programs

Legal Events

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

Application publication date: 20180914