/*
*
- * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
*
*/
/*
shaping array holds types for Arabic chars between 0610 and 0700
other values are either unshaped, or transparent if a mark or format
- code, except for format codes 200c (zero-width non-joiner) and 200d
+ code, except for format codes 200c (zero-width non-joiner) and 200d
(dual-width joiner) which are both unshaped and non_joining or
dual-joining, respectively.
*/
ArabicShaping::ShapeType ArabicShaping::getShapeType(LEUnicode c)
{
- const ClassDefinitionTable *joiningTypes = (const ClassDefinitionTable *) ArabicShaping::shapingTypeTable;
- le_int32 joiningType = joiningTypes->getGlyphClass(c);
+ LEErrorCode success = LE_NO_ERROR;
+ const LEReferenceTo<ClassDefinitionTable> joiningTypes((const ClassDefinitionTable *) ArabicShaping::shapingTypeTable,
+ ArabicShaping::shapingTypeTableLen);
+ le_int32 joiningType = joiningTypes->getGlyphClass(joiningTypes, c, success);
- if (joiningType >= 0 && joiningType < ArabicShaping::JT_COUNT) {
- return ArabicShaping::shapeTypes[joiningType];
- }
+ if (joiningType >= 0 && joiningType < ArabicShaping::JT_COUNT && LE_SUCCESS(success)) {
+ return ArabicShaping::shapeTypes[joiningType];
+ }
- return ArabicShaping::ST_NOSHAPE_NONE;
+ return ArabicShaping::ST_NOSHAPE_NONE;
}
#define isolFeatureTag LE_ISOL_FEATURE_TAG
#define markFeatureMask 0x00040000UL
#define mkmkFeatureMask 0x00020000UL
+#define NO_FEATURES 0
#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
#define SHAPE_MASK 0xF0000000UL
le_bool rightToLeft, LEGlyphStorage &glyphStorage)
{
// iterate in logical order, store tags in visible order
- //
- // the effective right char is the most recently encountered
+ //
+ // the effective right char is the most recently encountered
// non-transparent char
//
// four boolean states:
// the effective right char causes left shaping
// the current char shapes
// the current char causes right shaping
- //
+ //
// if both cause shaping, then
// shaper.shape(errout, 2) (isolate to initial, or final to medial)
// shaper.shape(out, 1) (isolate to final)
for (i = offset - 1; i >= 0; i -= 1) {
rightType = getShapeType(chars[i]);
-
+
if (rightType != ST_TRANSPARENT) {
break;
}
LEUnicode c = chars[in];
ShapeType t = getShapeType(c);
- glyphStorage.setAuxData(out, ISOL_FEATURES, success);
+ if (t == ST_NOSHAPE_NONE) {
+ glyphStorage.setAuxData(out, NO_FEATURES, success);
+ } else {
+ glyphStorage.setAuxData(out, ISOL_FEATURES, success);
+ }
if ((t & MASK_TRANSPARENT) != 0) {
continue;