4  * (C) Copyright IBM Corp. 1998-2008 - 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 
  49      * @param success - set to an error code if the operation fails 
  51      * @see LayoutEngine::layoutEngineFactory 
  52      * @see OpenTypeLayoutEngine 
  53      * @see ScriptAndLangaugeTags.h for script and language codes 
  57     HangulOpenTypeLayoutEngine(const LEFontInstance 
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, 
  58                             le_int32 typoFlags
, const GlyphSubstitutionTableHeader 
*gsubTable
, LEErrorCode 
&success
); 
  61      * This constructor is used when the font requires a "canned" GSUB table which can't be known 
  62      * until after this constructor has been invoked. 
  64      * @param fontInstance - the font 
  65      * @param scriptCode - the script 
  66      * @param langaugeCode - the language 
  67      * @param success - set to an error code if the operation fails 
  69      * @see OpenTypeLayoutEngine 
  70      * @see ScriptAndLangaugeTags.h for script and language codes 
  74     HangulOpenTypeLayoutEngine(const LEFontInstance 
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
, 
  75                               le_int32 typoFlags
, LEErrorCode 
&success
); 
  78      * The destructor, virtual for correct polymorphic invocation. 
  82    virtual ~HangulOpenTypeLayoutEngine(); 
  85      * ICU "poor man's RTTI", returns a UClassID for the actual class. 
  89     virtual UClassID 
getDynamicClassID() const; 
  92      * ICU "poor man's RTTI", returns a UClassID for this class. 
  96     static UClassID 
getStaticClassID(); 
 101      * This method does Hangul OpenType character processing. It assigns the OpenType feature 
 102      * tags to the characters, and may compose a character sequence into a modern Hangul syllable, 
 103      * or decompose a modern Hangul syllable if it forms part of an old Hangul syllable. 
 106      * @param chars - the input character context 
 107      * @param offset - the index of the first character to process 
 108      * @param count - the number of characters to process 
 109      * @param max - the number of characters in the input context 
 110      * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run 
 111      * @param glyphStorage - the glyph storage object. The glyph and character index arrays will be set. 
 112      *                       the auxillary data array will be set to the feature tags. 
 115      * @param success - set to an error code if the operation fails 
 117      * @return the output character count 
 121     virtual le_int32 
characterProcessing(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
, 
 122             LEUnicode 
*&outChars
, LEGlyphStorage 
&glyphStorage
, LEErrorCode 
&success
);