CN102063413A - Fast text composition method of mobile terminal - Google Patents

Fast text composition method of mobile terminal Download PDF

Info

Publication number
CN102063413A
CN102063413A CN2010105909135A CN201010590913A CN102063413A CN 102063413 A CN102063413 A CN 102063413A CN 2010105909135 A CN2010105909135 A CN 2010105909135A CN 201010590913 A CN201010590913 A CN 201010590913A CN 102063413 A CN102063413 A CN 102063413A
Authority
CN
China
Prior art keywords
character
width
display
value
string
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
CN2010105909135A
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.)
ZHANGFU TECHNOLOGY (NANJING) Co Ltd
Original Assignee
ZHANGFU TECHNOLOGY (NANJING) 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 ZHANGFU TECHNOLOGY (NANJING) Co Ltd filed Critical ZHANGFU TECHNOLOGY (NANJING) Co Ltd
Priority to CN2010105909135A priority Critical patent/CN102063413A/en
Publication of CN102063413A publication Critical patent/CN102063413A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)

Abstract

The invention relates to a fast text composition method of a mobile terminal, belonging to the technical field of communication. The fast text composition method comprises the following steps of: selecting a font, a character height value, the height value and the width value of a display area; calculating the width of a single character and the width of an ASCII (American Standard Code for Information Interchange) code symbol; judging the attribute of a first character of a character string, and then determining the display width of the first character; adding the judged first character to the tail part of a current display character string, and deleting the first character contained in a character string to be composed; summarizing the display widths of characteristics of the current display character string to obtain a current display line width; comparing whether the current display line width is larger than the width value of the display area or not, determining whether adding a new display line or not, and judging whether the product of a display line number and the character height value is larger than the height value of the display area or not to determine whether the composition of the character string to be composed on the display area needs to be completed or not. The invention can outstandingly increase the text composition speed and enable the battery with same electric quantity to work for a longer time.

Description

A kind of high-speed text composition method of portable terminal
Technical field
The present invention relates to a kind of composition method, especially a kind of high-speed text composition method of portable terminal belongs to communication technique field.
Background technology
In recent years, various portable terminals are popularized rapidly, and the screen size of portable terminal is increasing, and cost is more and more lower." reading " also carried out on portable terminal more and more as very general activity in people's routine work, life, the learning process.Reading activities on the portable terminal has many advantages---and be subjected to the influence in time place very little, can carry out at any time; Not needing the user to carry heavy books just can read ten thousand volumes; Also can allow the user utilize the advanced function of electronic document, retrieve operations such as annotations and comments.Generally speaking, the text browsing demand on the mobile device is As time goes on increasing.
Yet, because that mobile device generally adopts at present is the CPU of ARM framework, the design concept of this CPU is low-power consumption, good energy saving property, so adopted reduced instruction set computer (RISC) technology, and the ARM framework CPU that the present handheld device of the overwhelming majority is adopted does not have hardware floating-point operation ability, depend merely on the floating-point operation that carry out in operating system and architecture storehouse, carry out one of percentage of the too late ordinary desktop computer of efficient.Because the most frequent font of using when the handheld device screen is set type is surveyed wide operation based on vector operation and floating-point operation, so there is the problem on the low side of raising the efficiency of carrying out in the similar programs of moving on present most mobile device such as electronic reading aspect text composition.Big section literal set type, especially gesticulate more various Chinese font and set type the tangible performance bottleneck of prior art scheme ubiquity than English character shape is more complicated.
Retrieval is found, application number is the recognition methods that the Chinese patent of CN200810009074.6 discloses the quick editing/typesetting method of a kind of handwriting information and editor's symbol, this method can make the editor who imports in the editing process accord with identification accurately, efficient, the identification error rate is low, but and is not suitable for the problem that solves above-mentioned portable terminal.
Summary of the invention
The objective of the invention is to: propose a kind of high-speed text composition method that can significantly improve the portable terminal of carrying out efficient and display speed, thereby satisfy portable terminal client's reading requirement better.
In order to reach above purpose, the high-speed text composition method of portable terminal of the present invention may further comprise the steps:
Step 1, selected display text font and the corresponding high value of word, and the height value of viewing area and width value;
Step 2, draw the individual character width of the corresponding selected font of Chinese character " " and the sign indicating number symbol width of each ASCII character by the width function;
Step 3, judge first character attibute of the character string of waiting to set type, if Chinese character, then with the individual character width as its display width; If ASCII character, then the sign indicating number with corresponding A SCII sign indicating number accords with width as its display width;
Step 4, the character after will judging are appended to the afterbody of current display string, and deletion wait to set type this character in the character string;
Step 5, the display width of each character in the current display string is added up, obtain current demonstration line width;
Whether step 6, more current demonstration line width greater than the viewing area width value, as otherwise return step 3, then carry out next step in this way;
Step 7, append new display line, and judge and show whether the amassing of line number and the high value of word,, then return step 3, then carry out next step in this way as denying greater than the height value of viewing area;
Step 8, finish and wait to set type the composing of character string in the viewing area.
Rule of judgment in the above-mentioned steps three is generally: if the character value of string encoding between+U 4E00 and+U 9FBF between then be Chinese character, less than+0080 of U is an ASCII character.
The characteristics that reasonable consideration of the present invention equates to the Chinese character width, be used for all Chinese character width detection with the Chinese character width that once records, therefore saved the number of times of system application interface interchange, thereby make and saved the system function more than 90% at the high process of typeset of Chinese ratio and call, significantly reduced call function required context switching time.And owing to do not need to carry out floating-point operation, the also quickening of on portable terminal such as embedded, hand-held, handling greatly of speed.
In a word, the present invention can make text composition speed be significantly improved, and effect is more obvious on the mobile device of the many literal of giant-screen; Simultaneously, inquiry has reached identical effect with number of comparisons because used still less, and CPU operation times and internal storage access number of times have obtained saving, thereby allows the battery of same charge do the longer time by I.
Description of drawings
The present invention is further illustrated below in conjunction with accompanying drawing.
Fig. 1 is the structural representation of one embodiment of the invention.
Embodiment
Embodiment one
The high-speed text composition method of the present embodiment portable terminal following literal of need setting type: " Harmony be The Ministry of Railway of the People's Republic of China, MOR to China Railway High-speed (CRH) motor train unit, and the general designation of AC transmission electric power locomotive, diesel locomotive series partly.Ministry of Railways's spokesman's Zhang Shuguang claims, this name is to have represented the principle of " harmonies of man and nature " in the Scientific Outlook on Development, motor train unit is except than the train and push-pull train energy-saving and environmental protection of tradition by locomotive traction, also need a plurality of not commensurates to cooperate and develop jointly, represent technical coordination." composition step following (referring to Fig. 1):
1, acquiescence selects (or interim artificial selection) to determine that the display text font is a black matrix, and the high value of corresponding word is the high system fonts of 16 pixels, and the width value of viewing area and height value are the rectangular area of 120 * 240 pixels;
2, javax.microedition.lcdui.Font.stringWidth () function in the J2ME platform of use application programming interface API draws the individual character width of the corresponding selected font of Chinese character " " and the sign indicating number symbol width of each ASCII character, and this duration is 16;
3, according to the character value of string encoding between+U 4E00 and+U 9FBF between, still less than+U 0080, judge that first character attibute of the character string of waiting to set type is a Chinese character, or ASCII character, if Chinese character, then with the individual character width as its display width; If ASCII character, then with the sign indicating number symbol width of corresponding A SCII sign indicating number as its display width (can measure the width of 128 ASCII character, preservation respectively) with above-mentioned width function; Since first character that will set type for " with ", so its width value is 16;
4, the character after will judging is appended to the afterbody of current display string, " appends " for the first time because current display string does not have information, therefore directly makes number one this character in the character string of waiting to set type of deletion afterwards;
5, the display width with each character in the current display string adds up, and obtains current demonstration line width;
6, whether more current demonstration line width greater than the viewing area width value, as otherwise return step 3, then carry out next step in this way; Present embodiment will " with " set type after, will repeatedly return step 3, respectively with " humorous ", " number ", "Yes", " in ", after " China ", " people " word do identical processing, current demonstration line width reaches 7 * 16=112; Because when row " people ", current demonstration line width will be 112+16=128>viewing area width value 120, therefore need enter next step;
7, append new display line, and judge to show whether the amassing of line number and the high value of word,, then return step 3, then carry out next step in this way as denying greater than the height value of viewing area;
8, finish the character string of waiting to set type in the composing of viewing area, enter next space of a whole page.
Facts have proved, adopt the method for present embodiment after, than the prior art speed-raising more than 20 times, power consumption (consumption of CPU computational resource) situation also is significantly improved to the composing speed of Chinese text.This shows that beneficial effect is fairly obvious.
In addition to the implementation, the present invention can also have other embodiments.All employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop on the protection domain of requirement of the present invention.

Claims (3)

1. the high-speed text composition method of a portable terminal is characterized in that may further comprise the steps:
Step 1, selected display text font and the corresponding high value of word, and the height value of viewing area and width value;
Step 2, draw the individual character width of the corresponding selected font of Chinese character " " and the sign indicating number symbol width of each ASCII character by the width function;
Step 3, judge first character attibute of the character string of waiting to set type, if Chinese character, then with the individual character width as its display width; If ASCI worker's sign indicating number, then the sign indicating number with corresponding A SCII sign indicating number accords with width as its display width;
Step 4, the character after will judging are appended to the afterbody of current display string, and deletion wait to set type this character in the character string;
Step 5, the display width of each character in the current display string is added up, obtain current demonstration line width;
Whether step 6, more current demonstration line width greater than the viewing area width value, as otherwise return step 3, then carry out next step in this way;
Step 7, append new display line, and judge and show whether the amassing of line number and the high value of word,, then return step 3, then carry out next step in this way as denying greater than the height value of viewing area;
Step 8, finish and wait to set type the composing of character string in the viewing area.
2. the high-speed text composition method of portable terminal according to claim 1, it is characterized in that the Rule of judgment in the described step 3 is: if the character value of string encoding between+U4E00 and+U 9FBF between then be Chinese character, less than+0080 of U is ASCI worker's sign indicating number.
3. the high-speed text composition method of portable terminal according to claim 1 is characterized in that: javax.microedition.lcdui.Font.stringWidth () function in the J2ME platform that described width function is application programming interface API.
CN2010105909135A 2010-12-15 2010-12-15 Fast text composition method of mobile terminal Pending CN102063413A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105909135A CN102063413A (en) 2010-12-15 2010-12-15 Fast text composition method of mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105909135A CN102063413A (en) 2010-12-15 2010-12-15 Fast text composition method of mobile terminal

Publications (1)

Publication Number Publication Date
CN102063413A true CN102063413A (en) 2011-05-18

Family

ID=43998694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105909135A Pending CN102063413A (en) 2010-12-15 2010-12-15 Fast text composition method of mobile terminal

Country Status (1)

Country Link
CN (1) CN102063413A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102364961A (en) * 2011-11-18 2012-02-29 百视通网络电视技术发展有限责任公司 Character interception method and system based on electronic program guide page in Internet protocol television (IPTV)
CN102902678A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Text content typesetting method and terminal
CN103593332A (en) * 2012-08-15 2014-02-19 文鼎科技开发股份有限公司 Method for processing character string in embedded device
CN104063362A (en) * 2013-07-18 2014-09-24 腾讯科技(深圳)有限公司 Character string truncation method and device
CN104994312A (en) * 2015-07-15 2015-10-21 北京金山安全软件有限公司 Video generation method and device
CN106095374A (en) * 2016-06-23 2016-11-09 Tcl集团股份有限公司 The method and system that a kind of word size adaptation various countries language shows
CN103761220B (en) * 2014-01-20 2017-09-05 深圳市英威诺科技有限公司 A kind of text composition technical method of information software

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902678A (en) * 2011-07-26 2013-01-30 腾讯科技(深圳)有限公司 Text content typesetting method and terminal
CN102902678B (en) * 2011-07-26 2015-09-16 腾讯科技(深圳)有限公司 Content of text composition method and terminal
CN102364961A (en) * 2011-11-18 2012-02-29 百视通网络电视技术发展有限责任公司 Character interception method and system based on electronic program guide page in Internet protocol television (IPTV)
CN102364961B (en) * 2011-11-18 2014-04-23 百视通网络电视技术发展有限责任公司 Character interception method and system based on electronic program guide page in Internet protocol television (IPTV)
CN103593332A (en) * 2012-08-15 2014-02-19 文鼎科技开发股份有限公司 Method for processing character string in embedded device
CN104063362A (en) * 2013-07-18 2014-09-24 腾讯科技(深圳)有限公司 Character string truncation method and device
CN104063362B (en) * 2013-07-18 2016-03-16 腾讯科技(深圳)有限公司 A kind of truncation of a string method and device
CN103761220B (en) * 2014-01-20 2017-09-05 深圳市英威诺科技有限公司 A kind of text composition technical method of information software
CN104994312A (en) * 2015-07-15 2015-10-21 北京金山安全软件有限公司 Video generation method and device
CN106095374A (en) * 2016-06-23 2016-11-09 Tcl集团股份有限公司 The method and system that a kind of word size adaptation various countries language shows

Similar Documents

Publication Publication Date Title
CN102063413A (en) Fast text composition method of mobile terminal
CN101308610B (en) Calligraphy exercising method and apparatus based on mobile terminal
JP6303594B2 (en) Table sorting and filtering by image data and symbol data in a single cell
CN112597312A (en) Text classification method and device, electronic equipment and readable storage medium
CN102033928B (en) Handwritten original handwriting recording and querying system and electronic device
CN108509569A (en) Generation method, device, electronic equipment and the storage medium of enterprise's portrait
CN113705554A (en) Training method, device and equipment of image recognition model and storage medium
CN103200293A (en) Method of automatically combining tautonomy contacts in process of guiding contacts into contact list
CN103970736A (en) Method for converting Excel sheet to database table
CN105718218A (en) Compressed storage method and system applicable for load records of electric energy meter or concentrator
CN103500332B (en) Character displaying method and device in picture
JP2014160252A (en) Electronic equipment, character string display method and character string display program
CN100552670C (en) A kind of method of automatic discriminating digit document type page
CN101441549A (en) Character recognition method, system and electric terminal
CN103136453B (en) The automatic volume group method of document function topic and automatic marking method
CN103455479A (en) Method and terminal for creating contacts
CN101295316B (en) Bitmap indexing method and unit, and smart card
CN103810204A (en) Information search method and information search device
CN113360685A (en) Method, device, equipment and medium for processing note content
CN106406560A (en) Method and system for outputting vector fonts of mechanical engineering characters in desktop operation system
CN105912723A (en) Storage method of custom field
CN113505273A (en) Data sorting method, device, equipment and medium based on repeated data screening
CN101893960A (en) Direction vector-based character recognition method and device
CN102981607A (en) Computer-implemented method of arranging text items in a predefined order
CN103455495A (en) Enterprise business identifier data encoding method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110518