2000-11-28 20:56:52 +00:00
|
|
|
/*
|
2004-04-12 18:51:31 +00:00
|
|
|
*
|
2005-06-16 22:46:37 +00:00
|
|
|
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
|
2004-04-12 18:51:31 +00:00
|
|
|
*
|
2000-11-28 20:56:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
#include "OpenTypeTables.h"
|
|
|
|
#include "OpenTypeUtilities.h"
|
|
|
|
#include "IndicReordering.h"
|
2004-04-12 18:51:31 +00:00
|
|
|
#include "LEGlyphStorage.h"
|
2003-01-04 02:52:23 +00:00
|
|
|
#include "MPreFixups.h"
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2005-08-08 21:01:27 +00:00
|
|
|
#define initFeatureTag LE_INIT_FEATURE_TAG
|
|
|
|
#define nuktFeatureTag LE_NUKT_FEATURE_TAG
|
|
|
|
#define akhnFeatureTag LE_AKHN_FEATURE_TAG
|
|
|
|
#define rphfFeatureTag LE_RPHF_FEATURE_TAG
|
|
|
|
#define blwfFeatureTag LE_BLWF_FEATURE_TAG
|
|
|
|
#define halfFeatureTag LE_HALF_FEATURE_TAG
|
|
|
|
#define pstfFeatureTag LE_PSTF_FEATURE_TAG
|
|
|
|
#define vatuFeatureTag LE_VATU_FEATURE_TAG
|
|
|
|
#define presFeatureTag LE_PRES_FEATURE_TAG
|
|
|
|
#define blwsFeatureTag LE_BLWS_FEATURE_TAG
|
|
|
|
#define abvsFeatureTag LE_ABVS_FEATURE_TAG
|
|
|
|
#define pstsFeatureTag LE_PSTS_FEATURE_TAG
|
|
|
|
#define halnFeatureTag LE_HALN_FEATURE_TAG
|
|
|
|
|
|
|
|
#define blwmFeatureTag LE_BLWM_FEATURE_TAG
|
|
|
|
#define abvmFeatureTag LE_ABVM_FEATURE_TAG
|
|
|
|
#define distFeatureTag LE_DIST_FEATURE_TAG
|
|
|
|
|
|
|
|
#define rphfFeatureMask 0x80000000U
|
|
|
|
#define blwfFeatureMask 0x40000000U
|
|
|
|
#define halfFeatureMask 0x20000000U
|
|
|
|
#define pstfFeatureMask 0x10000000U
|
|
|
|
#define nuktFeatureMask 0x08000000U
|
|
|
|
#define akhnFeatureMask 0x04000000U
|
|
|
|
#define vatuFeatureMask 0x02000000U
|
|
|
|
#define presFeatureMask 0x01000000U
|
|
|
|
#define blwsFeatureMask 0x00800000U
|
|
|
|
#define abvsFeatureMask 0x00400000U
|
|
|
|
#define pstsFeatureMask 0x00200000U
|
|
|
|
#define halnFeatureMask 0x00100000U
|
|
|
|
#define blwmFeatureMask 0x00080000U
|
|
|
|
#define abvmFeatureMask 0x00040000U
|
|
|
|
#define distFeatureMask 0x00020000U
|
|
|
|
#define initFeatureMask 0x00010000U
|
|
|
|
|
2002-10-04 19:27:01 +00:00
|
|
|
class ReorderingOutput : public UMemory {
|
2000-11-28 20:56:52 +00:00
|
|
|
private:
|
2005-08-06 00:48:27 +00:00
|
|
|
le_int32 fOutIndex;
|
2004-05-07 23:29:16 +00:00
|
|
|
LEUnicode *fOutChars;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
LEGlyphStorage &fGlyphStorage;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fMpre;
|
|
|
|
le_int32 fMpreIndex;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fMbelow;
|
|
|
|
le_int32 fMbelowIndex;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fMabove;
|
|
|
|
le_int32 fMaboveIndex;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fMpost;
|
|
|
|
le_int32 fMpostIndex;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fLengthMark;
|
|
|
|
le_int32 fLengthMarkIndex;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fVirama;
|
|
|
|
le_int32 fViramaIndex;
|
2005-07-28 20:56:04 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
FeatureMask fMatraFeatures;
|
2004-02-13 19:34:17 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
le_int32 fMPreOutIndex;
|
2003-01-04 02:52:23 +00:00
|
|
|
MPreFixups *fMPreFixups;
|
2004-02-13 19:34:17 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fVMabove;
|
|
|
|
LEUnicode fVMpost;
|
|
|
|
le_int32 fVMIndex;
|
|
|
|
FeatureMask fVMFeatures;
|
2004-02-13 19:34:17 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
LEUnicode fSMabove;
|
|
|
|
LEUnicode fSMbelow;
|
|
|
|
le_int32 fSMIndex;
|
|
|
|
FeatureMask fSMFeatures;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-08-24 22:42:42 +00:00
|
|
|
void saveMatra(LEUnicode matra, le_int32 matraIndex, IndicClassTable::CharClass matraClass)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
// FIXME: check if already set, or if not a matra...
|
2004-02-13 19:34:17 +00:00
|
|
|
if (IndicClassTable::isLengthMark(matraClass)) {
|
2000-11-28 20:56:52 +00:00
|
|
|
fLengthMark = matra;
|
2004-08-24 22:42:42 +00:00
|
|
|
fLengthMarkIndex = matraIndex;
|
2005-07-28 20:56:04 +00:00
|
|
|
} else if (IndicClassTable::isVirama(matraClass)) {
|
|
|
|
fVirama = matra;
|
|
|
|
fViramaIndex = matraIndex;
|
2004-02-13 19:34:17 +00:00
|
|
|
} else {
|
2005-06-17 19:20:43 +00:00
|
|
|
switch (matraClass & CF_POS_MASK) {
|
|
|
|
case CF_POS_BEFORE:
|
2004-02-13 19:34:17 +00:00
|
|
|
fMpre = matra;
|
2004-08-24 22:42:42 +00:00
|
|
|
fMpreIndex = matraIndex;
|
2004-02-13 19:34:17 +00:00
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CF_POS_BELOW:
|
2004-02-13 19:34:17 +00:00
|
|
|
fMbelow = matra;
|
2004-08-24 22:42:42 +00:00
|
|
|
fMbelowIndex = matraIndex;
|
2004-02-13 19:34:17 +00:00
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CF_POS_ABOVE:
|
2004-02-13 19:34:17 +00:00
|
|
|
fMabove = matra;
|
2004-08-24 22:42:42 +00:00
|
|
|
fMaboveIndex = matraIndex;
|
2004-02-13 19:34:17 +00:00
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CF_POS_AFTER:
|
2004-02-13 19:34:17 +00:00
|
|
|
fMpost = matra;
|
2004-08-24 22:42:42 +00:00
|
|
|
fMpostIndex = matraIndex;
|
2004-02-13 19:34:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
// can't get here...
|
|
|
|
break;
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2004-04-12 18:51:31 +00:00
|
|
|
ReorderingOutput(LEUnicode *outChars, LEGlyphStorage &glyphStorage, MPreFixups *mpreFixups)
|
|
|
|
: fOutIndex(0), fOutChars(outChars), fGlyphStorage(glyphStorage),
|
2004-08-24 22:42:42 +00:00
|
|
|
fMpre(0), fMpreIndex(0), fMbelow(0), fMbelowIndex(0), fMabove(0), fMaboveIndex(0),
|
2005-07-28 20:56:04 +00:00
|
|
|
fMpost(0), fMpostIndex(0), fLengthMark(0), fLengthMarkIndex(0), fVirama(0), fViramaIndex(0),
|
2005-08-06 00:48:27 +00:00
|
|
|
fMatraFeatures(0), fMPreOutIndex(-1), fMPreFixups(mpreFixups),
|
|
|
|
fVMabove(0), fVMpost(0), fVMIndex(0), fVMFeatures(0),
|
|
|
|
fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
// nothing else to do...
|
|
|
|
}
|
|
|
|
|
|
|
|
~ReorderingOutput()
|
|
|
|
{
|
|
|
|
// nothing to do here...
|
|
|
|
}
|
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
void reset()
|
|
|
|
{
|
2005-07-28 20:56:04 +00:00
|
|
|
fMpre = fMbelow = fMabove = fMpost = fLengthMark = fVirama = 0;
|
2004-02-13 19:34:17 +00:00
|
|
|
fMPreOutIndex = -1;
|
|
|
|
|
|
|
|
fVMabove = fVMpost = 0;
|
|
|
|
fSMabove = fSMbelow = 0;
|
|
|
|
}
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
void writeChar(LEUnicode ch, le_uint32 charIndex, FeatureMask charFeatures)
|
2004-12-30 07:45:48 +00:00
|
|
|
{
|
|
|
|
LEErrorCode success = LE_NO_ERROR;
|
|
|
|
|
|
|
|
fOutChars[fOutIndex] = ch;
|
|
|
|
|
|
|
|
fGlyphStorage.setCharIndex(fOutIndex, charIndex, success);
|
2005-08-06 00:48:27 +00:00
|
|
|
fGlyphStorage.setAuxData(fOutIndex, charFeatures, success);
|
2004-12-30 07:45:48 +00:00
|
|
|
|
|
|
|
fOutIndex += 1;
|
|
|
|
}
|
|
|
|
|
2005-08-08 21:01:27 +00:00
|
|
|
le_bool noteMatra(const IndicClassTable *classTable, LEUnicode matra, le_uint32 matraIndex, FeatureMask matraFeatures, le_bool wordStart)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
|
|
|
IndicClassTable::CharClass matraClass = classTable->getCharClass(matra);
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
fMatraFeatures = matraFeatures;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-08-08 21:01:27 +00:00
|
|
|
if (wordStart) {
|
|
|
|
fMatraFeatures |= initFeatureMask;
|
|
|
|
}
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
if (IndicClassTable::isMatra(matraClass)) {
|
|
|
|
if (IndicClassTable::isSplitMatra(matraClass)) {
|
|
|
|
const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass);
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 3 && (*splitMatra)[i] != 0; i += 1) {
|
|
|
|
LEUnicode piece = (*splitMatra)[i];
|
|
|
|
IndicClassTable::CharClass pieceClass = classTable->getCharClass(piece);
|
|
|
|
|
2004-08-24 22:42:42 +00:00
|
|
|
saveMatra(piece, matraIndex, pieceClass);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
} else {
|
2004-08-24 22:42:42 +00:00
|
|
|
saveMatra(matra, matraIndex, matraClass);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2004-08-24 22:42:42 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2004-08-24 22:42:42 +00:00
|
|
|
|
|
|
|
return FALSE;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2004-02-13 19:34:17 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
void noteVowelModifier(const IndicClassTable *classTable, LEUnicode vowelModifier, le_uint32 vowelModifierIndex, FeatureMask vowelModifierFeatures)
|
2004-02-13 19:34:17 +00:00
|
|
|
{
|
|
|
|
IndicClassTable::CharClass vmClass = classTable->getCharClass(vowelModifier);
|
|
|
|
|
|
|
|
fVMIndex = vowelModifierIndex;
|
2005-08-06 00:48:27 +00:00
|
|
|
fVMFeatures = vowelModifierFeatures;
|
2004-02-13 19:34:17 +00:00
|
|
|
|
|
|
|
if (IndicClassTable::isVowelModifier(vmClass)) {
|
2005-06-17 19:20:43 +00:00
|
|
|
switch (vmClass & CF_POS_MASK) {
|
|
|
|
case CF_POS_ABOVE:
|
2004-02-13 19:34:17 +00:00
|
|
|
fVMabove = vowelModifier;
|
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CF_POS_AFTER:
|
2004-02-13 19:34:17 +00:00
|
|
|
fVMpost = vowelModifier;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
// FIXME: this is an error...
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
void noteStressMark(const IndicClassTable *classTable, LEUnicode stressMark, le_uint32 stressMarkIndex, FeatureMask stressMarkFeatures)
|
2004-02-13 19:34:17 +00:00
|
|
|
{
|
|
|
|
IndicClassTable::CharClass smClass = classTable->getCharClass(stressMark);
|
|
|
|
|
|
|
|
fSMIndex = stressMarkIndex;
|
2005-08-06 00:48:27 +00:00
|
|
|
fSMFeatures = stressMarkFeatures;
|
2004-02-13 19:34:17 +00:00
|
|
|
|
|
|
|
if (IndicClassTable::isStressMark(smClass)) {
|
2005-06-17 19:20:43 +00:00
|
|
|
switch (smClass & CF_POS_MASK) {
|
|
|
|
case CF_POS_ABOVE:
|
2004-02-13 19:34:17 +00:00
|
|
|
fSMabove = stressMark;
|
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CF_POS_BELOW:
|
2004-02-13 19:34:17 +00:00
|
|
|
fSMbelow = stressMark;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
// FIXME: this is an error...
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-04 02:52:23 +00:00
|
|
|
void noteBaseConsonant()
|
|
|
|
{
|
|
|
|
if (fMPreFixups != NULL && fMPreOutIndex >= 0) {
|
|
|
|
fMPreFixups->add(fOutIndex, fMPreOutIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-07-28 20:56:04 +00:00
|
|
|
// Handles virama in Sinhala split vowels.
|
|
|
|
void writeVirama()
|
|
|
|
{
|
|
|
|
if (fVirama != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fVirama, fViramaIndex, fMatraFeatures);
|
2005-07-28 20:56:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
void writeMpre()
|
|
|
|
{
|
|
|
|
if (fMpre != 0) {
|
2003-01-04 02:52:23 +00:00
|
|
|
fMPreOutIndex = fOutIndex;
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fMpre, fMpreIndex, fMatraFeatures);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeMbelow()
|
|
|
|
{
|
|
|
|
if (fMbelow != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fMbelow, fMbelowIndex, fMatraFeatures);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeMabove()
|
|
|
|
{
|
|
|
|
if (fMabove != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fMabove, fMaboveIndex, fMatraFeatures);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeMpost()
|
|
|
|
{
|
|
|
|
if (fMpost != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fMpost, fMpostIndex, fMatraFeatures);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeLengthMark()
|
|
|
|
{
|
|
|
|
if (fLengthMark != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fLengthMark, fLengthMarkIndex, fMatraFeatures);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
2004-02-13 19:34:17 +00:00
|
|
|
|
|
|
|
void writeVMabove()
|
|
|
|
{
|
|
|
|
if (fVMabove != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fVMabove, fVMIndex, fVMFeatures);
|
2004-02-13 19:34:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeVMpost()
|
|
|
|
{
|
|
|
|
if (fVMpost != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fVMpost, fVMIndex, fVMFeatures);
|
2004-02-13 19:34:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeSMabove()
|
|
|
|
{
|
|
|
|
if (fSMabove != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fSMabove, fSMIndex, fSMFeatures);
|
2004-02-13 19:34:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void writeSMbelow()
|
|
|
|
{
|
|
|
|
if (fSMbelow != 0) {
|
2005-08-06 00:48:27 +00:00
|
|
|
writeChar(fSMbelow, fSMIndex, fSMFeatures);
|
2004-02-13 19:34:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int32 getOutputIndex()
|
|
|
|
{
|
|
|
|
return fOutIndex;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
C_DOTTED_CIRCLE = 0x25CC
|
|
|
|
};
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
// TODO: Find better names for these!
|
|
|
|
#define tagArray4 (nuktFeatureMask | akhnFeatureMask | vatuFeatureMask | presFeatureMask | blwsFeatureMask | abvsFeatureMask | pstsFeatureMask | halnFeatureMask | blwmFeatureMask | abvmFeatureMask | distFeatureMask)
|
|
|
|
#define tagArray3 (pstfFeatureMask | tagArray4)
|
|
|
|
#define tagArray2 (halfFeatureMask | tagArray3)
|
|
|
|
#define tagArray1 (blwfFeatureMask | tagArray2)
|
|
|
|
#define tagArray0 (rphfFeatureMask | tagArray1)
|
|
|
|
|
|
|
|
static const FeatureMap featureMap[] =
|
2002-03-01 22:24:10 +00:00
|
|
|
{
|
2005-08-08 21:01:27 +00:00
|
|
|
{initFeatureTag, initFeatureMask},
|
2005-08-06 00:48:27 +00:00
|
|
|
{nuktFeatureTag, nuktFeatureMask},
|
|
|
|
{akhnFeatureTag, akhnFeatureMask},
|
|
|
|
{rphfFeatureTag, rphfFeatureMask},
|
|
|
|
{blwfFeatureTag, blwfFeatureMask},
|
|
|
|
{halfFeatureTag, halfFeatureMask},
|
|
|
|
{pstfFeatureTag, pstfFeatureMask},
|
|
|
|
{vatuFeatureTag, vatuFeatureMask},
|
|
|
|
{presFeatureTag, presFeatureMask},
|
|
|
|
{blwsFeatureTag, blwsFeatureMask},
|
|
|
|
{abvsFeatureTag, abvsFeatureMask},
|
|
|
|
{pstsFeatureTag, pstsFeatureMask},
|
|
|
|
{halnFeatureTag, halnFeatureMask},
|
|
|
|
{blwmFeatureTag, blwmFeatureMask},
|
|
|
|
{abvmFeatureTag, abvmFeatureMask},
|
|
|
|
{distFeatureTag, distFeatureMask}
|
2002-03-01 22:24:10 +00:00
|
|
|
};
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
static const le_int32 featureCount = LE_ARRAY_SIZE(featureMap);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
static const le_int8 stateTable[][CC_COUNT] =
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2005-07-28 21:27:12 +00:00
|
|
|
// xx vm sm iv i2 i3 ct cn nu dv s1 s2 s3 vr zw
|
|
|
|
{ 1, 1, 1, 5, 8, 11, 3, 2, 1, 5, 9, 5, 1, 1, 1}, // 0 - ground state
|
|
|
|
{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 1 - exit state
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, -1}, // 2 - consonant with nukta
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, 2, 5, 9, 5, 5, 4, -1}, // 3 - consonant
|
|
|
|
{-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, 7}, // 4 - consonant virama
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 5 - dependent vowels
|
|
|
|
{-1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, // 6 - vowel mark
|
|
|
|
{-1, -1, -1, -1, -1, -1, 3, 2, -1, -1, -1, -1, -1, -1, -1}, // 7 - ZWJ, ZWNJ
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1}, // 8 - independent vowels that can take a virama
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 5, -1, -1}, // 9 - first part of split vowel
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1}, // 10 - second part of split vowel
|
|
|
|
{-1, 6, 1, -1, -1, -1, -1, -1, -1, 5, 9, 5, 5, 4, -1} // 11 - independent vowels that can take an iv
|
2000-11-28 20:56:52 +00:00
|
|
|
};
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
|
|
|
|
const FeatureMap *IndicReordering::getFeatureMap(le_int32 &count)
|
2002-03-01 22:24:10 +00:00
|
|
|
{
|
2005-08-06 00:48:27 +00:00
|
|
|
count = featureCount;
|
|
|
|
|
|
|
|
return featureMap;
|
2002-03-01 22:24:10 +00:00
|
|
|
}
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int32 IndicReordering::findSyllable(const IndicClassTable *classTable, const LEUnicode *chars, le_int32 prev, le_int32 charCount)
|
|
|
|
{
|
|
|
|
le_int32 cursor = prev;
|
|
|
|
le_int8 state = 0;
|
|
|
|
|
|
|
|
while (cursor < charCount) {
|
|
|
|
IndicClassTable::CharClass charClass = classTable->getCharClass(chars[cursor]);
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
state = stateTable[state][charClass & CF_CLASS_MASK];
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
if (state < 0) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
cursor += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return cursor;
|
|
|
|
}
|
|
|
|
|
2003-01-04 02:52:23 +00:00
|
|
|
le_int32 IndicReordering::reorder(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode,
|
2004-04-12 18:51:31 +00:00
|
|
|
LEUnicode *outChars, LEGlyphStorage &glyphStorage,
|
2003-01-04 02:52:23 +00:00
|
|
|
MPreFixups **outMPreFixups)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2003-01-04 02:52:23 +00:00
|
|
|
MPreFixups *mpreFixups = NULL;
|
2000-11-28 20:56:52 +00:00
|
|
|
const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode);
|
2003-01-04 02:52:23 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if (classTable->scriptFlags & SF_MPRE_FIXUP) {
|
2003-01-04 02:52:23 +00:00
|
|
|
mpreFixups = new MPreFixups(charCount);
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
ReorderingOutput output(outChars, glyphStorage, mpreFixups);
|
2000-11-28 20:56:52 +00:00
|
|
|
le_int32 i, prev = 0;
|
2005-08-08 21:01:27 +00:00
|
|
|
le_bool lastInWord = FALSE;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
while (prev < charCount) {
|
|
|
|
le_int32 syllable = findSyllable(classTable, chars, prev, charCount);
|
2004-02-13 19:34:17 +00:00
|
|
|
le_int32 matra, markStart = syllable;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
output.reset();
|
|
|
|
|
|
|
|
if (classTable->isStressMark(chars[markStart - 1])) {
|
|
|
|
markStart -= 1;
|
2005-08-06 00:48:27 +00:00
|
|
|
output.noteStressMark(classTable, chars[markStart], markStart, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2004-02-13 19:34:17 +00:00
|
|
|
|
|
|
|
if (classTable->isVowelModifier(chars[markStart - 1])) {
|
|
|
|
markStart -= 1;
|
2005-08-06 00:48:27 +00:00
|
|
|
output.noteVowelModifier(classTable, chars[markStart], markStart, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
matra = markStart - 1;
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-08 21:01:27 +00:00
|
|
|
while (output.noteMatra(classTable, chars[matra], matra, tagArray1, !lastInWord) && matra != prev) {
|
2004-08-24 22:42:42 +00:00
|
|
|
matra -= 1;
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-08-08 21:01:27 +00:00
|
|
|
lastInWord = TRUE;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
switch (classTable->getCharClass(chars[prev]) & CF_CLASS_MASK) {
|
|
|
|
case CC_RESERVED:
|
2005-08-08 21:01:27 +00:00
|
|
|
lastInWord = FALSE;
|
|
|
|
/* fall through */
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CC_INDEPENDENT_VOWEL:
|
|
|
|
case CC_ZERO_WIDTH_MARK:
|
2000-11-28 20:56:52 +00:00
|
|
|
for (i = prev; i < syllable; i += 1) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[i], i, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CC_NUKTA:
|
|
|
|
case CC_VIRAMA:
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(C_DOTTED_CIRCLE, prev, tagArray1);
|
|
|
|
output.writeChar(chars[prev], prev, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CC_DEPENDENT_VOWEL:
|
|
|
|
case CC_SPLIT_VOWEL_PIECE_1:
|
|
|
|
case CC_SPLIT_VOWEL_PIECE_2:
|
|
|
|
case CC_SPLIT_VOWEL_PIECE_3:
|
|
|
|
case CC_VOWEL_MODIFIER:
|
|
|
|
case CC_STRESS_MARK:
|
2000-11-28 20:56:52 +00:00
|
|
|
output.writeMpre();
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(C_DOTTED_CIRCLE, prev, tagArray1);
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
output.writeMbelow();
|
2004-08-24 22:42:42 +00:00
|
|
|
output.writeSMbelow();
|
2000-11-28 20:56:52 +00:00
|
|
|
output.writeMabove();
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_MATRAS_AFTER_BASE) != 0) {
|
2004-08-24 22:42:42 +00:00
|
|
|
output.writeMpost();
|
|
|
|
}
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) != 0) {
|
2004-08-24 22:42:42 +00:00
|
|
|
output.writeVMabove();
|
|
|
|
output.writeSMabove(); // FIXME: there are no SM's in these scripts...
|
|
|
|
}
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_MATRAS_AFTER_BASE) == 0) {
|
2004-08-24 22:42:42 +00:00
|
|
|
output.writeMpost();
|
|
|
|
}
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
output.writeLengthMark();
|
2005-07-28 20:56:04 +00:00
|
|
|
output.writeVirama();
|
2004-08-24 22:42:42 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) == 0) {
|
2004-08-24 22:42:42 +00:00
|
|
|
output.writeVMabove();
|
|
|
|
output.writeSMabove();
|
|
|
|
}
|
|
|
|
|
|
|
|
output.writeVMpost();
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
case CC_INDEPENDENT_VOWEL_2:
|
2005-07-28 21:27:12 +00:00
|
|
|
case CC_INDEPENDENT_VOWEL_3:
|
2005-06-17 19:20:43 +00:00
|
|
|
case CC_CONSONANT:
|
|
|
|
case CC_CONSONANT_WITH_NUKTA:
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2004-02-13 19:34:17 +00:00
|
|
|
le_uint32 length = markStart - prev;
|
|
|
|
le_int32 lastConsonant = markStart - 1;
|
2003-01-28 23:30:56 +00:00
|
|
|
le_int32 baseLimit = prev;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
// Check for REPH at front of syllable
|
|
|
|
if (length > 2 && classTable->isReph(chars[prev]) && classTable->isVirama(chars[prev + 1])) {
|
2003-01-28 23:30:56 +00:00
|
|
|
baseLimit += 2;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
|
|
|
// Check for eyelash RA, if the script supports it
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_EYELASH_RA) != 0 &&
|
2003-01-28 23:30:56 +00:00
|
|
|
chars[baseLimit] == C_SIGN_ZWJ) {
|
2000-11-28 20:56:52 +00:00
|
|
|
if (length > 3) {
|
|
|
|
baseLimit += 1;
|
|
|
|
} else {
|
2003-01-28 23:30:56 +00:00
|
|
|
baseLimit -= 2;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-25 19:27:43 +00:00
|
|
|
while (lastConsonant > baseLimit && !classTable->isConsonant(chars[lastConsonant])) {
|
2000-11-28 20:56:52 +00:00
|
|
|
lastConsonant -= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
le_int32 baseConsonant = lastConsonant;
|
|
|
|
le_int32 postBase = lastConsonant + 1;
|
2005-06-17 19:20:43 +00:00
|
|
|
le_int32 postBaseLimit = classTable->scriptFlags & SF_POST_BASE_LIMIT_MASK;
|
2003-12-08 22:43:41 +00:00
|
|
|
le_bool seenVattu = FALSE;
|
|
|
|
le_bool seenBelowBaseForm = FALSE;
|
2003-01-28 23:30:56 +00:00
|
|
|
|
2005-06-16 22:46:37 +00:00
|
|
|
if (postBase < markStart && classTable->isNukta(chars[postBase])) {
|
2004-03-25 19:27:43 +00:00
|
|
|
postBase += 1;
|
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
while (baseConsonant > baseLimit) {
|
|
|
|
IndicClassTable::CharClass charClass = classTable->getCharClass(chars[baseConsonant]);
|
|
|
|
|
|
|
|
if (IndicClassTable::isConsonant(charClass)) {
|
|
|
|
if (postBaseLimit == 0 || seenVattu ||
|
|
|
|
(baseConsonant > baseLimit && !classTable->isVirama(chars[baseConsonant - 1])) ||
|
|
|
|
!IndicClassTable::hasPostOrBelowBaseForm(charClass)) {
|
|
|
|
break;
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
seenVattu = IndicClassTable::isVattu(charClass);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
if (IndicClassTable::hasPostBaseForm(charClass)) {
|
|
|
|
if (seenBelowBaseForm) {
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
postBase = baseConsonant;
|
|
|
|
} else if (IndicClassTable::hasBelowBaseForm(charClass)) {
|
2003-12-08 22:43:41 +00:00
|
|
|
seenBelowBaseForm = TRUE;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
postBaseLimit -= 1;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
baseConsonant -= 1;
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// Write Mpre
|
|
|
|
output.writeMpre();
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// Write eyelash RA
|
|
|
|
// NOTE: baseLimit == prev + 3 iff eyelash RA present...
|
|
|
|
if (baseLimit == prev + 3) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[prev], prev, tagArray2);
|
|
|
|
output.writeChar(chars[prev + 1], prev + 1, tagArray2);
|
|
|
|
output.writeChar(chars[prev + 2], prev + 2, tagArray2);
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write any pre-base consonants
|
2003-12-08 22:43:41 +00:00
|
|
|
le_bool supressVattu = TRUE;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
for (i = baseLimit; i < baseConsonant; i += 1) {
|
|
|
|
LEUnicode ch = chars[i];
|
2004-08-19 23:51:11 +00:00
|
|
|
// Don't put 'blwf' on first consonant.
|
2005-08-06 00:48:27 +00:00
|
|
|
FeatureMask features = (i == baseLimit? tagArray2 : tagArray1);
|
2003-01-28 23:30:56 +00:00
|
|
|
IndicClassTable::CharClass charClass = classTable->getCharClass(ch);
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
if (IndicClassTable::isConsonant(charClass)) {
|
|
|
|
if (IndicClassTable::isVattu(charClass) && supressVattu) {
|
2005-08-06 00:48:27 +00:00
|
|
|
features = tagArray4;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
supressVattu = IndicClassTable::isVattu(charClass);
|
|
|
|
} else if (IndicClassTable::isVirama(charClass) && chars[i + 1] == C_SIGN_ZWNJ)
|
|
|
|
{
|
2005-08-06 00:48:27 +00:00
|
|
|
features = tagArray4;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(ch, i, features);
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
le_int32 bcSpan = baseConsonant + 1;
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
if (bcSpan < markStart && classTable->isNukta(chars[bcSpan])) {
|
2003-01-28 23:30:56 +00:00
|
|
|
bcSpan += 1;
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
if (baseConsonant == lastConsonant && bcSpan < markStart && classTable->isVirama(chars[bcSpan])) {
|
2003-01-28 23:30:56 +00:00
|
|
|
bcSpan += 1;
|
2003-01-04 02:52:23 +00:00
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
if (bcSpan < markStart && chars[bcSpan] == C_SIGN_ZWNJ) {
|
2003-01-28 23:30:56 +00:00
|
|
|
bcSpan += 1;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// note the base consonant for post-GSUB fixups
|
|
|
|
output.noteBaseConsonant();
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write base consonant
|
|
|
|
for (i = baseConsonant; i < bcSpan; i += 1) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[i], i, tagArray4);
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_MATRAS_AFTER_BASE) != 0) {
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeMbelow();
|
2004-02-13 19:34:17 +00:00
|
|
|
output.writeSMbelow(); // FIXME: there are no SMs in these scripts...
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeMabove();
|
|
|
|
output.writeMpost();
|
|
|
|
}
|
|
|
|
|
|
|
|
// write below-base consonants
|
|
|
|
if (baseConsonant != lastConsonant) {
|
|
|
|
for (i = bcSpan + 1; i < postBase; i += 1) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[i], i, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
if (postBase > lastConsonant) {
|
|
|
|
// write halant that was after base consonant
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[bcSpan], bcSpan, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
// write Mbelow, SMbelow, Mabove
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_MATRAS_AFTER_BASE) == 0) {
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeMbelow();
|
2004-02-13 19:34:17 +00:00
|
|
|
output.writeSMbelow();
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeMabove();
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) != 0) {
|
2003-01-28 23:30:56 +00:00
|
|
|
if (baseLimit == prev + 2) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[prev], prev, tagArray0);
|
|
|
|
output.writeChar(chars[prev + 1], prev + 1, tagArray0);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
output.writeVMabove();
|
|
|
|
output.writeSMabove(); // FIXME: there are no SM's in these scripts...
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write post-base consonants
|
|
|
|
// FIXME: does this put the right tags on post-base consonants?
|
|
|
|
if (baseConsonant != lastConsonant) {
|
|
|
|
if (postBase <= lastConsonant) {
|
|
|
|
for (i = postBase; i <= lastConsonant; i += 1) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[i], i, tagArray3);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write halant that was after base consonant
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[bcSpan], bcSpan, tagArray1);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write the training halant, if there is one
|
|
|
|
if (lastConsonant < matra && classTable->isVirama(chars[matra])) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[matra], matra, tagArray4);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
2003-01-28 23:30:56 +00:00
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write Mpost
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_MATRAS_AFTER_BASE) == 0) {
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeMpost();
|
|
|
|
}
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
output.writeLengthMark();
|
2005-07-28 20:56:04 +00:00
|
|
|
output.writeVirama();
|
2000-11-28 20:56:52 +00:00
|
|
|
|
2003-01-28 23:30:56 +00:00
|
|
|
// write reph
|
2005-06-17 19:20:43 +00:00
|
|
|
if ((classTable->scriptFlags & SF_REPH_AFTER_BELOW) == 0) {
|
2003-01-28 23:30:56 +00:00
|
|
|
if (baseLimit == prev + 2) {
|
2005-08-06 00:48:27 +00:00
|
|
|
output.writeChar(chars[prev], prev, tagArray0);
|
|
|
|
output.writeChar(chars[prev + 1], prev + 1, tagArray0);
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
output.writeVMabove();
|
|
|
|
output.writeSMabove();
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
|
2004-02-13 19:34:17 +00:00
|
|
|
output.writeVMpost();
|
2003-01-28 23:30:56 +00:00
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
prev = syllable;
|
|
|
|
}
|
|
|
|
|
2003-01-04 02:52:23 +00:00
|
|
|
*outMPreFixups = mpreFixups;
|
|
|
|
|
2000-11-28 20:56:52 +00:00
|
|
|
return output.getOutputIndex();
|
|
|
|
}
|
|
|
|
|
2004-04-12 18:51:31 +00:00
|
|
|
void IndicReordering::adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage)
|
2000-11-28 20:56:52 +00:00
|
|
|
{
|
2003-01-28 23:30:56 +00:00
|
|
|
if (mpreFixups != NULL) {
|
2004-04-12 18:51:31 +00:00
|
|
|
mpreFixups->apply(glyphStorage);
|
2003-01-04 02:52:23 +00:00
|
|
|
|
|
|
|
delete mpreFixups;
|
2000-11-28 20:56:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-10-16 00:39:01 +00:00
|
|
|
U_NAMESPACE_END
|