/*
*
- * (C) Copyright IBM Corp. 1998-2008 - 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
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;
}