4
* (C) Copyright IBM Corp. 1998, 1999, 2000, 2001 - All Rights Reserved
10
#include "LayoutTables.h"
11
#include "MorphTables.h"
12
#include "SubtableProcessor.h"
13
#include "IndicRearrangementProcessor.h"
14
#include "ContextualGlyphSubstProc.h"
15
#include "LigatureSubstProc.h"
16
#include "NonContextualGlyphSubstProc.h"
17
//#include "ContextualGlyphInsertionProcessor.h"
22
void MorphTableHeader::process(LEGlyphID *glyphs, le_int32 *glyphIndices, le_int32 glyphCount) const
24
const ChainHeader *chainHeader = chains;
25
le_uint32 chainCount = SWAPL(this->nChains);
28
for (chain = 0; chain < chainCount; chain += 1) {
29
FeatureFlags defaultFlags = SWAPL(chainHeader->defaultFlags);
30
le_uint32 chainLength = SWAPL(chainHeader->chainLength);
31
le_int16 nFeatureEntries = SWAPW(chainHeader->nFeatureEntries);
32
le_int16 nSubtables = SWAPW(chainHeader->nSubtables);
33
const MorphSubtableHeader *subtableHeader =
34
(const MorphSubtableHeader *)&chainHeader->featureTable[nFeatureEntries];
37
for (subtable = 0; subtable < nSubtables; subtable += 1) {
38
le_int16 length = SWAPW(subtableHeader->length);
39
SubtableCoverage coverage = SWAPW(subtableHeader->coverage);
40
FeatureFlags subtableFeatures = SWAPL(subtableHeader->subtableFeatures);
42
// should check coverage more carefully...
43
if ((coverage & scfVertical) == 0 && (subtableFeatures & defaultFlags) != 0) {
44
subtableHeader->process(glyphs, glyphIndices, glyphCount);
47
subtableHeader = (const MorphSubtableHeader *) ((char *)subtableHeader + length);
50
chainHeader = (const ChainHeader *)((char *)chainHeader + chainLength);
54
void MorphSubtableHeader::process(LEGlyphID *glyphs, le_int32 *glyphIndices, le_int32 glyphCount) const
56
SubtableProcessor *processor = NULL;
58
switch (SWAPW(coverage) & scfTypeMask)
60
case mstIndicRearrangement:
61
processor = new IndicRearrangementProcessor(this);
64
case mstContextualGlyphSubstitution:
65
processor = new ContextualGlyphSubstitutionProcessor(this);
68
case mstLigatureSubstitution:
69
processor = new LigatureSubstitutionProcessor(this);
72
case mstReservedUnused:
75
case mstNonContextualGlyphSubstitution:
76
processor = NonContextualGlyphSubstitutionProcessor::createInstance(this);
80
case mstContextualGlyphInsertion:
81
processor = new ContextualGlyphInsertionProcessor(this);
89
if (processor != NULL) {
90
processor->process(glyphs, glyphIndices, glyphCount);