]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | |
2 | /* | |
3 | * HanLayoutEngine.h: OpenType processing for Han fonts. | |
4 | * | |
729e4ab9 | 5 | * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved. |
b75a7d8f A |
6 | */ |
7 | ||
8 | #ifndef __HANLAYOUTENGINE_H | |
9 | #define __HANLAYOUTENGINE_H | |
10 | ||
11 | #include "LETypes.h" | |
12 | #include "LEFontInstance.h" | |
13 | #include "LayoutEngine.h" | |
14 | #include "OpenTypeLayoutEngine.h" | |
15 | ||
16 | #include "GlyphSubstitutionTables.h" | |
17 | ||
18 | U_NAMESPACE_BEGIN | |
19 | ||
374ca955 A |
20 | class LEGlyphStorage; |
21 | ||
b75a7d8f A |
22 | /** |
23 | * This class implements OpenType layout for Han fonts. It overrides | |
24 | * the characerProcessing method to assign the correct OpenType feature | |
25 | * tags for the CJK language-specific forms. | |
26 | * | |
27 | * @internal | |
28 | */ | |
29 | class HanOpenTypeLayoutEngine : public OpenTypeLayoutEngine | |
30 | { | |
31 | public: | |
32 | /** | |
33 | * This is the main constructor. It constructs an instance of HanOpenTypeLayoutEngine for | |
34 | * a particular font, script and language. It takes the GSUB table as a parameter since | |
35 | * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has a | |
36 | * Han OpenType font. | |
37 | * | |
38 | * @param fontInstance - the font | |
39 | * @param scriptCode - the script | |
40 | * @param langaugeCode - the language | |
41 | * @param gsubTable - the GSUB table | |
729e4ab9 | 42 | * @param success - set to an error code if the operation fails |
b75a7d8f A |
43 | * |
44 | * @see LayoutEngine::layoutEngineFactory | |
45 | * @see OpenTypeLayoutEngine | |
46 | * @see ScriptAndLangaugeTags.h for script and language codes | |
47 | * | |
48 | * @internal | |
49 | */ | |
50 | HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, | |
729e4ab9 | 51 | le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTablem, LEErrorCode &success); |
b75a7d8f A |
52 | |
53 | ||
54 | /** | |
55 | * The destructor, virtual for correct polymorphic invocation. | |
56 | * | |
57 | * @internal | |
58 | */ | |
59 | virtual ~HanOpenTypeLayoutEngine(); | |
60 | ||
61 | /** | |
62 | * ICU "poor man's RTTI", returns a UClassID for the actual class. | |
63 | * | |
374ca955 | 64 | * @stable ICU 2.8 |
b75a7d8f | 65 | */ |
374ca955 | 66 | virtual UClassID getDynamicClassID() const; |
b75a7d8f A |
67 | |
68 | /** | |
69 | * ICU "poor man's RTTI", returns a UClassID for this class. | |
70 | * | |
374ca955 | 71 | * @stable ICU 2.8 |
b75a7d8f | 72 | */ |
374ca955 | 73 | static UClassID getStaticClassID(); |
b75a7d8f A |
74 | |
75 | protected: | |
76 | ||
77 | /** | |
78 | * This method does Han OpenType character processing. It assigns the OpenType feature | |
79 | * tags to the characters to generate the correct language-specific variants. | |
80 | * | |
81 | * Input parameters: | |
82 | * @param chars - the input character context | |
83 | * @param offset - the index of the first character to process | |
84 | * @param count - the number of characters to process | |
85 | * @param max - the number of characters in the input context | |
374ca955 A |
86 | * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run |
87 | * @param glyphStorage - the object holding the glyph storage. The char index and auxillary data arrays will be set. | |
b75a7d8f A |
88 | * |
89 | * Output parameters: | |
90 | * @param outChars - the output character arrayt | |
91 | * @param charIndices - the output character index array | |
92 | * @param featureTags - the output feature tag array | |
93 | * @param success - set to an error code if the operation fails | |
94 | * | |
95 | * @return the output character count | |
96 | * | |
97 | * @internal | |
98 | */ | |
99 | virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, | |
374ca955 | 100 | LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success); |
b75a7d8f | 101 | |
b75a7d8f A |
102 | }; |
103 | ||
104 | U_NAMESPACE_END | |
105 | #endif |