CN103678261A - Method, device and equipment for rapidly displaying TTFs - Google Patents
Method, device and equipment for rapidly displaying TTFs Download PDFInfo
- Publication number
- CN103678261A CN103678261A CN201310730328.4A CN201310730328A CN103678261A CN 103678261 A CN103678261 A CN 103678261A CN 201310730328 A CN201310730328 A CN 201310730328A CN 103678261 A CN103678261 A CN 103678261A
- Authority
- CN
- China
- Prior art keywords
- font
- character
- ttf
- demonstration
- relevant information
- 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
Links
Images
Landscapes
- Controls And Circuits For Display Device (AREA)
Abstract
The invention provides a method for rapidly displaying TTFs. The method includes the following steps that bitmap relevant information of the TTFs, needing to be displayed, of all characters is obtained in advance and stored to form a new font file; when software is operated, the new front file is called to draw and display the characters. The invention further provides a device and equipment corresponding to the method. The problems that the TTFs are drawn and displayed slowly, when the specific font size fronts are displayed, the characters are prone to being displayed with flaws, and correction is very difficult are solved.
Description
Technical field
The present invention relates to computer realm, be specifically related to a kind of method, device and equipment of quick demonstration TTF font.
Background technology
In built-in human-machine interaction field, the size that character shows will be mated with software interface, and because current industry provides Bitmap font limited, size between No. 8 and No. 16, if exceed this font size scope, is difficult to find appropriate font substantially.In this case, meet market demands, generally can select True Type font (TTF font), True Type font, due to the scalable demonstration of font, is therefore widely used in each field of computing machine.
True Type font also has its shortcoming, the first: draw and to show certain complicacy, CPU be there are certain requirements, especially in built-in field, when CPU frequency is lower, draw more consuming time, allow user feel that interface is refreshed and show slowly.It two is: because True Type font is scalable font, be not the design of specific font size size, therefore, when showing specific font size font, some character has demonstration flaw unavoidably, and is difficult to revise.
Summary of the invention
In order to address the above problem, the invention provides a kind of method, device and equipment of quick demonstration TTF font, obtain in advance the bitmap relevant information of the TTF font of all characters that need demonstration, and preserve a new font file of formation, during running software, call new font and draw demonstration.Solved TTF font and drawn demonstration slowly, and when showing specific font size font, character easily there is demonstration flaw, and the very difficult problem of revising.
A kind of method that the invention provides quick demonstration TTF font, comprises the steps:
Obtain in advance the bitmap relevant information of the TTF font of all characters that need demonstration, and preserve formation new font file;
During running software, call new font file and draw demonstration character.
Further, describedly need to show that the bitmap relevant information of the TTF font of character comprises: the bitmap pixels of character, height, wide, x, y Coordinate Adjusting value information.
Further, the described bitmap relevant information of obtaining in advance the TTF font of all characters that need demonstration is, according to the coding of all characters and specific font size, call one by one FreeType built-in function in advance TTF font is resolved, obtain the bitmap relevant information of described all characters.
Further, described in convert a new font file to and save as, the bitmap relevant information of described all characters is saved in structure array one by one to generate new font file.
Further, the described bitmap relevant information by described all characters is saved in one by one in structure array and comprised step before generating new font file: in advance according to the bitmap relevant information of the TTF font of the character of need demonstration, definition structure body array.
Further, described in call new font file and draw and show that character is, from structure corresponding to the new font file preserved, obtain the bitmap relevant information of character, according to the information of obtaining, draw and show output.
Further, by adjusting the bitmap pixels of described character with the display effect of adjustment character.
The present invention also provides a kind of device of quick demonstration TTF font, it is characterized in that, comprising: acquiring unit, storage unit, control module;
Described acquiring unit is for obtaining the relevant information of the TTF font that needs demonstration character;
Described storage unit is used for storing new font file;
Described control module is drawn demonstration character for calling new font file.
The present invention also provides a kind of equipment, and described equipment has device as above.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
1, due to by obtaining in advance the bitmap relevant information of the TTF font of all characters that need to show, and preserve and form a new font file, during running software, call new font and draw demonstration.Solved TTF font and drawn demonstration slowly, and when showing specific font size font, character easily there is demonstration flaw, and the very difficult problem of revising.
2,, because we can adjust the member variable bitmap pixels in structure array, therefore can make easily its display effect more attractive in appearance.
Accompanying drawing explanation
Fig. 1 is a schematic diagram of a kind of quick demonstration TTF font in the embodiment of the present invention;
Fig. 2 is another schematic diagram of a kind of quick demonstration TTF font in the embodiment of the present invention;
Fig. 3 is a schematic diagram of the device of a kind of quick demonstration TTF font in the embodiment of the present invention.
Embodiment
Below in conjunction with the Figure of description in the present invention, the technical scheme in invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of method of quick demonstration TTF font, by obtaining in advance the bitmap relevant information of the TTF font of all characters that need demonstration, and preserve a new font file of formation, during running software, call new font and draw demonstration.Solved TTF font and drawn demonstration slowly, and when showing specific font size font, character easily there is demonstration flaw, and the very difficult problem of revising.The present invention has also introduced the Apparatus and system of realizing the method, below will be elaborated respectively to it.
Referring to accompanying drawing 1, the process flow diagram of a kind of embodiment of the quick demonstration TTF font method providing for the embodiment of the present invention, mainly comprises step S101, S102:
S101, obtains the bitmap relevant information of the TTF font of all characters that need demonstration in advance, and preserves formation new font file.
By system shape library, obtained in advance the bitmap relevant information of the TTF font that need to draw all characters that show on screen, and all character informations are preserved to form new font file.Wherein, the bitmap relevant information of the TTF font of described character comprises: the bitmap pixels of character, height, wide, x, y Coordinate Adjusting value information.
S102, during running software, calls new font file and draws demonstration character.
During running software, do not use TTF font to draw demonstration, but call the new font file generating in advance, draw demonstration.
In sum, obtain in advance the bitmap relevant information of the TTF font of all characters that need demonstration, and preserve formation new font file; During running software, do not re-use TTF font and draw demonstration, but the relevant information of calling the storage of new font file refreshes video memory, and then show on screen.This programme is reaching under the prerequisite of the same display effect of TTF font, has greatly accelerated character and has drawn display speed.
Technical scheme for a better understanding of the present invention, now introduces another specific embodiment of the present invention above-described embodiment is further described in detail.
Refer to Fig. 2, another embodiment of the display packing in the embodiment of the present invention comprises the steps:
S201, calls one by one FreeType built-in function according to the coding of all characters and specific font size in advance TTF font is resolved, and obtains the bitmap relevant information of described all characters.
Local graphics system is in advance according to the coding of character to be shown and specific font size, calling FreeType built-in function resolves TTF font, obtain the bitmap relevant information of the TTF font of this character, described bitmap relevant information comprises bitmap pixels, and height, wide and x, the y Coordinate Adjusting value of this character under the specific font size obtaining by calculating.
S202, is saved in structure array the bitmap relevant information of described all characters one by one to generate new font file.
The bitmap relevant information of described all characters being saved in one by one in structure array with before generating new font file step, also comprise the bitmap relevant information of the TTF font of the character that local graphics system shows according to need in advance, definition structure body array.
After determining that the bitmap relevant information of the TTF font of all characters is all saved in structure array, all structures of structure array are all saved under a self-defining new font file and generate a new font file.
The bitmap relevant information of described character can be searched corresponding structure according to character code and be preserved when being saved in structure array, when calling new font file, also can search according to character code.
The structure of storing No. 20 big or small character bitmap relevant informations of take is example, and described structure is as follows:
It should be noted that, described structure, a kind of storage mode that just the present invention uses, also can be with the bitmap relevant information of other organizational form store characters.
It should be noted that, the size of described structure array in can showing according to equipment, need or likely need to use character number decide.
It should be added that, preservation for the same character of different font sizes, can comprise various ways, illustrate two kinds of methods, a kind of mode is to preserve by character boundary, sets up a plurality of files, each file is preserved all characters of same font size, between each file, by file name, distinguish, such as font_20x20.h is for depositing big or small all characters No. 20, font_24x24.h is for depositing big or small all characters No. 24; Another kind of mode, for the relevant information of different font sizes is all kept under same file by character code, is searched according to character code and font size during use.
S203 during running software, obtains the bitmap relevant information of character from structure corresponding to the new font file preserved, according to the information of obtaining, draws and shows output.
When local graphics system, need to draw while showing this character, no longer resolve TTF font, but directly obtain in the enantiomorph from new font file the bitmap pixels, width of this character, highly, Coordinate Adjusting value information, realize drawing and show this character.
The described bitmap relevant information of obtaining character from structure corresponding to the new font file of having preserved can be searched the structure that a certain character is corresponding by character code.
It should be noted that, if we find that the display effect of character is not good, we can adjust the member variable bitmap pixels in structure array, just can make easily its display effect more attractive in appearance.
Below to show letter ' a ', the TTF font of utf8 character set encoding, No. 20, character boundary, the new font file font_20x20.h by name of self-defined preservation character information is that example describes as above process in detail:
The bitmap pixels of the utf8 character set encoding 0x61 of local graphics system will show big or small character No. 20 ' a ', letter ' a ', the decimal system is 97, calls FreeType built-in function, obtains letter ' a ' height, width, Coordinate Adjusting value and character ' a '.This programme is with being about to No. 20 large minuscules ' height, width, Coordinate Adjusting value, the bitmap pixels information of a ', be filled into vbf_font_t[97] in structure array.When all characters are all inserted after vbf_font_t structure array, by vbf_font_t structure storage of array in font_20x20.h header file.
Local graphics system, in order to use font_20x20.h font header file, before resolving Bit map font file, first loads font header file, i.e. #include " font_20x20.h ".Take and show large minuscule No. 20 ' a ' is example, when local graphics system, need to draw and show letter ' during a ', no longer resolve TTF font, but bitmap pixels by ' coding of a ' character 97 be directly vbf_font_t[97 from the 97th structure of vbf_font_t of font_20x20.h header file] obtained character ' a ', width, highly, Coordinate Adjusting value information, realize drawing show character ' a '.If we find big or small character No. 20 ' the TTF display effect of a ' is not good, uses after this programme, we can be easily to vbf_font_t[97] bitmap pixels in member variable pixel array adjusts, and makes its display effect more attractive in appearance.
Refer to Fig. 3, the embodiment for the device of the quick demonstration TTF font in the embodiment of the present invention, comprising: acquiring unit 1, storage unit 2, control module 3
Described acquiring unit 1 is for obtaining the bitmap relevant information of the TTF font that needs demonstration character.
Described storage unit 2 is for storing new font file.
Described control module 3 is drawn demonstration character for calling new font file.
The detailed content of described each unit, referring to the description of a upper embodiment, does not repeat them here.
Another embodiment of the present invention has the equipment that can show fast the device of TTF font, and described equipment comprises the device as described in above-described embodiment, and described device, as described in above-mentioned specific embodiment, does not repeat them here.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part partly illustrates referring to method.
Above method, device and the equipment of a kind of quick demonstration TTF font provided by the present invention are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the present invention, all will change in specific embodiments and applications, therefore, this description should not be construed as limitation of the present invention.
Claims (9)
1. show fast a method for TTF font, it is characterized in that, comprise the steps:
Obtain in advance the bitmap relevant information of the TTF font of all characters that need demonstration, and preserve formation new font file;
During running software, call new font file and draw demonstration character.
2. the method for quick demonstration TTF font according to claim 1, is characterized in that, describedly need to show that the bitmap relevant information of the TTF font of character comprises: the bitmap pixels of character, height, wide, x, y Coordinate Adjusting value information.
3. the method for quick demonstration TTF font according to claim 1 and 2, it is characterized in that, the described bitmap relevant information of obtaining in advance the TTF font of all characters that need demonstration is, according to the coding of all characters and specific font size, call one by one FreeType built-in function in advance TTF font is resolved, obtain the bitmap relevant information of described all characters.
4. the method for quick demonstration TTF font according to claim 1 and 2, it is characterized in that, describedly convert a new font file to and save as, the bitmap relevant information of described all characters is saved in structure array one by one to generate new font file.
5. the method for quick demonstration TTF font according to claim 4, it is characterized in that, the described bitmap relevant information by described all characters is saved in one by one in structure array and comprised step before generating new font file: in advance according to the bitmap relevant information of the TTF font of the character of need demonstration, definition structure body array.
6. the method for quick demonstration TTF font according to claim 1 and 2, it is characterized in that, describedly call new font file and draw and show that character is, from structure corresponding to the new font file preserved, obtain the bitmap relevant information of character, according to the information of obtaining, draw and show output.
7. the method for quick demonstration TTF font according to claim 1 and 2, is characterized in that, by adjusting the bitmap pixels of described character with the display effect of adjustment character.
8. show fast a device for TTF font, it is characterized in that, comprising: acquiring unit, storage unit, control module;
Described acquiring unit is for obtaining the relevant information of the TTF font that needs demonstration character;
Described storage unit is used for storing new font file;
Described control module is drawn demonstration character for calling new font file.
9. an equipment, is characterized in that, described equipment has device as claimed in claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310730328.4A CN103678261A (en) | 2013-12-26 | 2013-12-26 | Method, device and equipment for rapidly displaying TTFs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310730328.4A CN103678261A (en) | 2013-12-26 | 2013-12-26 | Method, device and equipment for rapidly displaying TTFs |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103678261A true CN103678261A (en) | 2014-03-26 |
Family
ID=50315874
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310730328.4A Pending CN103678261A (en) | 2013-12-26 | 2013-12-26 | Method, device and equipment for rapidly displaying TTFs |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103678261A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104199628A (en) * | 2014-08-07 | 2014-12-10 | 北京配天技术有限公司 | Character display method and system based on QT Embedded system |
CN104850484A (en) * | 2015-05-22 | 2015-08-19 | 成都千牛信息技术有限公司 | Bitmap analysis based automatic determination method for character terminal interactive state |
CN105513108A (en) * | 2015-12-11 | 2016-04-20 | 中国航空工业集团公司西安航空计算技术研究所 | Word stock drawing method based on texture mapping |
CN107578458A (en) * | 2017-09-14 | 2018-01-12 | 北京邮电大学 | A kind of method for drafting and device of aircraft running situation figure |
CN108091338A (en) * | 2017-12-29 | 2018-05-29 | 江苏惠通集团有限责任公司 | The data processing method and device of voice telecontrol system and its host side |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060083250A (en) * | 2005-01-14 | 2006-07-20 | (주)네오프리라인 | Method of embodying true type font and apparatus thereof, short message service method using true type font |
CN101625848A (en) * | 2009-07-28 | 2010-01-13 | 宁波新然电子信息科技发展有限公司 | Realization method of vector font library oriented to embedded platform |
CN101833542A (en) * | 2010-04-21 | 2010-09-15 | 中兴通讯股份有限公司 | Method and device for rendering fonts of user interface |
CN102279841A (en) * | 2011-08-31 | 2011-12-14 | 深圳市茁壮网络股份有限公司 | Method for realizing multi-font display, user side and server |
CN103294472A (en) * | 2013-05-30 | 2013-09-11 | 中标软件有限公司 | Chinese font rendering control method and system based on Linux operating system |
-
2013
- 2013-12-26 CN CN201310730328.4A patent/CN103678261A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060083250A (en) * | 2005-01-14 | 2006-07-20 | (주)네오프리라인 | Method of embodying true type font and apparatus thereof, short message service method using true type font |
CN101625848A (en) * | 2009-07-28 | 2010-01-13 | 宁波新然电子信息科技发展有限公司 | Realization method of vector font library oriented to embedded platform |
CN101833542A (en) * | 2010-04-21 | 2010-09-15 | 中兴通讯股份有限公司 | Method and device for rendering fonts of user interface |
CN102279841A (en) * | 2011-08-31 | 2011-12-14 | 深圳市茁壮网络股份有限公司 | Method for realizing multi-font display, user side and server |
CN103294472A (en) * | 2013-05-30 | 2013-09-11 | 中标软件有限公司 | Chinese font rendering control method and system based on Linux operating system |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104199628A (en) * | 2014-08-07 | 2014-12-10 | 北京配天技术有限公司 | Character display method and system based on QT Embedded system |
WO2016019861A1 (en) * | 2014-08-07 | 2016-02-11 | 北京配天技术有限公司 | Character display method and system based on qt embedded system |
CN104199628B (en) * | 2014-08-07 | 2019-08-27 | 北京配天技术有限公司 | Character display method and system based on QT Embedded system |
CN104850484A (en) * | 2015-05-22 | 2015-08-19 | 成都千牛信息技术有限公司 | Bitmap analysis based automatic determination method for character terminal interactive state |
CN104850484B (en) * | 2015-05-22 | 2017-11-24 | 成都千牛信息技术有限公司 | A kind of character terminal interaction mode automatic judging method based on bitmap analysis |
CN105513108A (en) * | 2015-12-11 | 2016-04-20 | 中国航空工业集团公司西安航空计算技术研究所 | Word stock drawing method based on texture mapping |
CN107578458A (en) * | 2017-09-14 | 2018-01-12 | 北京邮电大学 | A kind of method for drafting and device of aircraft running situation figure |
CN108091338A (en) * | 2017-12-29 | 2018-05-29 | 江苏惠通集团有限责任公司 | The data processing method and device of voice telecontrol system and its host side |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103677516B (en) | The interface creating method of terminal and device | |
CN105975576B (en) | Terminal content adaptive display method and device and terminal | |
US10089957B2 (en) | Page display method and terminal | |
CN103678261A (en) | Method, device and equipment for rapidly displaying TTFs | |
CN105630478B (en) | A kind of method and apparatus for realizing page switching | |
CN102609256A (en) | Motion chart generating method based on webpages | |
CN102122502A (en) | Method and related device for displaying three-dimensional (3D) font | |
CN104915332A (en) | Method and device for generating composing template | |
US10311060B2 (en) | Glyph management in texture atlases | |
CN109117237B (en) | Bullet screen display method and device and electronic equipment | |
CN115439609B (en) | Three-dimensional model rendering method, system, equipment and medium based on map service | |
CN109992188B (en) | Method and device for realizing scrolling display of iOS mobile terminal text | |
US20240143898A1 (en) | Content typesetting method and apparatus, computer device, and storage medium | |
CN108961361B (en) | Method and system for generating special effect text image and computer equipment | |
CN106776994B (en) | Application method and system of engineering symbols in engineering report forms and web pages | |
CN105094615A (en) | Information processing method and electronic equipment | |
US20140085308A1 (en) | User Interface Incorporating Waterfall Chart | |
CN111757020B (en) | Split screen display method and device, multimedia terminal and storage medium | |
CN109800039B (en) | User interface display method and device, electronic equipment and storage medium | |
CN104598438A (en) | Typesetting computing method for completely displaying message information | |
WO2023050744A1 (en) | Map editing method, system, apparatus, computer device, program product, and storage medium | |
CN111222302A (en) | Webpage rendering control method, control device and computer readable medium | |
US20130155098A1 (en) | Adjusting Fonts for Visual Consistency | |
CN104156185A (en) | Three-dimensional font display method and device | |
CN103309878A (en) | Method and device used for layout in webpage displaying |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 518051 Guangdong city of Shenzhen province Nanshan District Yuquanlu Road Yizhe building 4 floor Applicant after: Biologic medical Science and Technology Co., Ltd. is opened in Shenzhen Address before: 518051 Guangdong city of Shenzhen province Nanshan District Yuquanlu Road Yizhe building 4 floor Applicant before: Sonoscape Inc. |
|
COR | Change of bibliographic data |
Free format text: CORRECT: APPLICANT; FROM: SONOSCAPE INC. TO: SHENGZHEN SONOSCAPE MEDICAL CORP. |
|
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140326 |
|
RJ01 | Rejection of invention patent application after publication |