ICU-4172 reorder Hebrew marks.

X-SVN-Rev: 17351
This commit is contained in:
Eric Mader 2005-03-17 02:14:54 +00:00
parent 325fed34dd
commit be687a5753
2 changed files with 23 additions and 2 deletions

View File

@ -84,7 +84,7 @@ le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[]
CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, outChars, glyphStorage);
// Note: This process the *original* character array so we can get context
// Note: This processes the *original* character array so we can get context
// for the first and last characters. This is OK because only the marks
// will have been reordered, and they don't contribute to shaping.
ArabicShaping::shape(chars, offset, count, max, rightToLeft, glyphStorage);

View File

@ -179,6 +179,23 @@ le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 off
if (canonGSUBTable->coversScript(scriptTag)) {
CharSubstitutionFilter *substitutionFilter = new CharSubstitutionFilter(fFontInstance);
const LEUnicode *inChars = &chars[offset];
LEUnicode *reordered = NULL;
// 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, glyphStorage);
inChars = reordered;
}
glyphStorage.allocateGlyphArray(count, rightToLeft, success);
glyphStorage.allocateAuxData(success);
@ -193,10 +210,14 @@ le_int32 LayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 off
}
for (i = 0; i < count; i += 1, out += dir) {
glyphStorage[out] = (LEGlyphID) chars[offset + i];
glyphStorage[out] = (LEGlyphID) inChars[i];
glyphStorage.setAuxData(out, (void *) canonFeatures, success);
}
if (reordered != NULL) {
LE_DELETE_ARRAY(reordered);
}
outCharCount = canonGSUBTable->process(glyphStorage, rightToLeft, scriptTag, langSysTag, NULL, substitutionFilter, NULL);
out = (rightToLeft? count - 1 : 0);