Logo Search packages:      
Sourcecode: icu version File versions  Download package

le_int32 IndicOpenTypeLayoutEngine::characterProcessing ( const LEUnicode  chars[],
le_int32  offset,
le_int32  count,
le_int32  max,
le_bool  rightToLeft,
LEUnicode *&  outChars,
LEGlyphStorage glyphStorage,
LEErrorCode success 
) [protected, virtual]

This method does Indic OpenType character processing. It assigns the OpenType feature tags to the characters, and may generate output characters which have been reordered. For some Indic scripts, it may also split some vowels, resulting in more output characters than input characters.

Input parameters:

Parameters:
chars - the input character context
offset - the index of the first character to process
count - the number of characters to process
max - the number of characters in the input context
rightToLeft - TRUE if the characters are in a right to left directional run
glyphStorage - the glyph storage object. The glyph and character index arrays will be set. the auxillary data array will be set to the feature tags.
Output parameters:
Parameters:
success - set to an error code if the operation fails
Returns:
the output character count

For internal use only.

Reimplemented from OpenTypeLayoutEngine.

Definition at line 87 of file IndicLayoutEngine.cpp.

References LEGlyphStorage::adoptGlyphCount(), LEGlyphStorage::allocateAuxData(), LEGlyphStorage::allocateGlyphArray(), LayoutEngine::fScriptCode, LE_FAILURE, LE_ILLEGAL_ARGUMENT_ERROR, LE_MEMORY_ALLOCATION_ERROR, and NULL.

{
    if (LE_FAILURE(success)) {
        return 0;
    }

    if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
        success = LE_ILLEGAL_ARGUMENT_ERROR;
        return 0;
    }

    le_int32 worstCase = count * IndicReordering::getWorstCaseExpansion(fScriptCode);

    outChars = LE_NEW_ARRAY(LEUnicode, worstCase);

    if (outChars == NULL) {
        success = LE_MEMORY_ALLOCATION_ERROR;
        return 0;
    }

    glyphStorage.allocateGlyphArray(worstCase, rightToLeft, success);
    glyphStorage.allocateAuxData(success);

    if (LE_FAILURE(success)) {
        LE_DELETE_ARRAY(outChars);
        return 0;
    }

    // NOTE: assumes this allocates featureTags...
    // (probably better than doing the worst case stuff here...)

    le_int32 outCharCount;
    if (fVersion2) {
        outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage);
    } else {
        outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success);
    }

    if (LE_FAILURE(success)) {
        LE_DELETE_ARRAY(outChars);
        return 0;
    }

    glyphStorage.adoptGlyphCount(outCharCount);
    return outCharCount;
}


Generated by  Doxygen 1.6.0   Back to index