CN111859859B - Dot matrix word stock conversion method - Google Patents

Dot matrix word stock conversion method Download PDF

Info

Publication number
CN111859859B
CN111859859B CN202010541002.7A CN202010541002A CN111859859B CN 111859859 B CN111859859 B CN 111859859B CN 202010541002 A CN202010541002 A CN 202010541002A CN 111859859 B CN111859859 B CN 111859859B
Authority
CN
China
Prior art keywords
dot matrix
lattice
word stock
character
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010541002.7A
Other languages
Chinese (zh)
Other versions
CN111859859A (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.)
Fujian Centerm Information Co Ltd
Original Assignee
Fujian Centerm Information 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 Fujian Centerm Information Co Ltd filed Critical Fujian Centerm Information Co Ltd
Priority to CN202010541002.7A priority Critical patent/CN111859859B/en
Publication of CN111859859A publication Critical patent/CN111859859A/en
Application granted granted Critical
Publication of CN111859859B publication Critical patent/CN111859859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of dot matrix word stock, and provides a dot matrix word stock conversion method, which comprises the following steps: acquiring a first dot matrix word library, wherein the dot matrix display state corresponding to character codes in the first dot matrix word library is represented by a display dot matrix byte value; scanning dot matrix data corresponding to all character codes in the first dot matrix word library, counting the occurrence probability of each display dot matrix byte value, creating a Huffman tree by using the probability value, coding the created Huffman tree, generating a Huffman tree code table and storing the Huffman tree code table; sequentially encoding and compressing the lattice data in the first lattice word stock based on the Huffman tree code table to generate a compressed data length table and a compressed data content table; and sequentially storing the Huffman tree code table, the compressed data length table and the compressed data content table in the lattice data field of the second lattice word stock. The invention has the advantages that: the Huffman coding scheme is applied to the compression of the dot matrix word stock, and is suitable for embedded equipment with small cost and low configuration.

Description

Dot matrix word stock conversion method
[ field of technology ]
The invention relates to the technical field of dot matrix word stock, in particular to a dot matrix word stock conversion method.
[ background Art ]
The character display of the embedded system is commonly adopted as a dot matrix character library. With the wide popularization of color screens in small embedded products, the richness requirement of users for character display is higher and higher. It is desirable to cover a wider range of character codes, such as GB2312, GBK, ASCII, etc.; and hopefully supporting more diverse fonts, such as supporting Song Ti, regular script, etc. simultaneously; it is desirable to support multiple word sizes, such as 24-dot and 16-dot simultaneously, etc. The contradiction between the limited memory space and the character display requirement of the small embedded products is more prominent, so that the occupied capacity of the existing dot matrix word stock needs to be reduced
[ invention ]
The invention aims to solve the technical problem of providing a dot matrix word stock conversion method for reducing the occupied capacity of the dot matrix word stock.
The invention is realized in the following way: a dot matrix word stock conversion method includes:
acquiring a first dot matrix word library, wherein the dot matrix display state corresponding to character codes in the first dot matrix word library is represented by a display dot matrix byte value;
scanning dot matrix data corresponding to all character codes in the first dot matrix word library, counting the occurrence probability of each display dot matrix byte value, creating a Huffman tree by using the probability value, coding the created Huffman tree, generating a Huffman tree code table and storing the Huffman tree code table;
sequentially encoding and compressing the lattice data in the first lattice word stock based on the Huffman tree code table to generate a compressed data length table and a compressed data content table;
and sequentially storing the Huffman tree code table, the compressed data length table and the compressed data content table in the lattice data field of the second lattice word stock.
Further, the Huffman tree code table records the code word length and the code word value of each display dot matrix byte value.
Further, the sequence encodes and compresses the lattice data in the first lattice word stock, and the generation of the compressed data length table and the compressed data content table is specifically as follows:
and comparing the lengths of the dot matrix data corresponding to the character codes before and after the coding compression, selecting dot matrix data with smaller dot matrix data length, and storing the dot matrix data in the compressed data length table and the compressed data content table.
Further, the method further comprises the following steps: and reading the dot matrix data of the second dot matrix word stock, firstly indexing the offset of the character code index in the character code set of the second dot matrix word stock according to the input character code, then calculating the offset address of the input character code in the compressed data content table according to the compressed data length table to obtain the data content of the dot matrix data corresponding to the compressed data content table after compression, and then decompressing the dot matrix data according to the Huffman tree table.
Further, the second lattice word stock further includes a field: the method comprises the steps of editing types, resource information and word stock lattice data length, wherein the word stock lattice data length is used for storing the data length in a lattice data field;
when the character coding set of the first lattice word stock is not clipped, the resource information field is empty, and the clipping type field is marked with full coding;
when continuous character codes in a character code set of the first lattice word stock are cut, the resource information field records the number of cutting intervals and cutting interval items, the cutting interval items comprise a starting character code value and an ending character code value of each cutting interval, and the clipping type field is marked with cutting;
when the continuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved interval number and reserved interval items, the reserved interval items comprise the initial character code value and the end character code value of each reserved interval, and the clip type field is used as a reserved mark.
Further, when the discontinuous character codes in the character code set of the first lattice word stock are cut, the resource information field records the cutting code number and the cutting code value, and the clipping type field is marked with cutting;
when the discontinuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved code number and the reserved code value, and the clip type field is marked as reserved.
Further, the second lattice word stock further includes a field: the compression mode, when not compressing the first dot matrix word stock, the field of the compression mode makes an 'uncompressed' mark; when the Huffman coding compression is carried out on the first lattice word stock, the compression mode field is marked with Huffman coding.
Further, the second lattice word stock further includes a field: the character lattice storage width and the character lattice storage height are respectively used for recording the lattice width and the lattice height corresponding to the character codes in the lattice data field.
The invention has the advantages that: (1) The Huffman coding is applied to the scheme of compressing the dot matrix word stock, a unified Huffman tree code table is established, the Huffman coding compression is carried out on dot matrix data corresponding to each character code in the dot matrix word stock, a new dot matrix word stock is generated, the capacity of the dot matrix word stock is effectively reduced, and the method is very suitable for embedded equipment with small cost and low configuration; the development and maintenance cost of the product software can be obviously reduced, and the hardware cost of the product can be reduced by reducing the occupation of the storage space. (2) support all clipping modes that may be used; single or multiple coding intervals can be cut, and single or multiple character codes can be coded; only single or multiple coding intervals can be reserved, and single or multiple character codes can be reserved; the purpose of automatically adapting to various conditions can be achieved.
[ description of the drawings ]
The invention will be further described with reference to examples of embodiments with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method for converting a dot matrix word stock according to the present invention.
Fig. 2 is a schematic diagram of a character lattice in the present invention.
[ detailed description ] of the invention
The embodiment of the invention solves the technical problem of contradiction between the limited storage space of small and medium-sized embedded products and the character display requirement in the prior art by providing the dot matrix word stock conversion method, and achieves the technical effect of reducing the capacity of the dot matrix word stock.
The technical scheme in the embodiment of the invention aims to solve the problems, and the overall thought is as follows: and (3) applying the Huffman coding to a scheme of compressing the dot matrix word stock, establishing a unified Huffman tree code table, carrying out Huffman coding compression on dot matrix data corresponding to each character coding in the dot matrix word stock, generating a new dot matrix word stock, and storing the Huffman tree code table, the compressed data length table and the compressed data content table.
In order to better understand the above technical solutions, the following detailed description will refer to the accompanying drawings and specific embodiments.
Referring to fig. 1 and 2, a preferred embodiment of the dot matrix word stock conversion method of the present invention is shown.
The method of the invention comprises the following steps: step S10, a first lattice word stock, such as GBK lattice word stock (the font is Song Ti, the pixel specification of the font is 24 multiplied by 24), the GBK coding standard is compatible with GB2312, 21003 Chinese characters and 883 symbols are recorded in total, 1894 character making digits are provided, and simplified and traditional Chinese characters are merged into one stock, and the character stock further comprises punctuation marks, mathematical symbols, digital serial numbers, full-angle digital letters, japanese hiragana, katakana, greek letters, russian letters, graphic symbols, tab symbols, pinyin, phonetic symbols and the like.
The lattice specification m×n in the first lattice word stock is expressed as: m points are arranged in each row in the bitmap corresponding to the character code, and N rows are altogether arranged; is the lattice specification stored in the file of the lattice word stock. The display state of the dot matrix corresponding to the character codes in the dot matrix word library is represented by a byte value, and the byte value is called a display dot matrix byte value; a point in the bitmap is represented by one bit, m×n is an integer multiple of one byte, and one byte is composed of eight bits; there are 256 kinds of one byte, i.e., the display dot matrix byte value.
And step S20, scanning dot matrix data corresponding to all character codes in the first dot matrix word stock, wherein the number of the character codes in the dot matrix word stock is c. The dot matrix corresponding to a character code is represented by a plurality of display dot matrix byte values, and the dot matrix data is data composed of a plurality of display dot matrix byte values.
Step S30, counting the occurrence probability of each display lattice byte value, wherein the occurrence probability of the 1 st display lattice byte value '00000000' is p 1 The occurrence probability of the 2 nd display lattice byte value "00000001" is p 2 The j-th display lattice byte value has an occurrence probability p j 256 th display dot matrix byte value "11111111" has occurrence probability p 256 . The following table shows:
and S40, creating a Huffman tree by using the probability value, encoding the created Huffman tree, generating a Huffman tree code table and storing the Huffman tree code table. The Huffman tree is also called an optimal binary tree, and is a binary tree with the shortest weighted path length. The weighted path length of the tree is the weight of all leaf nodes in the tree multiplied by the path length to the root node. Huffman coding is one of Variable Length Codes (VLCs) that constructs the codeword with the shortest average length of the heteronym header based entirely on the probability of occurrence of the character.
The Huffman tree code table records the code word length and the code word value of each display dot matrix byte value; the codeword length represents the number of significant bits of the codeword value, which is a huffman tree coded value. Huffman tree code is expressed as { X } 0 ,M 0 ,X 1 ,M 1 ,X 2 ,M 2 ,…,X 255 ,M 255 (wherein X is 0 Namely, the code word length corresponding to the display dot matrix byte value '00000000', M 0 Namely, the code word value corresponding to the display dot matrix byte value '00000000', X 1 Namely, the code word length corresponding to the displayed dot matrix byte value '00000001', M 1 Namely, the code word value corresponding to the display dot matrix byte value '00000001', X 2 Namely, the code word length corresponding to the display dot matrix byte value '00000010', M 2 Namely, the code word value corresponding to the display dot matrix byte value '00000010', X 255 Namely, the code word length corresponding to the display dot matrix byte value '11111111', M 255 I.e. the codeword value corresponding to the display lattice byte value "11111111".
Because the code word value is Variable Length Code (VLC), the small-end mode can be adopted when a plurality of bytes are contracted, and when the effective bit number is less than the integer multiple of 8, the low bit in the byte is taken as the effective bit. Let the value of the code word length be represented by l, the value of the number v of bytes occupied by the code word value be represented by C language:
v=l%8==00:1;
v+=l/8。
step S50, dividing the lattice data in the lattice word stock by taking the size of the lattice data corresponding to each character code as a unit, sequentially encoding and compressing the lattice data in the first lattice word stock based on the Huffman tree code table to generate a compressed data length table and a compressed data content table, wherein the compressed data length table is used for sequentially storing the compressed length of the lattice data corresponding to each character code, and the compressed data length table is { Y } 0 ,Y 1 ,Y 2 ,…,Y k ,…,Y c-1 -wherein Y is k The length of the dot matrix data corresponding to the k+1th character code after compression is the length, and k is an integer. The compressed data content table is used for sequentially storing the data content of the dot matrix data compressed corresponding to each character code; the compressed data content is expressed as { Z ] 0 ,Z 1 ,Z 2 ,…,Z k ,…,Z c-1 Z is }, where Z k The data content formed by Huffman tree codes after the dot matrix data corresponding to the k+1th character codes are compressed is shown.
And step S60, sequentially storing the Huffman tree code table, the compressed data length table and the compressed data content table in the lattice data field of the second lattice word stock. The following table shows:
the second lattice word stock is the new lattice word stock obtained after conversion.
The sequence encodes and compresses the lattice data in the first lattice word stock to generate a compressed data length table and a compressed data content table specifically comprises: and comparing the lengths of the dot matrix data corresponding to the character codes before and after the coding compression, selecting dot matrix data with smaller dot matrix data length, and storing the dot matrix data in the compressed data length table and the compressed data content table. Namely: if passing throughThe dot matrix data length corresponding to the character codes after coding compression is larger than or equal to the dot matrix data length before compression, and the dot matrix data length and the dot matrix data corresponding to the character codes before compression are respectively stored in the compressed data length table and the compressed data content table; i.e. without huffman coding. And if the dot matrix data length corresponding to the character codes after coding compression is smaller than the dot matrix data length before compression, respectively storing the dot matrix data length and the data content corresponding to the character codes after compression in the compressed data length table and the compressed data content table. The method comprises the following steps: let the dot matrix data length before the kth character encoding compression be S k The dot matrix data content before compression is R k The length of dot matrix data compressed by Huffman coding is T k The lattice data content after Huffman coding compression is U k The method comprises the steps of carrying out a first treatment on the surface of the If S k ≥T k T is then taken k The value passed to Y in the compressed data length table k U is set up k The value passed to Z in the compressed data content table k The method comprises the steps of carrying out a first treatment on the surface of the If S k <T k Will S k The value passed to Y in the compressed data length table k R is taken as k The value passed to Z in the compressed data content table k . And the compression effect is improved.
Further comprises: reading dot matrix data of the second dot matrix word stock, and firstly indexing the offset of the dot matrix data in a character coding set of the second dot matrix word stock according to the input character codes, wherein the offset of the k-th character code is k; for example, the character code of the word "i" in the GBK library is CED2, and the character code set in the GBK library is 14776. Calculating the offset address of the incoming character code in the compressed data content table according to the compressed data length table, wherein the offset address of the kth character code is represented as sigma Y g 0 < g < k. The offset address of the 1 st character encoded in the compressed data content table is 0.
And obtaining the data content of the compressed lattice data corresponding to the compressed data content table, and then decompressing the lattice data according to the Huffman tree table. Can be displayed in the display screen.
The second dot matrix word stock is further described in connection with the following two tables.
Resource information field record Offset of Number of bytes Action
Number of intervals 0 2 The number of coding sections is denoted by m
Interval 1 start code value 2 i Initial code value indicating 1 st code section
Section 1 end code value 2+i i Indicating the end code of the 1 st code sectionCode value
……
Interval m start code value 2+2i(m-1) i Initial code value indicating mth code section
Interval m start address 2+2i(m-1)+i i End code value indicating mth code section
Coding number 2+2im 2 The number of the coded values is represented by n
Coding value 1 4+2im i Indicating the 1 st code value
……
Coding value n 4+2im+i(n-1) i Indicating the nth code value
The i value in the table above depends on the coding type; if ASC codes are used, the i value is 1, namely each code occupies 1 byte; in the case of GBK codes, the i value is 2, i.e. each code takes up 2 bytes.
Table description: the second lattice word stock further includes fields: the method comprises the steps of editing types, resource information and word stock lattice data length, wherein the word stock lattice data length is used for storing the data length in a lattice data field;
when the character coding set of the first lattice word stock is not clipped, the resource information field is empty, and the clipping type field is marked with a full coding, such as 0.
When continuous character codes in a character code set of the first lattice word stock are cut, the resource information field records the number of cutting intervals and cutting interval items, the cutting interval items comprise a starting character code value and an ending character code value of each cutting interval, and the clipping type field is marked with cutting; such as labeled 1. Because the GBK library contains Japanese, russian and other information, the codes of Japanese and Russian characters in the GBK lattice word library and the lattice can be cut off without using Japanese and Russian characters for displaying the product characters used by some clients, and the Japanese and Russian character codes are continuously stored. The number of cutting intervals is 2, the 1 st cutting interval is assumed to be Japanese character code, and the 1 st cutting interval item is the initial character code value and the end character code value of Japanese character; the 2 nd cutting interval is the Russian character code, and the 2 nd cutting interval item is the initial character code value and the end character code value of the Russian character; and so on. Thus, huffman coding compression is not performed on the dot matrix data corresponding to the Japanese character codes in Russian.
When the continuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved interval number and reserved interval items, the reserved interval items comprise a start character code value and an end character code value of each reserved interval, and the clip type field is used as a reserved mark; such as labeled 2. If some of the product characters used by the customer are displayed only by Chinese characters and Greek characters, the character codes of the Chinese or Greek characters are stored continuously. The number of reserved intervals is 2, the 1 st reserved interval item is the initial character code value and the end character code value of Chinese characters, and the 2 nd reserved interval item is the initial character code value and the end character code value of Greek characters. Therefore, only the dot matrix data corresponding to the character codes of the Chinese characters and the Greek characters are subjected to Huffman coding compression.
When the discontinuous character codes in the character code set of the first lattice word stock are cut, the resource information field records the cutting code number and the cutting code value, and the clipping type field is marked with cutting; such as cutting out "," "delta". The resource information field records the character codes of which the cutting code number is 3, records the character codes of "," ", and" DELTA ", and deletes the corresponding dot matrix data.
When the discontinuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved code number and the reserved code value, and the clip type field is marked as reserved. In combination with the above description, only the dot matrix data corresponding to the reserved character codes are compressed by Huffman coding, and the rest are deleted.
The second lattice word stock further includes fields: the compression mode, when not carrying on Huffman code compression to the said first lattice word stock, the said compression mode field makes "not compress" mark; thus, a second lattice word stock which is only subjected to character clipping and not subjected to character compression can be obtained. When the Huffman coding compression is carried out on the first lattice word stock, the compression mode field is marked with Huffman coding.
The second lattice word stock further includes fields: the character lattice storage width and the character lattice storage height are respectively used for recording the lattice width and the lattice height corresponding to the character codes in the lattice data field. The user can know the lattice specification of the used lattice word stock conveniently. Corresponds to the lattice specification M x N of the first lattice word stock mentioned above.
In practice, there are characters in the display screen, and the pixel width is not a multiple of 8; to simplify the processing logic, the character lattice width is complemented by a multiple of 8 on the memory by way of padding in the lattice word stock. For example, the file name of the dot matrix word stock is specified as GBK_22x22_ Song Ti. Fnt, that is, the width and height of the effective pixel of the character display in the dot matrix word stock are 22x22 according to the file name. The character lattice storage width and the character lattice storage height on the data store are complemented by 24x22. But the valid bit is still 22. I.e. M is equal to or greater than the pixel count value per line of the font pixel specification.
For example, the file name of the dot matrix word stock is appointed as ASC_12x24_Calibri.fnt, that is, the width and height of the effective pixel of the character display in the dot matrix word stock are 12x24. Since the two-row lattice occupies just 24 bits, i.e. 3 bytes, the processing logic is not complex. Therefore, the character lattice storage width and the character lattice storage height on the data storage can be adopted as original 12x24 or can be complemented to 16x24. The elastic design is carried out according to the user requirement on whether the storage width of the character lattice is the multiple of 8, which is not the hard requirement of the technical scheme of the invention, but is within the protection scope of the claims of the invention.
The file names of the new dot matrix word library generated by the method of the present invention are described in the following.
After the new lattice word stock is generated, the format of the file name of the new lattice word stock is automatically modified as follows:
"coding type_pixel specification_font fnt". Wherein the following description is given:
coding type: such as ASC, GBK, GB2312
Pixel specification: the format is "width x height", the middle of width and height is lower case letter x, taking pixel as unit
Font: such as "Song Ti", "microsoft black", "regular script", "simulated song", etc.
Therefore, a user can intuitively see which word libraries are supported on the current terminal, and the system is convenient for indexing the fonts required by the user.
The new dot matrix word stock generated by the method greatly reduces the capacity and the occupation of the storage space; the method is very suitable for being stored in a storage of terminal equipment such as small embedded products, and is convenient for a display screen of the terminal equipment to display character lattices and print the character lattices on printing paper.
The user can dynamically add, delete or modify the dot matrix word stock according to the needs, and install or uninstall the dot matrix word stock in the storage, and only needs to load new dot matrix word stock files or delete unnecessary dot matrix word stock files, and only needs to update the corresponding files to change the existing dot matrix word stock. The dot matrix word library can be added, deleted or modified at will in the memory without modifying the application program of the terminal equipment, and the terminal equipment can be cut, compressed and expanded. The development and maintenance cost of the product software can be obviously reduced, and the hardware cost of the product can be reduced by reducing the occupation of the storage space.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that the specific embodiments described are illustrative only and not intended to limit the scope of the invention, and that equivalent modifications and variations of the invention in light of the spirit of the invention will be covered by the claims of the present invention.

Claims (6)

1. The dot matrix word stock conversion method is characterized by comprising the following steps of:
acquiring a first dot matrix word library, wherein the dot matrix display state corresponding to character codes in the first dot matrix word library is represented by a display dot matrix byte value;
scanning dot matrix data corresponding to all character codes in the first dot matrix word library, counting the occurrence probability of each display dot matrix byte value, creating a Huffman tree by using the probability value, coding the created Huffman tree, generating a Huffman tree code table and storing the Huffman tree code table;
based on the Huffman tree code table, sequentially encoding and compressing the dot matrix data in the first dot matrix word library to generate a compressed data length table and a compressed data content table, comparing the dot matrix data lengths corresponding to the character codes before encoding and after encoding and compressing, and selecting dot matrix data with smaller dot matrix data length to store in the compressed data length table and the compressed data content table;
sequentially storing the Huffman tree code table, the compressed data length table and the compressed data content table in lattice data fields of a second lattice word stock;
the second lattice word stock further includes fields: the method comprises the steps of editing types, resource information and word stock lattice data length, wherein the word stock lattice data length is used for storing the data length in a lattice data field;
when the character coding set of the first lattice word stock is not clipped, the resource information field is empty, and the clipping type field is marked by full coding;
when continuous character codes in a character code set of the first lattice word stock are cut, the resource information field records the number of cutting intervals and cutting interval items, the cutting interval items comprise a starting character code value and an ending character code value of each cutting interval, and the clipping type field is used as a cutting mark;
when the continuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved interval number and reserved interval items, the reserved interval items comprise the initial character code value and the end character code value of each reserved interval, and the clip type field is used as a reserved mark.
2. The method of claim 1, wherein said huffman tree code table records a codeword length and codeword value for each of said displayed lattice byte values.
3. The method of dot matrix word stock conversion according to claim 1, further comprising: and reading the dot matrix data of the second dot matrix word stock, firstly indexing the offset of the character code index in the character code set of the second dot matrix word stock according to the input character code, then calculating the offset address of the input character code in the compressed data content table according to the compressed data length table to obtain the data content of the dot matrix data corresponding to the compressed data content table after compression, and then decompressing the dot matrix data according to the Huffman tree table.
4. The dot matrix word stock conversion method of claim 1, wherein the resource information field records a clip code number and a clip code value when clipping a discontinuous character code in a character code set of the first dot matrix word stock, the clip type field being a clip flag;
when the discontinuous character codes in the character code set of the first lattice word stock are reserved, the resource information field records the reserved code number and reserved code value, and the clip type field is used as a reserved mark.
5. The method of claim 1, wherein the second lattice word stock further comprises the fields of: the compression mode, when not compressing the first dot matrix word stock, the field of the compression mode makes the non-compression mark; and when the Huffman coding compression is carried out on the first lattice word stock, the compression mode field is marked by Huffman coding.
6. The method of claim 1, wherein the second lattice word stock further comprises the fields of: the character lattice storage width and the character lattice storage height are respectively used for recording the lattice width and the lattice height corresponding to the character codes in the lattice data field.
CN202010541002.7A 2020-06-15 2020-06-15 Dot matrix word stock conversion method Active CN111859859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010541002.7A CN111859859B (en) 2020-06-15 2020-06-15 Dot matrix word stock conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010541002.7A CN111859859B (en) 2020-06-15 2020-06-15 Dot matrix word stock conversion method

Publications (2)

Publication Number Publication Date
CN111859859A CN111859859A (en) 2020-10-30
CN111859859B true CN111859859B (en) 2023-08-15

Family

ID=72987359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010541002.7A Active CN111859859B (en) 2020-06-15 2020-06-15 Dot matrix word stock conversion method

Country Status (1)

Country Link
CN (1) CN111859859B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360113B (en) * 2021-05-24 2022-07-19 中国电子科技集团公司第四十一研究所 System and method for dynamically adjusting character display width based on OLED screen

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855023A (en) * 2005-04-21 2006-11-01 上海集通数码科技有限责任公司 Universal compressed Chinese character library chip
CN101261825A (en) * 2008-04-24 2008-09-10 中兴通讯股份有限公司 A word library management method for mobile terminal system
JP2012213088A (en) * 2011-03-31 2012-11-01 Dynacomware Taiwan Inc Method and system for compressing and decompressing dot-matrix font data by computer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855023A (en) * 2005-04-21 2006-11-01 上海集通数码科技有限责任公司 Universal compressed Chinese character library chip
CN101261825A (en) * 2008-04-24 2008-09-10 中兴通讯股份有限公司 A word library management method for mobile terminal system
JP2012213088A (en) * 2011-03-31 2012-11-01 Dynacomware Taiwan Inc Method and system for compressing and decompressing dot-matrix font data by computer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
用哈夫曼算法实现小点阵汉字库的压缩技术;王载森;《微型电脑应用》;19970915(第05期);正文40-44页 *

Also Published As

Publication number Publication date
CN111859859A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
US6119120A (en) Computer implemented methods for constructing a compressed data structure from a data string and for using the data structure to find data patterns in the data string
US5548338A (en) Compression of an electronic programming guide
US8659451B2 (en) Indexing compressed data
Roth et al. Database compression
JP3337633B2 (en) Data compression method and data decompression method, and computer-readable recording medium recording data compression program or data decompression program
US6563438B2 (en) Encoding and decoding apparatus with matching length means for symbol strings
US5999949A (en) Text file compression system utilizing word terminators
US6067553A (en) Image data transfer system using object reference table
JPH08330974A (en) Data compression method and circuit for restoring compressed code
US7663511B2 (en) Dynamic character encoding
US6247015B1 (en) Method and system for compressing files utilizing a dictionary array
US5444445A (en) Master + exception list method and apparatus for efficient compression of data having redundant characteristics
KR19980080230A (en) Data Compression Apparatus, Data Restoration Apparatus, Data Compression Method, Data Restoration Method and Program Recording Media
CN111859859B (en) Dot matrix word stock conversion method
US5815096A (en) Method for compressing sequential data into compression symbols using double-indirect indexing into a dictionary data structure
Wayner Compression algorithms for real programmers
CN116827354B (en) File data distributed storage management system
JP6645013B2 (en) Encoding program, encoding method, encoding device, and decompression method
WO2002058379A1 (en) Method for electronic transport of digital ink
US8463759B2 (en) Method and system for compressing data
CN111914513A (en) RDP window title character recognition method and device
CN103488618A (en) Text information transmission method and system, and text information display method and system
CN1172266C (en) Compressed chinese character library chip
CN111737388B (en) Geological map data storage processing method
Урбанович Information Protection, Part 9: DATA COMPRESSION

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant