]> git.saurik.com Git - apple/icu.git/blob - icuSources/layout/HangulLayoutEngine.h
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / layout / HangulLayoutEngine.h
1
2 /*
3 *
4 * (C) Copyright IBM Corp. 1998-2006 - All Rights Reserved
5 *
6 */
7
8 #ifndef __HANGULAYOUTENGINE_H
9 #define __HANGULAYOUTENGINE_H
10
11 #include "LETypes.h"
12 #include "LEFontInstance.h"
13 #include "LEGlyphFilter.h"
14 #include "LayoutEngine.h"
15 #include "OpenTypeLayoutEngine.h"
16
17 #include "GlyphSubstitutionTables.h"
18 #include "GlyphDefinitionTables.h"
19 #include "GlyphPositioningTables.h"
20
21 U_NAMESPACE_BEGIN
22
23 class MPreFixups;
24 class LEGlyphStorage;
25
26 /**
27 * This class implements OpenType layout for Old Hangul OpenType fonts, as
28 * specified by Microsoft in "Creating and Supporting OpenType Fonts for
29 * The Korean Hangul Script" (http://www.microsoft.com/typography/otfntdev/hangulot/default.htm)
30 *
31 * This class overrides the characterProcessing method to do Hangul character processing.
32 * (See the MS spec. for more details)
33 *
34 * @internal
35 */
36 class HangulOpenTypeLayoutEngine : public OpenTypeLayoutEngine
37 {
38 public:
39 /**
40 * This is the main constructor. It constructs an instance of HangulOpenTypeLayoutEngine for
41 * a particular font, script and language. It takes the GSUB table as a parameter since
42 * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has an
43 * Hangul OpenType font.
44 *
45 * @param fontInstance - the font
46 * @param scriptCode - the script
47 * @param langaugeCode - the language
48 * @param gsubTable - the GSUB table
49 *
50 * @see LayoutEngine::layoutEngineFactory
51 * @see OpenTypeLayoutEngine
52 * @see ScriptAndLangaugeTags.h for script and language codes
53 *
54 * @internal
55 */
56 HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
57 le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable);
58
59 /**
60 * This constructor is used when the font requires a "canned" GSUB table which can't be known
61 * until after this constructor has been invoked.
62 *
63 * @param fontInstance - the font
64 * @param scriptCode - the script
65 * @param langaugeCode - the language
66 *
67 * @see OpenTypeLayoutEngine
68 * @see ScriptAndLangaugeTags.h for script and language codes
69 *
70 * @internal
71 */
72 HangulOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
73 le_int32 typoFlags);
74
75 /**
76 * The destructor, virtual for correct polymorphic invocation.
77 *
78 * @internal
79 */
80 virtual ~HangulOpenTypeLayoutEngine();
81
82 /**
83 * ICU "poor man's RTTI", returns a UClassID for the actual class.
84 *
85 * @stable ICU 2.8
86 */
87 virtual UClassID getDynamicClassID() const;
88
89 /**
90 * ICU "poor man's RTTI", returns a UClassID for this class.
91 *
92 * @stable ICU 2.8
93 */
94 static UClassID getStaticClassID();
95
96 protected:
97
98 /**
99 * This method does Hangul OpenType character processing. It assigns the OpenType feature
100 * tags to the characters, and may compose a character sequence into a modern Hangul syllable,
101 * or decompose a modern Hangul syllable if it forms part of an old Hangul syllable.
102 *
103 * Input parameters:
104 * @param chars - the input character context
105 * @param offset - the index of the first character to process
106 * @param count - the number of characters to process
107 * @param max - the number of characters in the input context
108 * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
109 * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set.
110 * the auxillary data array will be set to the feature tags.
111 *
112 * Output parameters:
113 * @param success - set to an error code if the operation fails
114 *
115 * @return the output character count
116 *
117 * @internal
118 */
119 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
120 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
121 };
122
123 U_NAMESPACE_END
124 #endif
125