In order to print data, such as text, the data to be printed is encoded. The encoding schemes represent the characters to be printed. Because there are numerous written languages having distinct characters, the encoding schemes represent, for example, the characters in different languages. Although there are various schemes utilized to encode data, Unicode is a standardized code for representing text. Unicode includes a code word for each character in a particular language. For example, one code word in Unicode would represent a Chinese pictograph, another code word in Unicode represents an Arabic character, while yet another code word in Unicode represents a character in the Latin alphabet. The code words also have a particular length. Unicode uses a two byte code word for most characters. In addition, Unicode groups characters in a particular numeric range. For example, all Arabic characters are represented by Unicode code words within a particular numeric range.
In addition to using a particular encoding scheme, a font is also used to print the data stream. For example, an Open Type font might be used in conjunction with Unicode. The font specifies the glyph, which is the character shape actually printed by a conventional printer. Thus, the font would indicate whether the “A” represented by the Unicode code word is a Times New Roman glyph or an Arial glyph. The font could also include Chinese pictographs, Arabic characters or other characters. The font is used to convert between the code word and the glyph. For example, the font might include an encoding table and a glyph table. The encoding table would be used to convert the code word for a particular encoding scheme to a corresponding glyph index. The glyph table would be used to convert the glyph index to a particular glyph. The glyph would then be printed in a particular location on the page corresponding to the code word.
Using Unicode code words in a data stream, a conventional computer system could convert Unicode to other data, for example a bit map of the glyph to be printed and the location of the glyph. This data is provided to a conventional printer. The conventional printer would print the glyph in the location corresponding to the Unicode code word. In such rendering a particular code word or set of code words always corresponds to the same glyph or set of glyphs. Thus, one-to-one rendering of a code word to a glyph is performed.
Although encoding schemes such as Unicode provide a code word for each character, one of ordinary skill in the art will readily recognize that in certain, complex languages, the glyph used to represent a given character depends upon its context. For example, in Arabic, Indic, and Thai language groups, the glyph used depends upon the surrounding characters. In addition, certain languages are written in a different order. English is typically written from left to right. However, other scripts are written from right to left. In addition, some scripts are written both right to left and left to right. For example, in Hebrew and Arabic, text is written right to left, but numbers are written left to right. As a result, the processing of code words is highly dependent upon the language. For complex languages, for example those read in a different order or having characters that are context dependent, identity and/or order of glyphs depend upon the context. Thus, printing of complex text data, such as the complex text described above, cannot be performed using one-to-one rendering.
FIG. 1 depicts a conventional system 10 used to print data including complex text data. The conventional system 10 might print text using an encoding scheme such as Unicode. For clarity, the conventional system 10 is described in the context of Unicode. The conventional system 10 includes a computer system 20 and a printer 30. The computer system 10 might include one or more clients and a print server or a desktop computer. The conventional computer system 20 includes a conventional formatter 22 and, for certain complex text data, a conventional layout engine 24, and a conventional font 26. The conventional formatter 22, conventional layout engine 24, and font 26 might reside on a print server (not shown) or a desktop. The conventional formatter 22 formats a data stream to be printed. The data stream is encoded in Unicode. Consequently, the conventional formatter 22 uses the conventional layout engine 24 for Unicode complex text. The conventional layout engine 24 might be a Unicode layout engine such as the Uniscribe layout engine for WINDOWS. The conventional layout engine 24 can typically run on platforms such as Windows or UNIX. The font 26 may be an Open Type font that is used to render complex text.
The conventional layout engine 24 analyzes complex text data, such as Unicode complex text, and determines the appropriate glyph for a particular Unicode code word. The conventional layout engine 24 thus includes data related to languages and contexts. The conventional layout engine 24 utilizes this data to analyze complex text, determine contexts and thus determine the appropriate glyph. The conventional layout engine 24 thus also uses the font 26. For example, if the font 26 is an Open Type font, the conventional layout engine 24 would determine the appropriate glyph and, using the font 26, determine the appropriate glyph indices. Alternatively, the conventional layout engine 24 might determine a bit pattern for the glyph using the conventional rasterizer 28. This would occur when the printer 30 does not support the font 26. For example, the conventional layout engine 24 might use the font 26 to determine the appropriate glyph indices and, using the glyph indices, the appropriate glyph. The conventional rasterizer 28 might then output a bit pattern of the appropriate glyph.
FIG. 2 depicts a conventional method 50 for printing text encoded using Unicode and including Unicode complex text. The print data is obtained, for example from a client, via step 52. The conventional layout engine 24 in the computer system 20 is used to convert any Unicode complex text in the print stream into glyphs, via step 54. In order to perform step 54, the conventional layout engine 24 utilizes the font, described above. In converting the Unicode complex text into glyphs in step 54, the conventional layout engine 24 and conventional rasterizer 28 typically output the bit patterns of the glyphs.
The remaining portion of the Unicode text, which is not Unicode complex text, is rendered using one-to-one rendering, via step 56. The result of one-to-one rendering is bit patterns. In addition, in contrast to the Unicode complex text, one-to-one rendering might take place in the conventional printer 30 rather than in the conventional computer system 20. The conventional data stream, which includes bit patterns for Unicode complex text and Unicode code words for the remaining Unicode text, is passed to the conventional printer 30 for printing, via step 58. The conventional data stream also includes the locations of the glyphs. The conventional printer 30 then prints the data stream using the conventional rasterizer 34, via step 60. Step 60 might include performing one-to-one rendering for Unicode data that is not complex. Step 60 also includes placing the glyphs in the appropriate positions on the page.
Although the conventional system 10 and conventional method 50 function, one of ordinary skill in the art will readily recognize that there are drawbacks. The data for the Unicode complex text that is passed to the printer 30 is typically in the form of bit patterns. In any case, the code words for the Unicode complex text are not passed to the conventional printer 30. Once the bit patterns are generated, neither the computer system 20 nor the conventional printer 30 has any knowledge of the text represented by the data corresponding to the Unicode complex text. The data stream can no longer be processed for text operations, such as sorting, searching, indexing, merging or repurposing. In addition, bit patterns for a glyph are relatively large in comparison to the corresponding Unicode code words. Consequently, the transmission of data between the conventional computer system 20 and the conventional printer 30 may be inefficient and time consuming.
Accordingly, what is needed is an improved system and method for printing Unicode complex text data. The present invention addresses such a need.