/*
*
- * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*
*/
#define CF_BELOW_BASE 0x10000000U
#define CF_POST_BASE 0x08000000U
#define CF_LENGTH_MARK 0x04000000U
+#define CF_PRE_BASE 0x02000000U
#define CF_POS_BEFORE 0x00300000U
#define CF_POS_BELOW 0x00200000U
#define SF_POST_BASE_LIMIT_MASK 0x0000FFFFU
#define SF_NO_POST_BASE_LIMIT 0x00007FFFU
-typedef LEUnicode SplitMatra[3];
+#define SM_MAX_PIECES 3
+
+typedef LEUnicode SplitMatra[SM_MAX_PIECES];
class MPreFixups;
class LEGlyphStorage;
+// Dynamic Properties ( v2 fonts only )
+typedef le_uint32 DynamicProperties;
+
+#define DP_REPH 0x80000000U
+#define DP_HALF 0x40000000U
+#define DP_PREF 0x20000000U
+#define DP_BLWF 0x10000000U
+#define DP_PSTF 0x08000000U
+
struct IndicClassTable
{
typedef le_uint32 CharClass;
typedef le_uint32 ScriptFlags;
-
+
LEUnicode firstChar;
LEUnicode lastChar;
le_int32 worstCaseExpansion;
inline le_bool hasPostOrBelowBaseForm(LEUnicode ch) const;
inline le_bool hasPostBaseForm(LEUnicode ch) const;
inline le_bool hasBelowBaseForm(LEUnicode ch) const;
+ inline le_bool hasAboveBaseForm(LEUnicode ch) const;
+ inline le_bool hasPreBaseForm(LEUnicode ch) const;
inline static le_bool isVowelModifier(CharClass charClass);
inline static le_bool isStressMark(CharClass charClass);
inline static le_bool hasPostOrBelowBaseForm(CharClass charClass);
inline static le_bool hasPostBaseForm(CharClass charClass);
inline static le_bool hasBelowBaseForm(CharClass charClass);
+ inline static le_bool hasAboveBaseForm(CharClass charClass);
+ inline static le_bool hasPreBaseForm(CharClass charClass);
static const IndicClassTable *getScriptClassTable(le_int32 scriptCode);
};
static le_int32 reorder(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode,
LEUnicode *outChars, LEGlyphStorage &glyphStorage,
- MPreFixups **outMPreFixups);
+ MPreFixups **outMPreFixups, LEErrorCode& success);
+
+ static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success);
- static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage);
+ static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode,
+ LEUnicode *outChars, LEGlyphStorage &glyphStorage);
static const FeatureMap *getFeatureMap(le_int32 &count);
+ static const FeatureMap *getv2FeatureMap(le_int32 &count);
+
+ static void applyPresentationForms(LEGlyphStorage &glyphStorage, le_int32 count);
+
+ static void finalReordering(LEGlyphStorage &glyphStorage, le_int32 count);
+
+ static void getDynamicProperties(DynamicProperties *dProps, const IndicClassTable *classTable);
+
private:
// do not instantiate
IndicReordering();
return (charClass & CF_POST_BASE) != 0;
}
+inline le_bool IndicClassTable::hasPreBaseForm(CharClass charClass)
+{
+ return (charClass & CF_PRE_BASE) != 0;
+}
+
inline le_bool IndicClassTable::hasBelowBaseForm(CharClass charClass)
{
return (charClass & CF_BELOW_BASE) != 0;
}
+inline le_bool IndicClassTable::hasAboveBaseForm(CharClass charClass)
+{
+ return ((charClass & CF_POS_MASK) == CF_POS_ABOVE);
+}
+
inline le_bool IndicClassTable::isVowelModifier(LEUnicode ch) const
{
return isVowelModifier(getCharClass(ch));
return hasBelowBaseForm(getCharClass(ch));
}
+inline le_bool IndicClassTable::hasPreBaseForm(LEUnicode ch) const
+{
+ return hasPreBaseForm(getCharClass(ch));
+}
+
+inline le_bool IndicClassTable::hasAboveBaseForm(LEUnicode ch) const
+{
+ return hasAboveBaseForm(getCharClass(ch));
+}
U_NAMESPACE_END
#endif