3 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved
7 #ifndef __THAISHAPING_H
8 #define __THAISHAPING_H
16 #include "LEGlyphFilter.h"
17 #include "OpenTypeTables.h"
23 class ThaiShaping
/* not : public UObject because all methods are static */ {
49 // State Transition actions
61 struct StateTransition
66 le_uint8
getNextState() { return nextState
; };
67 le_uint8
getAction() { return action
; };
70 static le_int32
compose(const LEUnicode
*input
, le_int32 offset
, le_int32 charCount
, le_uint8 glyphSet
,
71 LEUnicode errorChar
, LEUnicode
*output
, LEGlyphStorage
&glyphStorage
);
74 // forbid instantiation
77 static const le_uint8 classTable
[];
78 static const StateTransition thaiStateTable
[][classCount
];
80 static StateTransition
getTransition(le_uint8 state
, le_uint8 currClass
);
81 static le_uint8
doTransition(StateTransition transition
, LEUnicode currChar
, le_int32 inputIndex
, le_uint8 glyphSet
,
82 LEUnicode errorChar
, LEUnicode
*outputBuffer
, LEGlyphStorage
&glyphStorage
, le_int32
&outputIndex
);
84 static le_uint8
getNextState(LEUnicode ch
, le_uint8 state
, le_int32 inputIndex
, le_uint8 glyphSet
, LEUnicode errorChar
,
85 le_uint8
&charClass
, LEUnicode
*output
, LEGlyphStorage
&glyphStorage
, le_int32
&outputIndex
);
87 static le_bool
isLegalHere(LEUnicode ch
, le_uint8 prevState
);
88 static le_uint8
getCharClass(LEUnicode ch
);
90 static LEUnicode
noDescenderCOD(LEUnicode cod
, le_uint8 glyphSet
);
91 static LEUnicode
leftAboveVowel(LEUnicode vowel
, le_uint8 glyphSet
);
92 static LEUnicode
lowerBelowVowel(LEUnicode vowel
, le_uint8 glyphSet
);
93 static LEUnicode
lowerRightTone(LEUnicode tone
, le_uint8 glyphSet
);
94 static LEUnicode
lowerLeftTone(LEUnicode tone
, le_uint8 glyphSet
);
95 static LEUnicode
upperLeftTone(LEUnicode tone
, le_uint8 glyphSet
);
99 inline ThaiShaping::StateTransition
ThaiShaping::getTransition(le_uint8 state
, le_uint8 currClass
)
101 return thaiStateTable
[state
][currClass
];