X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..4d9eefca008a7bc544144ef830fa144ce89deaa0:/icuSources/layout/OpenTypeLayoutEngine.h diff --git a/icuSources/layout/OpenTypeLayoutEngine.h b/icuSources/layout/OpenTypeLayoutEngine.h index 61cf1317..4de80569 100644 --- a/icuSources/layout/OpenTypeLayoutEngine.h +++ b/icuSources/layout/OpenTypeLayoutEngine.h @@ -1,8 +1,5 @@ - /* - * %W% %E% - * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved * */ @@ -45,7 +42,7 @@ U_NAMESPACE_BEGIN * * @internal */ -class OpenTypeLayoutEngine : public LayoutEngine +class U_LAYOUT_API OpenTypeLayoutEngine : public LayoutEngine { public: /** @@ -58,6 +55,7 @@ public: * @param scriptCode - the script * @param langaugeCode - the language * @param gsubTable - the GSUB table + * @param success - set to an error code if the operation fails * * @see LayoutEngine::layoutEngineFactory * @see ScriptAndLangaugeTags.h for script and language codes @@ -65,7 +63,7 @@ public: * @internal */ OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, - const GlyphSubstitutionTableHeader *gsubTable); + le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable, LEErrorCode &success); /** * This constructor is used when the font requires a "canned" GSUB table which can't be known @@ -74,10 +72,12 @@ public: * @param fontInstance - the font * @param scriptCode - the script * @param langaugeCode - the language + * @param success - set to an error code if the operation fails * * @internal */ - OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode); + OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, + le_int32 typoFlags, LEErrorCode &success); /** * The destructor, virtual for correct polymorphic invocation. @@ -89,6 +89,8 @@ public: /** * A convenience method used to convert the script code into * the four byte script tag required by OpenType. + * For Indic languages where multiple script tags exist, + * the version 1 (old style) tag is returned. * * @param scriptCode - the script code * @@ -97,6 +99,19 @@ public: * @internal */ static LETag getScriptTag(le_int32 scriptCode); + /** + * A convenience method used to convert the script code into + * the four byte script tag required by OpenType. + * For Indic languages where multiple script tags exist, + * the version 2 tag is returned. + * + * @param scriptCode - the script code + * + * @return the four byte script tag + * + * @internal + */ + static LETag getV2ScriptTag(le_int32 scriptCode); /** * A convenience method used to convert the langauge code into @@ -124,6 +139,13 @@ public: */ static UClassID getStaticClassID(); + /** + * The array of language tags, indexed by language code. + * + * @internal + */ + static const LETag languageTags[]; + private: /** @@ -137,28 +159,39 @@ private: */ static const LETag scriptTags[]; +protected: /** - * The array of language tags, indexed by language code. + * A set of "default" features. The default characterProcessing method + * will apply all of these features to every glyph. + * + * @internal */ - static const LETag languageTags[]; + FeatureMask fFeatureMask; -protected: /** - * A list of "default" features. The default characterProcessing method - * will apply all of these tags to every glyph. + * A set of mappings from feature tags to feature masks. These may + * be in the order in which the featues should be applied, but they + * don't need to be. * * @internal */ - const LETag *fFeatureList; + const FeatureMap *fFeatureMap; /** - * A list of tags in the order in which the features in - * the font should be applied, as opposed to using the - * order of the lookups in the font. + * The length of the feature map. * * @internal */ - const LETag *fFeatureOrder; + le_int32 fFeatureMapCount; + + /** + * TRUE if the features in the + * feature map are in the order in which they + * must be applied. + * + * @internal + */ + le_bool fFeatureOrder; /** * The address of the GSUB table. @@ -197,6 +230,13 @@ protected: * @internal */ LETag fScriptTag; + + /** + * The four byte script tag for V2 fonts. + * + * @internal + */ + LETag fScriptTagV2; /** * The four byte language tag @@ -264,6 +304,8 @@ protected: */ virtual le_int32 glyphProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); + + virtual le_int32 glyphSubstitution(le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success); /** * This method does any processing necessary to convert "fake"