CN102262784A - Method for coding and decoding word library based on image compression - Google Patents

Method for coding and decoding word library based on image compression Download PDF

Info

Publication number
CN102262784A
CN102262784A CN2011102211662A CN201110221166A CN102262784A CN 102262784 A CN102262784 A CN 102262784A CN 2011102211662 A CN2011102211662 A CN 2011102211662A CN 201110221166 A CN201110221166 A CN 201110221166A CN 102262784 A CN102262784 A CN 102262784A
Authority
CN
China
Prior art keywords
character library
data
compression
information
file
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.)
Granted
Application number
CN2011102211662A
Other languages
Chinese (zh)
Other versions
CN102262784B (en
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.)
Hangzhou Silan Microelectronics Co Ltd
Original Assignee
Hangzhou Silan Microelectronics 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 Hangzhou Silan Microelectronics Co Ltd filed Critical Hangzhou Silan Microelectronics Co Ltd
Priority to CN 201110221166 priority Critical patent/CN102262784B/en
Publication of CN102262784A publication Critical patent/CN102262784A/en
Application granted granted Critical
Publication of CN102262784B publication Critical patent/CN102262784B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Document Processing Apparatus (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention provides a method for coding a word library based on image compression. The method comprises the following steps of: reading files of the word library, analyzing file information, acquiring the dot matrix gray data of the word library, and generating bitmap data according to file information; performing image-based compression on the generated bitmap data; after compression, generating compressed files of the word library and memorizing the files of the word library into a memory; generating the index file information of the word library and memorizing the index file information of the word library into the memory; starting an embedded system; and reading the compressed files in the memory into an internal memory of the embedded system. The method for coding the word library based on the image compression provided by the invention is an inverse process of a coding method. By the method, the memory efficiency of the word library is greatly improved, so that the system can integrate more font information of the word library.

Description

Word-base code method and coding/decoding method based on compression of images
Technical field
The present invention relates to the embedded system field, particularly based on the character library encoding and decoding technique of compression of images.
Background technology
Embedded system provides increasing font Presentation Function at present; and the support that provides multinational character library to show; but in this type systematic; run into such situation through regular meeting: the storage space deficiency; can't write down more character library information, bring and big restriction to Embedded System Design.
Summary of the invention
The invention provides a kind of word-base code method, comprising based on compression of images:
Step 101: read font file, Study document information is obtained the word lattice gradation data and is generated data bitmap according to fileinfo;
Here Study document information comprises that font information, character library divide page information, character library index code information etc., wherein character library index code information is the corresponding UNICODE coding of character library or other type of coding, as in the Hanzi font library " eh " and UNICODE be encoded to 0x554A, GB2312 is encoded to 0xB0A1.
Here the data bitmap of Sheng Chenging is the image file that divides page information to generate according to the font image feature according to the character library in the fileinfo.
Step 102: the data bitmap that step 101 generated is carried out handling based on the compression of image, as compression modes such as ZIP, PNG compression of images, JPG compression of images, the data processing of compression back execution in step 103, step 104;
Step 103: generate the character library compressed file;
Step 104: generate character library index file information, comprise font bitmap coordinated indexing and font code index information;
Step 105: the file storage that step 103, step 104 are generated arrives storer, as FLASH, storage card etc.;
Step 106: start embedded system;
Step 107: read the internal memory of memory compression file to embedded system.
The present invention also provides a kind of character library coding/decoding method based on compression of images, may further comprise the steps:
Step 201: read the internal memory of compressed file to embedded system, compressed file comprises character library compressed file and character library index file for the packed data that word-base code generated based on compression of images here;
Step 202: the internal storage data that step 201 reads is done to decode based on the character library of compression of images;
The character library decoding based on compression of images here generates two data files, comprises character library data bitmap and character library index data, and two data files offer step 203 and step 204 respectively and handle;
Step 203: generate character library data bitmap file;
Step 204: generate character library index data file;
Step 205: analyze data bitmap information;
Step 206: generate font dot matrix gradation data;
Step 207: display font dot matrix gradation data.
After carry out step 205, can also carry out following steps before 206:
Step 208: generate Huffman (Huffman) table, image is carried out the internal storage data compression according to Huffman (Huffman) table that generates;
Here the Huffman of Sheng Chenging (Huffman) table is the concordance list that generates according to Huffman (Huffman) tree, Huffman (Huffman) tree is the shortest tree of a class cum rights path, can effectively carry out simple lossless compress and handle, improve the memory utilization factor data;
Step 209: storage is through the internal memory of step 208 second-compressed data to embedded system;
Step 210: the character library concordance list data file information that finding step 204 generates;
Here the information that needs to search comprises that font information, character library divide page information, character library index code information, Huffman (Huffman) table etc., obtains the character library second-compressed data according to information from the internal storage data that step 209 generates.
Step 211:, data are carried out Huffman (Huffman) decoding according to the second-compressed data that step 210 is obtained;
Return step 206.
Utilize the character library encoding and decoding based on compression of images provided by the invention, according to the character library information extraction character library dot matrix gradation data that writes down in the file that generates in advance, and through compression based on image, generate character library compressed file and character library index file, the storage space that the compressed file that generates takies is far smaller than the shared space of former dot matrix character library, greatly improved the storage efficiency of character library, made the system can integrated more character library font information.
Description of drawings
Fig. 1 among the present invention based on the storehouse coding method of the word-base code word of compression of images.
The character library coding/decoding method of Fig. 2 for decoding based on the character library of compression of images among the present invention.
Embodiment
The embodiment of the invention provides a kind of word-base code method based on compression of images, in an embodiment of the present invention, the dot matrix gradation data of character library is organized in the bitmap mode, and according to bitmap generation character library concordance list, store in the storer according to bitmap that generates and concordance list generation compressed file during word-base code, when system start-up, read packed data to internal memory.
The embodiment of the invention also provides a kind of character library decoding based on compression of images, in an embodiment of the present invention, read compressed file, during decoding the compressed file decoding is restored data bitmap and index data, further analyze data bitmap, generate Huffman (Huffman) table, the recompile data bitmap also stores internal memory into, finds the internal memory word-base data and shows output according to concordance list.
In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is further described below in conjunction with accompanying drawing.
Fig. 1 be in the embodiment of the invention based on the process flow diagram of the word-base code of compression of images, as shown in Figure 1, the word-base code based on compression of images in the embodiments of the invention may further comprise the steps:
Step 101: read font file, Study document information is obtained the word lattice gradation data and is generated data bitmap according to fileinfo;
Here the fileinfo of Fen Xiing comprises that font information, character library divide page information, character library index code information etc., wherein character library index code information is the corresponding UNICODE coding of character library or other type of coding, as in the Hanzi font library " eh " and UNICODE be encoded to 0x554A, GB2312 is encoded to 0xB0A1.
Here the data bitmap of Sheng Chenging is the image file that divides page information to generate according to the font image feature according to the character library in the fileinfo.
Step 102: the data bitmap that step 101 generated is carried out handling based on the compression of image, as compression modes such as ZIP, PNG compression of images, JPG compression of images, the data processing of compression back execution in step 103, step 104;
Step 103: generate the character library compressed file;
Step 104: generate character library index file information, comprise font bitmap coordinated indexing and font code index information;
Step 105: the file storage that step 103, step 104 are generated arrives storer, as FLASH, storage card etc.;
Step 106: start embedded system;
Step 107: read the internal memory of memory compression file to embedded system.
Fig. 2 is the process flow diagram of decoding based on the character library of compression of images in the embodiment of the invention, and as shown in Figure 2, the character library decoding based on compression of images in the embodiments of the invention may further comprise the steps:
Step 201: read the internal memory of compressed file to embedded system, compressed file comprises character library compressed file and character library index file for the packed data that word-base code generated based on compression of images here;
Step 202: the internal storage data that step 201 reads is done to decode based on the character library of compression of images;
The character library decoding based on compression of images here generates two data files, comprises character library data bitmap and character library index data, and two data files offer step 203 and step 204 respectively and handle;
Step 203: generate character library data bitmap file;
Step 204: generate character library index data file;
Step 205: analyze data bitmap information;
Step 206: generate font dot matrix gradation data;
Step 207: display font dot matrix gradation data.
After carry out step 205, can also carry out following steps before 206:
Step 208: generate Huffman (Huffman) table, image is carried out the internal storage data compression according to Huffman (Huffman) table that generates;
Continue described step 206 then.
Here the Huffman of Sheng Chenging (Huffman) table is the concordance list that generates according to Huffman (Huffman) tree, Huffman (Huffman) tree is the shortest tree of a class cum rights path, can effectively carry out simple lossless compress and handle, improve the memory utilization factor data;
Step 209: storage is through the internal memory of step 208 second-compressed data to embedded system;
Step 210: the character library concordance list data file information that finding step 204 generates
Here the information that needs to search comprises that font information, character library divide page information, character library index code information, Huffman (Huffman) table etc., obtains the character library second-compressed data according to information from the internal storage data that step 209 generates.
Step 211:, data are carried out Huffman (Huffman) decoding according to the second-compressed data that step 210 is obtained.

Claims (5)

1. based on the word-base code of compression of images, it is characterized in that may further comprise the steps:
Step 101: read font file, Study document information is obtained character library dot matrix gradation data and is generated data bitmap according to fileinfo;
Step 102: the data bitmap that step 101 generated is carried out handling based on the compression of image the data processing of compression back execution in step 103, step 104;
Step 103: generate the character library compressed file;
Step 104: generate character library index file information, comprise font bitmap coordinated indexing and font code index information;
Step 105: the compressed file that step 103, step 104 are generated stores storer into;
Step 106: start embedded system;
Step 107: read the internal memory of memory compression file to embedded system.
2. a kind of according to claim 1 word-base code based on compression of images is characterized in that described Study document information comprises that font information, character library divide page information, character library index code information.
3. a kind of according to claim 1 word-base code based on compression of images is characterized in that described generation data bitmap is the image file that divides page information to generate according to the font image feature according to the character library in the fileinfo, and based on compression of images character library view data.
4. based on the character library decoding of compression of images, it is characterized in that may further comprise the steps:
Step 201: read the internal memory of compressed file to embedded system, described compressed file comprises character library compressed file and character library index file for the packed data that word-base code generated based on compression of images;
Step 202: the internal storage data that step 201 reads is done to decode based on the character library of compression of images;
Character library decoding based on compression of images generates two data files, comprises character library data bitmap and character library index data, and two data files offer step 203 and step 204 respectively and handle;
Step 203: generate character library data bitmap file;
Step 204: generate character library index data file;
Step 205: analyze data bitmap information;
Step 206: generate font dot matrix gradation data;
Step 207: display font dot matrix gradation data.
5. as a kind of character library decoding as described in the claim 4, it is characterized in that based on compression of images, carry out step 205 after, before 206, can also carry out following steps:
Step 208: generate Huffman (Huffman) table, image is carried out the internal storage data compression according to Huffman (Huffman) table that generates;
Step 209: storage is through the internal memory of step 208 second-compressed data to embedded system;
Step 210: the character library concordance list data file information that finding step 204 generates;
Required information of searching comprises that font information, character library divide page information, character library index code information, Huffman (Huffman) table, obtains the character library second-compressed data according to information from the internal storage data that step 209 generates;
Step 211:, data are carried out Huffman (Huffman) decoding according to the second-compressed data that step 210 is obtained;
Return step 206.
CN 201110221166 2011-08-02 2011-08-02 Method for coding and decoding word library based on image compression Active CN102262784B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110221166 CN102262784B (en) 2011-08-02 2011-08-02 Method for coding and decoding word library based on image compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110221166 CN102262784B (en) 2011-08-02 2011-08-02 Method for coding and decoding word library based on image compression

Publications (2)

Publication Number Publication Date
CN102262784A true CN102262784A (en) 2011-11-30
CN102262784B CN102262784B (en) 2013-09-18

Family

ID=45009399

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110221166 Active CN102262784B (en) 2011-08-02 2011-08-02 Method for coding and decoding word library based on image compression

Country Status (1)

Country Link
CN (1) CN102262784B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708191A (en) * 2012-05-15 2012-10-03 通唐软件技术(湖南)有限公司 Word stock coding and decoding method capable of saving memory
CN110164399A (en) * 2019-07-01 2019-08-23 深圳市卡迪智能科技有限公司 8 bit depth type matrix storage optimization methods

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087702A1 (en) * 2000-12-29 2002-07-04 Koichi Mori Remote contents displaying method with adaptive remote font
CN1983239A (en) * 2006-04-06 2007-06-20 华为技术有限公司 Method and system for inputting and displaying character
CN101008939A (en) * 2007-01-25 2007-08-01 深圳创维-Rgb电子有限公司 Implementation method of dot matrix word library of embedded system
CN101192212A (en) * 2006-11-20 2008-06-04 中兴通讯股份有限公司 System and method for implementing font with frame on terminal
CN101261825A (en) * 2008-04-24 2008-09-10 中兴通讯股份有限公司 A word library management method for mobile terminal system
CN101625848A (en) * 2009-07-28 2010-01-13 宁波新然电子信息科技发展有限公司 Realization method of vector font library oriented to embedded platform

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087702A1 (en) * 2000-12-29 2002-07-04 Koichi Mori Remote contents displaying method with adaptive remote font
CN1983239A (en) * 2006-04-06 2007-06-20 华为技术有限公司 Method and system for inputting and displaying character
CN101192212A (en) * 2006-11-20 2008-06-04 中兴通讯股份有限公司 System and method for implementing font with frame on terminal
CN101008939A (en) * 2007-01-25 2007-08-01 深圳创维-Rgb电子有限公司 Implementation method of dot matrix word library of embedded system
CN101261825A (en) * 2008-04-24 2008-09-10 中兴通讯股份有限公司 A word library management method for mobile terminal system
CN101625848A (en) * 2009-07-28 2010-01-13 宁波新然电子信息科技发展有限公司 Realization method of vector font library oriented to embedded platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708191A (en) * 2012-05-15 2012-10-03 通唐软件技术(湖南)有限公司 Word stock coding and decoding method capable of saving memory
CN110164399A (en) * 2019-07-01 2019-08-23 深圳市卡迪智能科技有限公司 8 bit depth type matrix storage optimization methods

Also Published As

Publication number Publication date
CN102262784B (en) 2013-09-18

Similar Documents

Publication Publication Date Title
US8433997B1 (en) Efficient portable document
US7924183B2 (en) Method and system for reducing required storage during decompression of a compressed file
US20150331619A1 (en) Data storage method and apparatus
CN107168695B (en) Excel data analysis method and system
US20200294629A1 (en) Gene sequencing data compression method and decompression method, system and computer-readable medium
CN102982127B (en) Batch substitute character string realizes method and the batch-processed devices of multi-lingual version
CN106547911B (en) Access method and system for massive small files
CN101478370B (en) File compression method and apparatus based on file system
WO2017036348A1 (en) Method and device for compressing and decompressing extensible markup language document
CN111950247A (en) Configuration-based Word document generation method
CN105096367A (en) Method and device of optimizing Canvas rendering performance
CN101398807B (en) Method and device for decompressing mobile terminal zip file
EP2482231A1 (en) Method for encoding and decoding data on a matrix code symbol
US10515286B2 (en) Image processing apparatus that performs compression processing of document file and compression method of document file and storage medium
EP2482230B1 (en) Apparatus and method for decoding matrix code symbol
CN102262784B (en) Method for coding and decoding word library based on image compression
US8930808B2 (en) Processing rich text data for storing as legacy data records in a data storage system
RU2648636C2 (en) Storage of the content in converted documents
CN104346616A (en) Character recognition device and character recognition method
CN106909623B (en) A kind of data set and date storage method for supporting efficient mass data to analyze and retrieve
CN102176205A (en) File format for storage of chain code image sequence and decoding algorithm
US9219497B2 (en) Compression device, compression method, and recording medium
CN102708191A (en) Word stock coding and decoding method capable of saving memory
US9412187B2 (en) Delayed rendering of content
CN112069549B (en) Method and system for downloading picture when Bootstrap-table plug-in exports table

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant