Summary of the invention
The object of the present invention is to provide a kind of font information to show solution, be mainly used in network-termination devices such as the digital television that uses embedded OS, top box of digital machine, personal hand-held.,, simultaneously curved profile font and raster font data are done compression and handle as Data Source with curved profile character library and dot matrix word library based on text structure and graphic structure body.Under the network system environment during literal information transmission, a kind of word-base data that adopts after the compressing and converting is provided, effectively solve the correct method that shows of multilingual, the multiple style font of network-termination device environment.
This process comprises the steps:
1. based on the phonetic element of a Chinese pictophonetic character, the pictographic element of a pictophonetic inherent characteristics of Chinese character, adding up its situation at the curved profile word-base data frequency of occurrences and the simplified and traditional degree of stroke and corresponding with it a plurality of fixed measure dot array data pieces, is unit regulation sequence number with the graphic structure body.Create simultaneously with the graphic structure body is the text structure data of the whole word of formation of unit.
2. be unit regulation curved profile digital data and dot matrix character data with the graphic structure body, distinctive rule according to the description of graphic structure volume data, with curved profile digital data and dot matrix character data, arrange with binary coding, form the data compression character library (form is seen accompanying drawing 1) that the filename suffix is STC together with the text structure data.
3. be that the character library of STC processes to the filename suffix again, the correct method that shows of multilingual, the multiple style font of network-termination device environment that solves is provided.
The definition of text structure: information formed in the literal that is used to describe based on the graphic structure body.Each literal is made up of one or more graphic structure bodies, and text structure is used to describe the relevant information of each graphic structure body of forming literal, comprises numbering, coordinate and zooming parameter.(form is seen accompanying drawing 3.)
The definition of graphic structure body:, use geometric figure, view data to describe to the information of the part of word in the character library or word.The graphic structure body of a word or a word part is the set of several discontinuous straight lines, curve, geometric figure and view data.(form is seen accompanying drawing 5.)
The curved profile word of describing with the graphic structure body method after the statistics and dot matrix character data according to distinctive rule, are arranged with the binary coding compression,, formed a data compression character library that the filename suffix is STC together with text structure data sequential storage.At first preserve file header information (form is seen accompanying drawing 2) in the character library, be followed successively by text structure offset-lists, text structure data, graphic structure solid offsetting scale and graphic structure volume data then, also have optional character code table and inlay text structure data subsequently.
To the filename suffix is that the character library of STC processes again, be implemented under the computer network system environment, multilingual, the multiple style font information that will transmit, peculiar form with method of compressing data formation, solve because of terminal in the network and main website character set inconsistent, and cause terminal can not be fast, the problem of normal character display.
Method of the present invention can be applicable to widely: network-termination devices such as the digital television of WIN CE or embedded OS, top box of digital machine, personal hand-held.
The invention has the advantages that: the compression processing done simultaneously in curved profile word in the word-base data and dot matrix character data, make word-base data on the basis that keeps former character library style characteristic, memory capacity is saved greatly, can effectively solve curved profile font small size font under specific display environment in this way and show bad shortcoming.The character library of 28000 Chinese characters and symbol, the shared storage space of curved profile digital data after handling through method compression of the present invention is the 1M byte.The word-base data of a in addition 16 * 16 dot matrix, handling the shared storage space in back through method compression of the present invention is the 150K byte, is about 1/14th of original unidimensional dot matrix word library memory capacity.Owing to adopt the method for network character font data flow transmission, also make when multilingual, the multiple style font of network-termination device environmental applications, significantly reducing of literal transmitted data amount under the situation that does not increase the terminal device storage hardware and the network bandwidth, can be transmitted more font information.Can strengthen the functions of use of these equipment, effectively reduce cost.Be further to save carrying cost, terminal even the data of font can be installed.
Embodiment
Below in conjunction with the drawings and specific embodiments the inventive method is described further:
The phonetic element of a Chinese pictophonetic character, pictographic element of a pictophonetic inherent characteristics based on Chinese character, data to curved profile character library and dot matrix word library are analyzed, add up the situation of its frequency of occurrences, simplified and traditional degree and corresponding with it a plurality of fixed measure dot matrix character data pieces, with the graphic structure body is unit description, stipulates corresponding sequence number.Create simultaneously with the graphic structure body is the text structure data of the whole word of formation of unit.With needed graphic structure body,, form a data compression character library that the filename suffix is STC together with text structure data and other relevant information sequential storage.
The graphic structure body quantity of 28000 Chinese characters and character character library is 6381 kinds.The graphic structure volume data is made of two parts data, is respectively dot array data piece and curved profile data block.The data structure of graphic structure body (form is seen accompanying drawing 5) is arranged the dot array data piece subsequently for the length of dot array data in the recording geometry structure at first, and the curved profile data block.
In order to adapt to the different zoom parameter of graphic structure body correspondence in kinds of characters, the dot array data that can comprise a plurality of different sizes in the dot array data piece, its width and the height the dot array data piece begin be arranged in order, be arranged in order the dot array data information of different size subsequently.
The quantity of recording curve profile at first in the curved profile data block is followed successively by the data of each curved profile subsequently.The curved profile data owner will be made up of command parameter (accompanying drawing 6 is seen in tabulation) and corresponding reference mark coordinate, arranges the compression storage in a certain order.
In the STC font file, store a plurality of text structure data and a plurality of graphic structure volume data, in order to find corresponding data fast, in the STC font file, also preserve text structure offset-lists (form is seen accompanying drawing 7) and graphic structure solid offsetting scale (form is seen accompanying drawing 8).
To handle different character codes in order adapting in addition, can also to preserve corresponding character code table in the font file, be used to carry out corresponding character code and explain.
Dot array data in the graphic structure body is after the curved profile data processing of graphic structure body is finished, contrast each graphic structure body curve outline data, zooming parameter according to the graphic structure body extracts in the mode of data block, and stores in the mode of view data.
The method of extracting dot array data is:
1. selected graphic structure body is found out all characters that call this graphic structure body.
2. find out the character that all call directions X and Y direction zooming parameter the most close 100% in this graphic structure body.
3. according to the actual shared rectangular extent of the graphic structure body zooming parameter and the graphic structure body of this character, calculate in the actual rectangular extent of specifying the graphic structure body under the lattice dimensions.New memory location is arrived with its dot matrix contents extraction in the relevant position of the dot matrix character data that the rectangular extent alignment that use calculates will extract.
4. the corresponding dot array data piece of graphic structure body extracts and finishes, and with the outline data piece front that the extraction dot array data adds the graphic structure body in the mode of view data, preserves data.
Each character is made up of one or more graphic structure bodies in the character library.The related data that the graphic structure body is formed character is kept in the text structure data.Each graphic structure body has the sequence number of himself, the coordinate in whole character, and the zooming parameter in the whole character.For example, certain character corresponding character structured data formats following (seeing accompanying drawing 3):
At first writing down the text structure beacon information (seeing accompanying drawing 4) of character, is the horizontal ordinate in each graphic structure body sequence number, the character, the zooming parameter in the character then successively.
Curved profile data character method of reduction treatment (seeing accompanying drawing 10,11,12,13,14):
1. according to the correlation parameter information of input, correlation parameters is set, and the initialization buffer zone.
2. processing coded message is converted to the character index numbering with the GB sign indicating number of input character or UNICODE sign indicating number according to the corresponding encoded table.
3. from the text structure offset-lists, obtain the text structure data offset of character according to the character index numbering.
4. read the text structure data, each literal is made up of a plurality of graphic structure bodies, and each graphic structure body is to having oneself coordinate offset amount and zooming parameter.
5. the quantity according to the graphic structure body circulates, handle each graphic structure body successively, according to the numbering of the graphic structure body that reads, in graphic structure solid offsetting scale, obtain the side-play amount of graphic structure volume data, read the graphic structure volume data according to side-play amount.
6. read the curved profile data of respective graphical structure according to the curved profile data processing method, handle the curved profile coordinate according to command parameter and font parameter successively, and be converted to straight line and curve uses corresponding straight line or curve processing method to handle, fill at last and write buffer zone.
7. after the processing of finishing all graphic structure bodies, the return character data are for demonstration.
The method of reduction treatment basic procedure of dot array data identical with outline data (seeing accompanying drawing 8), its difference are mainly above-mentioned the 6th step and handle to change into and use the dot array data disposal route to handle, and its basic skills is as follows:
1. read the dot array data piece of respective graphical structure.
2. after the coordinate parameters conversion through the graphic structure body, obtain its physical location when specifying size, just position, the upper left corner of this dot array data.According to the wide high parameter of dot array data, reduction dot array data original shape is stored in buffer zone.
3. the zooming parameter according to the graphic structure body calculates the actual wide, high of this graphic structure body,, height ratio wide with corresponding dot array data, whether decision will be done dot array data and take out line or ledger line is handled.
Character library to compressing and converting processes again, solves the correct problem that shows of multilingual, the multiple style font of network-termination device environment, and its method is as follows:
1. when the character library font of character font that will show in the network system and terminal installation is inconsistent.According to parameters such as the font name of wanting character display, coding, types, mate with corresponding font name, type parameter in the main website several different character libraries with method establishment of the present invention.If the match is successful, judge coding parameter again, in the word-base data of correspondence, extract the text structure and the graphic structure volume data of this character, be converted to network word-base data stream format (seeing accompanying drawing 9) that terminal can handle then and be embedded into and send in the Word message stream that terminal handles.If coupling is unsuccessful, then select a font name, the approaching word-base data of type to substitute.
2. the character font that will show in network system is consistent with the character library font of terminal installation, but the character set that the character set that the character library that main website is installed is used is used greater than the terminal character library, character to display is not just in the character set scope of terminal character library, and in the character set scope of character library is installed by main website.According to parameters such as the font name of wanting character display, coding, types, mate with corresponding font name, type parameter in the main website several different character libraries with method establishment of the present invention.According to coding parameter, in the word-base data of correspondence, extract the text structure and the graphic structure volume data of this character, be converted to network word-base data stream format (seeing accompanying drawing 9) that terminal can handle then and be embedded into and send in the Word message stream that terminal handles.Because main, the employed font unanimity of terminal, only the character set difference when the graphic structure body of forming character also is included in the terminal character library simultaneously, only needs to use special graph structure form to preserve the graphic structure volume data and gets final product, and can significantly reduce data volume.
3. the character font that will show in the network system and the terminal character library font of installing is consistent, but want character display be main, terminal character set scope in addition do not include character.The inlay editor means that use provides in main website based on main website same font character library, with the graphic structure body in the character library, are done the mosaic of inlay in the mode of convergent-divergent, translation, and and the corresponding characters coding be saved in the inlay character library of main website together.According to coding parameter, in the inlay word-base data, extract the text structure and the graphic structure volume data of this character, be converted to network word-base data stream format (seeing accompanying drawing 9) that terminal can handle then and be embedded into and will send in the Word message stream that terminal handles.Because the employed graphic structure body of inlay in the time of also may being included in the terminal character library simultaneously, when this situation occurs, only needing to use special graph structure form to preserve the graphic structure volume data and gets final product, and can significantly reduce data volume.
4. after terminal receives Word message stream, handle each character successively, for the character that does not have embedded network word-base data stream, use the normal process method from the terminal character library, to read character data, for the character that has embedded network word-base data stream, then give interpretive routine with the data transfer of its embedding, interpretive routine therefrom reads character data and carries out the character reduction.
Inlay editing and processing method:
At first, create an inlay character library in main website, this character library is mainly used in correspondence coding, the text structure of depositing the inlay character, and whole graphic structure volume datas of the different fonts of having created with the inventive method.In the inlay editing process, according to inlay character situation, select needed graphic structure body, finish the work of mosaic through operations such as translation, convergent-divergents.Then, the text structure relevant information of this character is converted to corresponding data layout, the sign that is encoded to this character is stored in the inlay character library, just mosaic work needn't be again carried out when using this character more next time, the text structure and the graphic structure volume data of this character can be directly from the inlay character library, extracted.
The method of this inlay editing and processing also can be embedded in the system of terminal.Its function is a subclass of the method for main website inlay editing and processing.