3 * HanLayoutEngine.h: OpenType processing for Han fonts.
5 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved.
8 #ifndef __HANLAYOUTENGINE_H
9 #define __HANLAYOUTENGINE_H
12 #include "LEFontInstance.h"
13 #include "LayoutEngine.h"
14 #include "OpenTypeLayoutEngine.h"
16 #include "GlyphSubstitutionTables.h"
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.
29 class HanOpenTypeLayoutEngine
: public OpenTypeLayoutEngine
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
38 * @param fontInstance - the font
39 * @param scriptCode - the script
40 * @param langaugeCode - the language
41 * @param gsubTable - the GSUB table
43 * @see LayoutEngine::layoutEngineFactory
44 * @see OpenTypeLayoutEngine
45 * @see ScriptAndLangaugeTags.h for script and language codes
49 HanOpenTypeLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
,
50 const GlyphSubstitutionTableHeader
*gsubTable
);
54 * The destructor, virtual for correct polymorphic invocation.
58 virtual ~HanOpenTypeLayoutEngine();
61 * ICU "poor man's RTTI", returns a UClassID for the actual class.
65 virtual UClassID
getDynamicClassID() const;
68 * ICU "poor man's RTTI", returns a UClassID for this class.
72 static UClassID
getStaticClassID();
77 * This method does Han OpenType character processing. It assigns the OpenType feature
78 * tags to the characters to generate the correct language-specific variants.
81 * @param chars - the input character context
82 * @param offset - the index of the first character to process
83 * @param count - the number of characters to process
84 * @param max - the number of characters in the input context
85 * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
86 * @param glyphStorage - the object holding the glyph storage. The char index and auxillary data arrays will be set.
89 * @param outChars - the output character arrayt
90 * @param charIndices - the output character index array
91 * @param featureTags - the output feature tag array
92 * @param success - set to an error code if the operation fails
94 * @return the output character count
98 virtual le_int32
characterProcessing(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
,
99 LEUnicode
*&outChars
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);