1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/IcuSource/layout/HanLayoutEngine.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,104 @@
1.4 +
1.5 +/*
1.6 + * HanLayoutEngine.h: OpenType processing for Han fonts.
1.7 + *
1.8 + * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved.
1.9 + */
1.10 +
1.11 +#ifndef __HANLAYOUTENGINE_H
1.12 +#define __HANLAYOUTENGINE_H
1.13 +
1.14 +#include "LETypes.h"
1.15 +#include "LEFontInstance.h"
1.16 +#include "LayoutEngine.h"
1.17 +#include "OpenTypeLayoutEngine.h"
1.18 +
1.19 +#include "GlyphSubstitutionTables.h"
1.20 +
1.21 +U_NAMESPACE_BEGIN
1.22 +
1.23 +class LEGlyphStorage;
1.24 +
1.25 +/**
1.26 + * This class implements OpenType layout for Han fonts. It overrides
1.27 + * the characerProcessing method to assign the correct OpenType feature
1.28 + * tags for the CJK language-specific forms.
1.29 + *
1.30 + * @internal
1.31 + */
1.32 +class HanOpenTypeLayoutEngine : public OpenTypeLayoutEngine
1.33 +{
1.34 +public:
1.35 + /**
1.36 + * This is the main constructor. It constructs an instance of HanOpenTypeLayoutEngine for
1.37 + * a particular font, script and language. It takes the GSUB table as a parameter since
1.38 + * LayoutEngine::layoutEngineFactory has to read the GSUB table to know that it has a
1.39 + * Han OpenType font.
1.40 + *
1.41 + * @param fontInstance - the font
1.42 + * @param scriptCode - the script
1.43 + * @param langaugeCode - the language
1.44 + * @param gsubTable - the GSUB table
1.45 + *
1.46 + * @see LayoutEngine::layoutEngineFactory
1.47 + * @see OpenTypeLayoutEngine
1.48 + * @see ScriptAndLangaugeTags.h for script and language codes
1.49 + *
1.50 + * @internal
1.51 + */
1.52 + HanOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
1.53 + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable);
1.54 +
1.55 +
1.56 + /**
1.57 + * The destructor, virtual for correct polymorphic invocation.
1.58 + *
1.59 + * @internal
1.60 + */
1.61 + virtual ~HanOpenTypeLayoutEngine();
1.62 +
1.63 + /**
1.64 + * ICU "poor man's RTTI", returns a UClassID for the actual class.
1.65 + *
1.66 + * @stable ICU 2.8
1.67 + */
1.68 + virtual UClassID getDynamicClassID() const;
1.69 +
1.70 + /**
1.71 + * ICU "poor man's RTTI", returns a UClassID for this class.
1.72 + *
1.73 + * @stable ICU 2.8
1.74 + */
1.75 + static UClassID getStaticClassID();
1.76 +
1.77 +protected:
1.78 +
1.79 + /**
1.80 + * This method does Han OpenType character processing. It assigns the OpenType feature
1.81 + * tags to the characters to generate the correct language-specific variants.
1.82 + *
1.83 + * Input parameters:
1.84 + * @param chars - the input character context
1.85 + * @param offset - the index of the first character to process
1.86 + * @param count - the number of characters to process
1.87 + * @param max - the number of characters in the input context
1.88 + * @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
1.89 + * @param glyphStorage - the object holding the glyph storage. The char index and auxillary data arrays will be set.
1.90 + *
1.91 + * Output parameters:
1.92 + * @param outChars - the output character arrayt
1.93 + * @param charIndices - the output character index array
1.94 + * @param featureTags - the output feature tag array
1.95 + * @param success - set to an error code if the operation fails
1.96 + *
1.97 + * @return the output character count
1.98 + *
1.99 + * @internal
1.100 + */
1.101 + virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
1.102 + LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
1.103 +
1.104 +};
1.105 +
1.106 +U_NAMESPACE_END
1.107 +#endif