~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/layout/SubstitutionLookups.cpp

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * @(#)SubstitutionLookups.cpp  1.6 00/03/15
3
 
 *
4
 
 * (C) Copyright IBM Corp. 1998, 1999, 2000 - All Rights Reserved
5
 
 *
6
 
 */
7
 
 
8
 
#include "LETypes.h"
9
 
#include "LEFontInstance.h"
10
 
#include "OpenTypeTables.h"
11
 
#include "GlyphSubstitutionTables.h"
12
 
#include "GlyphIterator.h"
13
 
#include "LookupProcessor.h"
14
 
#include "SubstitutionLookups.h"
15
 
#include "CoverageTables.h"
16
 
#include "LESwaps.h"
17
 
 
18
 
U_NAMESPACE_BEGIN
19
 
 
20
 
/*
21
 
    NOTE: This could be optimized somewhat by keeping track
22
 
    of the previous sequenceIndex in the loop and doing next()
23
 
    or prev() of the delta between that and the current
24
 
    sequenceIndex instead of always resetting to the front.
25
 
*/
26
 
void SubstitutionLookup::applySubstitutionLookups(
27
 
        LookupProcessor *lookupProcessor,
28
 
        SubstitutionLookupRecord *substLookupRecordArray,
29
 
        le_uint16 substCount,
30
 
        GlyphIterator *glyphIterator,
31
 
        const LEFontInstance *fontInstance,
32
 
        le_int32 position)
33
 
{
34
 
    GlyphIterator tempIterator(*glyphIterator);
35
 
 
36
 
    for (le_uint16 subst = 0; subst < substCount; subst += 1) {
37
 
        le_uint16 sequenceIndex = SWAPW(substLookupRecordArray[subst].sequenceIndex);
38
 
        le_uint16 lookupListIndex = SWAPW(substLookupRecordArray[subst].lookupListIndex);
39
 
 
40
 
        tempIterator.setCurrStreamPosition(position);
41
 
        tempIterator.next(sequenceIndex);
42
 
 
43
 
        lookupProcessor->applySingleLookup(lookupListIndex, &tempIterator, fontInstance);
44
 
    }
45
 
}
46
 
 
47
 
U_NAMESPACE_END