+ const LEUnicode *inChars = &chars[offset];
+ LEUnicode *reordered = NULL;
+ LEGlyphStorage fakeGlyphStorage;
+
+ fakeGlyphStorage.allocateGlyphArray(count, rightToLeft, success);
+
+ if (LE_FAILURE(success)) {
+ return 0;
+ }
+
+ // This is the cheapest way to get mark reordering only for Hebrew.
+ // We could just do the mark reordering for all scripts, but most
+ // of them probably don't need it...
+ if (fScriptCode == hebrScriptCode) {
+ reordered = LE_NEW_ARRAY(LEUnicode, count);
+
+ if (reordered == NULL) {
+ success = LE_MEMORY_ALLOCATION_ERROR;
+ return 0;
+ }
+
+ CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, reordered, fakeGlyphStorage);
+ inChars = reordered;
+ }