4 * (C) Copyright IBM Corp. 1998-2006 - All Rights Reserved
8 #ifndef __HANGULAYOUTENGINE_H
9 #define __HANGULAYOUTENGINE_H
12 #include "LEFontInstance.h"
13 #include "LEGlyphFilter.h"
14 #include "LayoutEngine.h"
15 #include "OpenTypeLayoutEngine.h"
17 #include "GlyphSubstitutionTables.h"
18 #include "GlyphDefinitionTables.h"
19 #include "GlyphPositioningTables.h"
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)
31 * This class overrides the characterProcessing method to do Hangul character processing.
32 * (See the MS spec. for more details)
36 class HangulOpenTypeLayoutEngine
: public OpenTypeLayoutEngine
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.
45 * @param fontInstance - the font
46 * @param scriptCode - the script
47 * @param langaugeCode - the language
48 * @param gsubTable - the GSUB table
50 * @see LayoutEngine::layoutEngineFactory
51 * @see OpenTypeLayoutEngine
52 * @see ScriptAndLangaugeTags.h for script and language codes
56 HangulOpenTypeLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
,
57 le_int32 typoFlags
, const GlyphSubstitutionTableHeader
*gsubTable
);
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.
63 * @param fontInstance - the font
64 * @param scriptCode - the script
65 * @param langaugeCode - the language
67 * @see OpenTypeLayoutEngine
68 * @see ScriptAndLangaugeTags.h for script and language codes
72 HangulOpenTypeLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
,
76 * The destructor, virtual for correct polymorphic invocation.
80 virtual ~HangulOpenTypeLayoutEngine();
83 * ICU "poor man's RTTI", returns a UClassID for the actual class.
87 virtual UClassID
getDynamicClassID() const;
90 * ICU "poor man's RTTI", returns a UClassID for this class.
94 static UClassID
getStaticClassID();
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.
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.
113 * @param success - set to an error code if the operation fails
115 * @return the output character count
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
);