]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/layout/OpenTypeLayoutEngine.h
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / layout / OpenTypeLayoutEngine.h
index 16add0242b4ec26769b718bc2f6a68c9772c0f26..0f93ccb9d701b8467fdcb5ae50d4aa45708ac4c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
  *
  */
 
@@ -10,6 +10,7 @@
 #include "LEGlyphFilter.h"
 #include "LEFontInstance.h"
 #include "LayoutEngine.h"
+#include "LETableReference.h"
 
 #include "GlyphSubstitutionTables.h"
 #include "GlyphDefinitionTables.h"
@@ -55,6 +56,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
@@ -62,7 +64,7 @@ public:
      * @internal
      */
     OpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
-                            le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable);
+                            le_int32 typoFlags, const LEReferenceTo<GlyphSubstitutionTableHeader> &gsubTable, LEErrorCode &success);
 
     /**
      * This constructor is used when the font requires a "canned" GSUB table which can't be known
@@ -71,11 +73,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,
-                        le_int32 typoFlags);
+                        le_int32 typoFlags, LEErrorCode &success);
 
     /**
      * The destructor, virtual for correct polymorphic invocation.
@@ -87,6 +90,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
      *
@@ -95,6 +100,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
@@ -111,14 +129,14 @@ public:
     /**
      * ICU "poor man's RTTI", returns a UClassID for the actual class.
      *
-     * @stable ICU 2.8
+     * @deprecated ICU 54. See {@link icu::LayoutEngine}
      */
     virtual UClassID getDynamicClassID() const;
 
     /**
      * ICU "poor man's RTTI", returns a UClassID for this class.
      *
-     * @stable ICU 2.8
+     * @deprecated ICU 54. See {@link icu::LayoutEngine}
      */
     static UClassID getStaticClassID();
 
@@ -142,6 +160,11 @@ private:
      */
     static const LETag scriptTags[];
 
+    /**
+     * apply the typoflags. Only called by the c'tors.
+     */
+    void applyTypoFlags();
+
 protected:
     /**
      * A set of "default" features. The default characterProcessing method
@@ -181,22 +204,22 @@ protected:
      *
      * @internal
      */
-    const GlyphSubstitutionTableHeader *fGSUBTable;
+    LEReferenceTo<GlyphSubstitutionTableHeader> fGSUBTable;
 
     /**
      * The address of the GDEF table.
      *
      * @internal
      */
-    const GlyphDefinitionTableHeader   *fGDEFTable;
+    LEReferenceTo<GlyphDefinitionTableHeader> fGDEFTable;
 
     /**
      * The address of the GPOS table.
      *
      * @internal
      */
-    const GlyphPositioningTableHeader  *fGPOSTable;
-
+    LEReferenceTo<GlyphPositioningTableHeader> fGPOSTable;
+    
     /**
      * An optional filter used to inhibit substitutions
      * preformed by the GSUB table. This is used for some
@@ -213,6 +236,13 @@ protected:
      * @internal
      */
     LETag fScriptTag;
+  
+    /**
+     * The four byte script tag for V2 fonts.
+     *
+     * @internal
+     */
+    LETag fScriptTagV2;
 
     /**
      * The four byte language tag
@@ -280,6 +310,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"