3 * HanLayoutEngine.h: OpenType processing for Han fonts.
5 * (C) Copyright IBM Corp. 1998-2014 - 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
42 * @param success - set to an error code if the operation fails
44 * @see LayoutEngine::layoutEngineFactory
45 * @see OpenTypeLayoutEngine
46 * @see ScriptAndLangaugeTags.h for script and language codes
50 HanOpenTypeLayoutEngine(const LEFontInstance
*fontInstance
, le_int32 scriptCode
, le_int32 languageCode
,
51 le_int32 typoFlags
, const LEReferenceTo
<GlyphSubstitutionTableHeader
> &gsubTablem
, LEErrorCode
&success
);
55 * The destructor, virtual for correct polymorphic invocation.
59 virtual ~HanOpenTypeLayoutEngine();
62 * ICU "poor man's RTTI", returns a UClassID for the actual class.
64 * @deprecated ICU 54. See {@link icu::LayoutEngine}
66 virtual UClassID
getDynamicClassID() const;
69 * ICU "poor man's RTTI", returns a UClassID for this class.
71 * @deprecated ICU 54. See {@link icu::LayoutEngine}
73 static UClassID
getStaticClassID();
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.
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
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.
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
95 * @return the output character count
99 virtual le_int32
characterProcessing(const LEUnicode chars
[], le_int32 offset
, le_int32 count
, le_int32 max
, le_bool rightToLeft
,
100 LEUnicode
*&outChars
, LEGlyphStorage
&glyphStorage
, LEErrorCode
&success
);