Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1:/tmp/cvs-serv3270/src/GrEngine Modified Files: FileInput.cpp FileInput.h GrCharStream.cpp GrCharStream.h GrClassTable.cpp GrClassTable.h GrEngine.cpp GrFSM.cpp GrFSM.h GrGlyphTable.cpp GrGlyphTable.h GrPass.cpp GrPass.h GrPassActionCode.cpp GrPseudoMap.h GrSegment.cpp GrSlotState.cpp GrSlotState.h GrSlotStream.cpp GrSlotStream.h GrTableManager.cpp GrTableManager.h TestFSM.cpp TestPasses.cpp TransductionLog.cpp main.h Log Message: Synchronized with FW, 16 Apr 2003, changelist #6720 Index: FileInput.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/FileInput.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- FileInput.cpp 5 Nov 2002 21:29:14 -0000 1.1.1.1 +++ FileInput.cpp 16 Apr 2003 19:59:39 -0000 1.2 @@ -122,7 +122,7 @@ short GrFileIStream::ReadShortFromFont() { #ifdef comFileIO - wchar chwInput; + grwchar chwInput; ULONG cbRead; HRESULT hr = m_qstrm->Read(&chwInput, 2, &cbRead); if (FAILED(hr)) @@ -133,7 +133,7 @@ return snInput; #else // TODO: test for reading beyond the end of the file. - wchar chwInput; + grwchar chwInput; read((char *)&chwInput, isizeof(short)); short snInput = lsbf(chwInput); return snInput; @@ -144,10 +144,10 @@ Read a wide character (unsigned 16-bit word) from the stream. Switch the bytes from big-endian to little-endian format. ----------------------------------------------------------------------------------------------*/ -wchar GrFileIStream::ReadUShortFromFont() +grwchar GrFileIStream::ReadUShortFromFont() { #ifdef comFileIO - wchar chwInput; + grwchar chwInput; ULONG cbRead; HRESULT hr = m_qstrm->Read(&chwInput, 2, &cbRead); if (FAILED(hr)) @@ -158,7 +158,7 @@ return chwInput; #else // TODO: test for reading beyond the end of the file. - wchar chwInput; + grwchar chwInput; read((char *)&chwInput, isizeof(short)); chwInput = lsbf(chwInput); return chwInput; @@ -334,10 +334,10 @@ Read a wide character (unsigned 16-bit word) from the stream. Switch the bytes from big-endian to little-endian format. ----------------------------------------------------------------------------------------------*/ -wchar GrBufferIStream::ReadUShortFromFont() +grwchar GrBufferIStream::ReadUShortFromFont() { - wchar chwInput = *(wchar *)pbNext; - pbNext += isizeof(wchar); + grwchar chwInput = *(grwchar *)pbNext; + pbNext += isizeof(grwchar); Assert(pbNext <= pbLim); chwInput = lsbf(chwInput); return chwInput; @@ -402,12 +402,12 @@ return nRet; } -wchar swapb(wchar chwArg) +grwchar swapb(grwchar chwArg) { - wchar b1, b2; + grwchar b1, b2; b1 = ((chwArg & 0xFF00) >> 8) & 0x00FF; // remove sign extension b2 = ((chwArg & 0x00FF) << 8); // & 0xFF00; - wchar chwRet = b1 | b2; + grwchar chwRet = b1 | b2; return chwRet; } Index: FileInput.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/FileInput.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FileInput.h 14 Apr 2003 21:34:27 -0000 1.4 +++ FileInput.h 16 Apr 2003 19:59:39 -0000 1.5 @@ -21,17 +21,17 @@ //:End Ignore int swapb(int nArg); -wchar swapb(wchar chwArg); +grwchar swapb(grwchar chwArg); short swapb(short snArg); // Most significant byte first (converting from least-sig-first): inline int msbf(int nArg) { return swapb(nArg); } -inline wchar msbf(wchar chwArg) { return swapb(chwArg); } +inline grwchar msbf(grwchar chwArg) { return swapb(chwArg); } inline short msbf(short chwArg) { return swapb(chwArg); } // Least significant byte first (converting from most-sig first): inline int lsbf(int nArg) { return swapb(nArg); } -inline wchar lsbf(wchar chwArg) { return swapb(chwArg); } +inline grwchar lsbf(grwchar chwArg) { return swapb(chwArg); } inline short lsbf(short chwArg) { return swapb(chwArg); } class GrIStream @@ -41,12 +41,15 @@ virtual byte ReadByteFromFont() = 0; virtual short ReadShortFromFont() = 0; - virtual wchar ReadUShortFromFont() = 0; + virtual grwchar ReadUShortFromFont() = 0; virtual int ReadIntFromFont() = 0; virtual void ReadBlockFromFont(void * pvInput, int cb) = 0; virtual void GetPositionInFont(long * plPos) = 0; virtual void SetPositionInFont(long lPos) = 0; + + virtual bool OpenBuffer(byte * pbBuffer, int cb) = 0; + virtual void CloseBuffer() = 0; }; @@ -75,7 +78,7 @@ virtual byte ReadByteFromFont(); virtual short ReadShortFromFont(); - virtual wchar ReadUShortFromFont(); + virtual grwchar ReadUShortFromFont(); virtual int ReadIntFromFont(); virtual void ReadBlockFromFont(void * pvInput, int cb); @@ -86,8 +89,16 @@ // outside of FW, it is just a bogus, trivial class that is not used { -#endif // GR_FW +#endif // !GR_FW + // Do-nothing methods: + virtual bool OpenBuffer(byte * pbBuffer, int cb) + { + return true; + } + virtual void CloseBuffer() + { + } }; @@ -105,14 +116,18 @@ virtual byte ReadByteFromFont(); virtual short ReadShortFromFont(); - virtual wchar ReadUShortFromFont(); + virtual grwchar ReadUShortFromFont(); virtual int ReadIntFromFont(); virtual void ReadBlockFromFont(void * pvInput, int cb); virtual void GetPositionInFont(long * plPos); virtual void SetPositionInFont(long lPos); - bool OpenBuffer(byte * pbBuffer, int cb); + virtual bool OpenBuffer(byte * pbBuffer, int cb); + virtual void CloseBuffer() + { + Close(); + } protected: byte * pbStart; Index: GrCharStream.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrCharStream.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GrCharStream.cpp 14 Apr 2003 21:34:28 -0000 1.4 +++ GrCharStream.cpp 16 Apr 2003 19:59:40 -0000 1.5 @@ -100,7 +100,7 @@ m_prgnRunText = NewObj int[m_cnRunMax]; } - wchar * prgchwRunText = NewObj wchar[m_ichwRunLim - m_ichwRunMin]; + grwchar * prgchwRunText = NewObj grwchar[m_ichwRunLim - m_ichwRunMin]; res = m_pgts->Fetch(m_ichwRunMin, m_ichwRunLim, prgchwRunText); if (ResultFailed(res)) { @@ -175,7 +175,7 @@ Convert UTF-16 to UTF-32--a single character's worth. Return the number of 16-bit items consumed. ----------------------------------------------------------------------------------------------*/ -int GrCharStream::Utf16ToUtf32(wchar * prgchw, int cchw, int * pcchwUsed) +int GrCharStream::Utf16ToUtf32(grwchar * prgchw, int cchw, int * pcchwUsed) { if (cchw <= 0) { @@ -234,7 +234,7 @@ THROW(res); return true; } - wchar * prgchwRunText = NewObj wchar[ichwRunLim - ichwRunMin]; + grwchar * prgchwRunText = NewObj grwchar[ichwRunLim - ichwRunMin]; res = pgts->Fetch(ichwRunMin, ichwRunLim, prgchwRunText); if (ResultFailed(res)) { @@ -252,7 +252,7 @@ Return true if the given position is at the boundary of a Unicode character; return false if it is between two parts of pair of surrogates. ----------------------------------------------------------------------------------------------*/ -bool GrCharStream::AtUnicodeCharBoundary(wchar * prgchw, int cchw, int ichw) +bool GrCharStream::AtUnicodeCharBoundary(grwchar * prgchw, int cchw, int ichw) { Assert(ichw >= 0); Assert(ichw <= cchw); @@ -292,7 +292,7 @@ true if they are a legitimate surrogate pair. If not, just return the first of the two 16-bit characters. ----------------------------------------------------------------------------------------------*/ -bool GrCharStream::FromSurrogatePair(wchar chIn1, wchar chIn2, uint * pch32Out) +bool GrCharStream::FromSurrogatePair(grwchar chIn1, grwchar chIn2, uint * pch32Out) { if ((chIn1 < 0xD800) || (chIn1 > 0xDBFF) || (chIn2 < 0xDC00) || (chIn2 > 0xDFFF)) { @@ -414,8 +414,8 @@ { Assert(fSettingDefaults == (pgreng != NULL)); - wchar * pchw = const_cast<wchar *>(stu.Chars()); - wchar * pchwLim = pchw + stu.Length(); + grwchar * pchw = const_cast<grwchar *>(stu.Chars()); + grwchar * pchwLim = pchw + stu.Length(); while (pchw < pchwLim) { int nID = 0; Index: GrCharStream.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrCharStream.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GrCharStream.h 12 Feb 2003 15:35:54 -0000 1.5 +++ GrCharStream.h 16 Apr 2003 19:59:41 -0000 1.6 @@ -82,7 +82,7 @@ GrFeatureValues * rgfval, COLORREF * rgclrFore, COLORREF * rgclrBack, int cchwBackup, int * pcchwMax16bit); void GetLogDataSurrogates(GrTableManager * ptman, int cchw, int cchwBackup, - int cchwMax16bit, int * prgnChars, wchar * prgchw2, int * prgichw16bit); + int cchwMax16bit, int * prgnChars, grwchar * prgchw2, int * prgichw16bit); protected: void SetUpFeatureValues(GrTableManager * ptman, int ichw); @@ -90,10 +90,10 @@ static void ParseFeatureString(GrEngine *, GrTableManager *, GrCharStream *, StrUni stu, bool fSettingDefaults); - static int Utf16ToUtf32(wchar * prgchw16bit, int cchw, int * pcchwUsed); + static int Utf16ToUtf32(grwchar * prgchw16bit, int cchw, int * pcchwUsed); static bool AtUnicodeCharBoundary(IGrTextSource * pgts, int ichw); - static bool AtUnicodeCharBoundary(wchar * prgch, int cchw, int ichw); - static bool FromSurrogatePair(wchar chIn1, wchar chIn2, uint * pch32Out); + static bool AtUnicodeCharBoundary(grwchar * prgch, int cchw, int ichw); + static bool FromSurrogatePair(grwchar chIn1, grwchar chIn2, uint * pch32Out); protected: // Instance variables: Index: GrClassTable.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrClassTable.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrClassTable.cpp 14 Apr 2003 21:34:28 -0000 1.3 +++ GrClassTable.cpp 16 Apr 2003 19:59:42 -0000 1.4 @@ -49,10 +49,10 @@ m_cclsLinear = grstrm.ReadUShortFromFont(); // class offsets - m_prgichwOffsets = NewObj wchar[m_ccls + 1]; + m_prgichwOffsets = NewObj grwchar[m_ccls + 1]; Assert(m_prgichwOffsets); - wchar * pchw = m_prgichwOffsets; + grwchar * pchw = m_prgichwOffsets; int icls; for (icls = 0; icls <= m_ccls; icls++, pchw++) { @@ -60,7 +60,7 @@ } // Offsets are relative to the start class map; make them relative to the class list - // itself, and in terms of wchars, not bytes. + // itself, and in terms of grwchars, not bytes. long lClassesPos; grstrm.GetPositionInFont(&lClassesPos); int cbDiff = lClassesPos - lClassMapStart; @@ -72,10 +72,10 @@ } // classes - slurp entire block (data remains in big-endian format) - m_prgchwBIGGlyphList = NewObj wchar[m_prgichwOffsets[m_ccls]]; + m_prgchwBIGGlyphList = NewObj grwchar[m_prgichwOffsets[m_ccls]]; Assert(m_prgchwBIGGlyphList); grstrm.ReadBlockFromFont(m_prgchwBIGGlyphList, - m_prgichwOffsets[m_ccls] * isizeof(wchar)); + m_prgichwOffsets[m_ccls] * isizeof(grwchar)); } /*---------------------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ /*---------------------------------------------------------------------------------------------- Search for the glyph ID using a fast binary search, and return the matching index. ----------------------------------------------------------------------------------------------*/ -int GrInputClass::FindIndex(wchar gid) +int GrInputClass::FindIndex(grwchar gid) { int cgix = NumberOfGlyphs(); int digixInit = InitialSearchRange(); @@ -135,7 +135,7 @@ /*---------------------------------------------------------------------------------------------- Return the selector index for the given glyph ID. ----------------------------------------------------------------------------------------------*/ -int GrClassTable::FindIndex(int icls, wchar chwGlyphID) +int GrClassTable::FindIndex(int icls, grwchar chwGlyphID) { if (icls < m_cclsLinear) { @@ -170,7 +170,7 @@ /*---------------------------------------------------------------------------------------------- Return the glyph ID at the selector index. ----------------------------------------------------------------------------------------------*/ -wchar GrClassTable::GetGlyphID(int icls, int ichw) +grwchar GrClassTable::GetGlyphID(int icls, int ichw) { if (ichw < 0) { @@ -226,96 +226,96 @@ m_ccls = 7; // number of classes m_cclsLinear = 4; // number of classes in linear format - m_prgchwBIGGlyphList = NewObj wchar[100]; + m_prgchwBIGGlyphList = NewObj grwchar[100]; - m_prgichwOffsets = NewObj wchar[7+1]; + m_prgichwOffsets = NewObj grwchar[7+1]; - wchar * pchw = m_prgchwBIGGlyphList; + grwchar * pchw = m_prgchwBIGGlyphList; // Output class 0: uppercase consonants B - H m_prgichwOffsets[0] = 0; - *pchw++ = msbf(wchar(66)); *pchw++ = msbf(wchar(67)); *pchw++ = msbf(wchar(68)); - *pchw++ = msbf(wchar(70)); *pchw++ = msbf(wchar(71)); *pchw++ = msbf(wchar(72)); + *pchw++ = msbf(grwchar(66)); *pchw++ = msbf(grwchar(67)); *pchw++ = msbf(grwchar(68)); + *pchw++ = msbf(grwchar(70)); *pchw++ = msbf(grwchar(71)); *pchw++ = msbf(grwchar(72)); // Output class 1: grave vowels m_prgichwOffsets[1] = 6; - *pchw++ = msbf(wchar(192)); // A - *pchw++ = msbf(wchar(224)); // a - *pchw++ = msbf(wchar(200)); // E - *pchw++ = msbf(wchar(232)); // e - *pchw++ = msbf(wchar(204)); // I - *pchw++ = msbf(wchar(236)); // i - *pchw++ = msbf(wchar(210)); // O - *pchw++ = msbf(wchar(243)); // o - *pchw++ = msbf(wchar(217)); // U - *pchw++ = msbf(wchar(249)); // u + *pchw++ = msbf(grwchar(192)); // A + *pchw++ = msbf(grwchar(224)); // a + *pchw++ = msbf(grwchar(200)); // E + *pchw++ = msbf(grwchar(232)); // e + *pchw++ = msbf(grwchar(204)); // I + *pchw++ = msbf(grwchar(236)); // i + *pchw++ = msbf(grwchar(210)); // O + *pchw++ = msbf(grwchar(243)); // o + *pchw++ = msbf(grwchar(217)); // U + *pchw++ = msbf(grwchar(249)); // u // Output class 2: circumflex vowels m_prgichwOffsets[2] = 6 + 10; - *pchw++ = msbf(wchar(194)); // A - *pchw++ = msbf(wchar(226)); // a - *pchw++ = msbf(wchar(202)); // E - *pchw++ = msbf(wchar(234)); // e - *pchw++ = msbf(wchar(206)); // I - *pchw++ = msbf(wchar(238)); // i - *pchw++ = msbf(wchar(212)); // O - *pchw++ = msbf(wchar(244)); // o - *pchw++ = msbf(wchar(219)); // U - *pchw++ = msbf(wchar(251)); // u + *pchw++ = msbf(grwchar(194)); // A + *pchw++ = msbf(grwchar(226)); // a + *pchw++ = msbf(grwchar(202)); // E + *pchw++ = msbf(grwchar(234)); // e + *pchw++ = msbf(grwchar(206)); // I + *pchw++ = msbf(grwchar(238)); // i + *pchw++ = msbf(grwchar(212)); // O + *pchw++ = msbf(grwchar(244)); // o + *pchw++ = msbf(grwchar(219)); // U + *pchw++ = msbf(grwchar(251)); // u // Output class 3: diaeresis vowels, uppercase m_prgichwOffsets[3] = 16 + 10; - *pchw++ = msbf(wchar(196)); // A - *pchw++ = msbf(wchar(196)); // A - *pchw++ = msbf(wchar(203)); // E - *pchw++ = msbf(wchar(203)); // E - *pchw++ = msbf(wchar(207)); // I - *pchw++ = msbf(wchar(207)); // I - *pchw++ = msbf(wchar(214)); // O - *pchw++ = msbf(wchar(214)); // O - *pchw++ = msbf(wchar(220)); // U - *pchw++ = msbf(wchar(220)); // U + *pchw++ = msbf(grwchar(196)); // A + *pchw++ = msbf(grwchar(196)); // A + *pchw++ = msbf(grwchar(203)); // E + *pchw++ = msbf(grwchar(203)); // E + *pchw++ = msbf(grwchar(207)); // I + *pchw++ = msbf(grwchar(207)); // I + *pchw++ = msbf(grwchar(214)); // O + *pchw++ = msbf(grwchar(214)); // O + *pchw++ = msbf(grwchar(220)); // U + *pchw++ = msbf(grwchar(220)); // U // Input class 4: lowercase consonants b - h m_prgichwOffsets[4] = 26 + 10; // = 36 - *pchw++ = msbf(wchar(6)); - *pchw++ = msbf(wchar(4)); *pchw++ = msbf(wchar(2)); *pchw++ = msbf(wchar(6-4)); - *pchw++ = msbf(wchar(98)); *pchw++ = msbf(wchar(0)); - *pchw++ = msbf(wchar(99)); *pchw++ = msbf(wchar(1)); - *pchw++ = msbf(wchar(100)); *pchw++ = msbf(wchar(2)); - *pchw++ = msbf(wchar(102)); *pchw++ = msbf(wchar(3)); - *pchw++ = msbf(wchar(103)); *pchw++ = msbf(wchar(4)); - *pchw++ = msbf(wchar(104)); *pchw++ = msbf(wchar(5)); + *pchw++ = msbf(grwchar(6)); + *pchw++ = msbf(grwchar(4)); *pchw++ = msbf(grwchar(2)); *pchw++ = msbf(grwchar(6-4)); + *pchw++ = msbf(grwchar(98)); *pchw++ = msbf(grwchar(0)); + *pchw++ = msbf(grwchar(99)); *pchw++ = msbf(grwchar(1)); + *pchw++ = msbf(grwchar(100)); *pchw++ = msbf(grwchar(2)); + *pchw++ = msbf(grwchar(102)); *pchw++ = msbf(grwchar(3)); + *pchw++ = msbf(grwchar(103)); *pchw++ = msbf(grwchar(4)); + *pchw++ = msbf(grwchar(104)); *pchw++ = msbf(grwchar(5)); // Input class 5: vowels m_prgichwOffsets[5] = 36 + 4 + 6*2; // = 52 - *pchw++ = msbf(wchar(10)); - *pchw++ = msbf(wchar(8)); *pchw++ = msbf(wchar(3)); *pchw++ = msbf(wchar(10-8)); - *pchw++ = msbf(wchar(65)); *pchw++ = msbf(wchar(0)); // A - *pchw++ = msbf(wchar(69)); *pchw++ = msbf(wchar(2)); // E - *pchw++ = msbf(wchar(73)); *pchw++ = msbf(wchar(4)); // I - *pchw++ = msbf(wchar(79)); *pchw++ = msbf(wchar(6)); // O - *pchw++ = msbf(wchar(85)); *pchw++ = msbf(wchar(8)); // U - *pchw++ = msbf(wchar(97)); *pchw++ = msbf(wchar(1)); // a - *pchw++ = msbf(wchar(101)); *pchw++ = msbf(wchar(3)); // e - *pchw++ = msbf(wchar(105)); *pchw++ = msbf(wchar(5)); // i - *pchw++ = msbf(wchar(111)); *pchw++ = msbf(wchar(7)); // o - *pchw++ = msbf(wchar(117)); *pchw++ = msbf(wchar(9)); // u + *pchw++ = msbf(grwchar(10)); + *pchw++ = msbf(grwchar(8)); *pchw++ = msbf(grwchar(3)); *pchw++ = msbf(grwchar(10-8)); + *pchw++ = msbf(grwchar(65)); *pchw++ = msbf(grwchar(0)); // A + *pchw++ = msbf(grwchar(69)); *pchw++ = msbf(grwchar(2)); // E + *pchw++ = msbf(grwchar(73)); *pchw++ = msbf(grwchar(4)); // I + *pchw++ = msbf(grwchar(79)); *pchw++ = msbf(grwchar(6)); // O + *pchw++ = msbf(grwchar(85)); *pchw++ = msbf(grwchar(8)); // U + *pchw++ = msbf(grwchar(97)); *pchw++ = msbf(grwchar(1)); // a + *pchw++ = msbf(grwchar(101)); *pchw++ = msbf(grwchar(3)); // e + *pchw++ = msbf(grwchar(105)); *pchw++ = msbf(grwchar(5)); // i + *pchw++ = msbf(grwchar(111)); *pchw++ = msbf(grwchar(7)); // o + *pchw++ = msbf(grwchar(117)); *pchw++ = msbf(grwchar(9)); // u // Input class 6: acute vowels m_prgichwOffsets[6] = 52 + 4 + 10*2; // = 76 - *pchw++ = msbf(wchar(10)); - *pchw++ = msbf(wchar(8)); *pchw++ = msbf(wchar(3)); *pchw++ = msbf(wchar(10-8)); - *pchw++ = msbf(wchar(193)); *pchw++ = msbf(wchar(0)); // A - *pchw++ = msbf(wchar(201)); *pchw++ = msbf(wchar(2)); // E - *pchw++ = msbf(wchar(205)); *pchw++ = msbf(wchar(4)); // I - *pchw++ = msbf(wchar(211)); *pchw++ = msbf(wchar(6)); // O - *pchw++ = msbf(wchar(218)); *pchw++ = msbf(wchar(8)); // U - *pchw++ = msbf(wchar(225)); *pchw++ = msbf(wchar(1)); // a - *pchw++ = msbf(wchar(233)); *pchw++ = msbf(wchar(3)); // e - *pchw++ = msbf(wchar(237)); *pchw++ = msbf(wchar(5)); // i - *pchw++ = msbf(wchar(243)); *pchw++ = msbf(wchar(7)); // o - *pchw++ = msbf(wchar(250)); *pchw++ = msbf(wchar(9)); // u + *pchw++ = msbf(grwchar(10)); + *pchw++ = msbf(grwchar(8)); *pchw++ = msbf(grwchar(3)); *pchw++ = msbf(grwchar(10-8)); + *pchw++ = msbf(grwchar(193)); *pchw++ = msbf(grwchar(0)); // A + *pchw++ = msbf(grwchar(201)); *pchw++ = msbf(grwchar(2)); // E + *pchw++ = msbf(grwchar(205)); *pchw++ = msbf(grwchar(4)); // I + *pchw++ = msbf(grwchar(211)); *pchw++ = msbf(grwchar(6)); // O + *pchw++ = msbf(grwchar(218)); *pchw++ = msbf(grwchar(8)); // U + *pchw++ = msbf(grwchar(225)); *pchw++ = msbf(grwchar(1)); // a + *pchw++ = msbf(grwchar(233)); *pchw++ = msbf(grwchar(3)); // e + *pchw++ = msbf(grwchar(237)); *pchw++ = msbf(grwchar(5)); // i + *pchw++ = msbf(grwchar(243)); *pchw++ = msbf(grwchar(7)); // o + *pchw++ = msbf(grwchar(250)); *pchw++ = msbf(grwchar(9)); // u m_prgichwOffsets[7] = 76 + 4 + 10*2; // = 100 }; Index: GrClassTable.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrClassTable.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GrClassTable.h 14 Apr 2003 21:34:28 -0000 1.4 +++ GrClassTable.h 16 Apr 2003 19:59:42 -0000 1.5 @@ -30,11 +30,11 @@ friend class GrInputClass; friend class GrClassTable; - wchar GlyphID() { return lsbf(m_gidBIG); } - wchar Index() { return lsbf(m_nBIGIndex); } + grwchar GlyphID() { return lsbf(m_gidBIG); } + grwchar Index() { return lsbf(m_nBIGIndex); } - wchar m_gidBIG; - wchar m_nBIGIndex; + grwchar m_gidBIG; + grwchar m_nBIGIndex; }; /*---------------------------------------------------------------------------------------------- @@ -51,9 +51,9 @@ /*------------------------------------------------------------------------------------------ Copy the raw memory into the instance. ------------------------------------------------------------------------------------------*/ - void CopyFrom(wchar * pchwStart, int cchw) + void CopyFrom(grwchar * pchwStart, int cchw) { - memcpy(this, pchwStart, 4 * isizeof(wchar)); + memcpy(this, pchwStart, 4 * isizeof(grwchar)); int cgix = NumberOfGlyphs(); m_pgixFirst = m_prggixBuffer; if (cgix > 64) @@ -73,18 +73,18 @@ int InitialSearchRange() { return lsbf(m_digixBIGInit); } int StartSearch() { return lsbf(m_igixBIGStart); } - int FindIndex(wchar gid); + int FindIndex(grwchar gid); protected: // Instance variables: - wchar m_cgixBIG; // number of glyphs in the class + grwchar m_cgixBIG; // number of glyphs in the class // constants for fast binary search - wchar m_digixBIGInit; // (max power of 2 <= m_cgix); + grwchar m_digixBIGInit; // (max power of 2 <= m_cgix); // size of initial range to consider - wchar m_cBIGLoop; // log2(max power of 2 <= m_cgix); + grwchar m_cBIGLoop; // log2(max power of 2 <= m_cgix); // indicates how many iterations are necessary - wchar m_igixBIGStart; // m_cgix - m_digixInit; + grwchar m_igixBIGStart; // m_cgix - m_digixInit; // where to start search GrGlyphIndexPair m_prggixBuffer[64]; @@ -124,14 +124,14 @@ void ReadFromFont(GrIStream & grstrm, int nVersion); void CreateEmpty(); - int FindIndex(int icls, wchar chwGlyphID); - wchar GetGlyphID(int icls, int ichw); + int FindIndex(int icls, grwchar chwGlyphID); + grwchar GetGlyphID(int icls, int ichw); - wchar GlyphAt(int ichw) + grwchar GlyphAt(int ichw) { return lsbf(m_prgchwBIGGlyphList[ichw]); } - wchar * GlyphListLoc(int ichw) + grwchar * GlyphListLoc(int ichw) { return m_prgchwBIGGlyphList + ichw; } @@ -141,7 +141,7 @@ int m_ccls; // number of classes int m_cclsLinear; // number of classes in linear format - wchar * m_prgichwOffsets; + grwchar * m_prgichwOffsets; // Two formats are included in the following array: the first section consists of // flat ordered lists of glyphs, used for the "output" classes that use linear format. @@ -153,7 +153,7 @@ // we're interested in it. // NOTE that all this data has been slurped directly from the ECF file and therefore // uses BIG-ENDIAN format. - wchar * m_prgchwBIGGlyphList; + grwchar * m_prgchwBIGGlyphList; //:Ignore #ifdef OLD_TEST_STUFF Index: GrEngine.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrEngine.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- GrEngine.cpp 14 Apr 2003 22:52:00 -0000 1.8 +++ GrEngine.cpp 16 Apr 2003 19:59:43 -0000 1.9 @@ -135,12 +135,12 @@ { ChkGrArrayArg(prgb, cb); - if (cb % isizeof(wchar)) + if (cb % isizeof(grwchar)) WARN(kresInvalidArg); DestroyContents(); - m_stuInitialize.Assign((const wchar *)prgb, cb / isizeof(wchar)); + m_stuInitialize.Assign((const grwchar *)prgb, cb / isizeof(grwchar)); m_strCtrlFileReg.Clear(); m_strCtrlFileBold.Clear(); @@ -1206,10 +1206,10 @@ if (vbName[lnNameOff + 1] == (unsigned char)0xF0) // 1 - Unicode id is big endian ReturnResult(kresFail); } - if (!TtfUtil::SwapWString(vbName.Begin() + lnNameOff, lnNameSz / isizeof(wchar))) + if (!TtfUtil::SwapWString(vbName.Begin() + lnNameOff, lnNameSz / isizeof(grwchar))) ReturnResult(kresFail); - m_stuFaceName = StrUni((wchar *)(vbName.Begin() + lnNameOff), lnNameSz / isizeof(wchar)); + m_stuFaceName = StrUni((grwchar *)(vbName.Begin() + lnNameOff), lnNameSz / isizeof(grwchar)); */ // head - need units per em @@ -1505,10 +1505,10 @@ if (vbName[lnNameOff + 1] == (unsigned char)0xF0) // 1 - Unicode id is big endian ReturnResult(kresFail); } - if (!TtfUtil::SwapWString(vbName.Begin() + lnNameOff, lnNameSz / isizeof(wchar))) + if (!TtfUtil::SwapWString(vbName.Begin() + lnNameOff, lnNameSz / isizeof(grwchar))) ReturnResult(kresFail); - m_stuFaceName = StrUni((wchar *)(vbName.Begin() + lnNameOff), lnNameSz / isizeof(wchar)); + m_stuFaceName = StrUni((grwchar *)(vbName.Begin() + lnNameOff), lnNameSz / isizeof(grwchar)); */ // Silf @@ -1634,37 +1634,43 @@ { int nCurrentVersion = CurrentTableVersion(); - GrFileIStream * pgrfstrm = dynamic_cast<GrFileIStream *>(pgrstrm); - GrBufferIStream * pgrbstrm = dynamic_cast<GrBufferIStream *>(pgrstrm); - Assert(pgrfstrm || pgrbstrm); +// GrFileIStream * pgrfstrm = dynamic_cast<GrFileIStream *>(pgrstrm); +// GrBufferIStream * pgrbstrm = dynamic_cast<GrBufferIStream *>(pgrstrm); +// Assert(pgrfstrm || pgrbstrm); - if (pgrbstrm) - pgrbstrm->OpenBuffer(vbSilfTbl.Begin(), isizeof(int)); // just reading one int +// if (pgrbstrm) +// pgrbstrm->OpenBuffer(vbSilfTbl.Begin(), isizeof(int)); // just reading one int + pgrstrm->OpenBuffer(vbSilfTbl.Begin(), isizeof(int)); pgrstrm->SetPositionInFont(lSilfStart); *pnVersion = ReadVersion(*pgrstrm); - if (pgrbstrm) - pgrbstrm->Close(); +// if (pgrbstrm) +// pgrbstrm->Close(); + pgrstrm->CloseBuffer(); if (*pnVersion > nCurrentVersion) return false; - if (pgrbstrm) - pgrbstrm->OpenBuffer(vbGlatTbl.Begin(), isizeof(int)); +// if (pgrbstrm) +// pgrbstrm->OpenBuffer(vbGlatTbl.Begin(), isizeof(int)); + pgrstrm->OpenBuffer(vbGlatTbl.Begin(), isizeof(int)); pgrstrm->SetPositionInFont(lGlocStart); *pnVersion = ReadVersion(*pgrstrm); - if (pgrbstrm) - pgrbstrm->Close(); +// if (pgrbstrm) +// pgrbstrm->Close(); + pgrstrm->CloseBuffer(); if (*pnVersion > nCurrentVersion) { Assert(false); // should match Silf table return false; } - if (pgrbstrm) - pgrbstrm->OpenBuffer(vbFeatTbl.Begin(), isizeof(int)); +// if (pgrbstrm) +// pgrbstrm->OpenBuffer(vbFeatTbl.Begin(), isizeof(int)); + pgrstrm->OpenBuffer(vbFeatTbl.Begin(), isizeof(int)); pgrstrm->SetPositionInFont(lFeatStart); *pnVersion = ReadVersion(*pgrstrm); - if (pgrbstrm) - pgrbstrm->Close(); +// if (pgrbstrm) +// pgrbstrm->Close(); + pgrstrm->CloseBuffer(); if (*pnVersion > nCurrentVersion) { Assert(false); // should match Silf table @@ -1675,6 +1681,17 @@ } /*---------------------------------------------------------------------------------------------- + Reinterpret the version number from a font table. +----------------------------------------------------------------------------------------------*/ +int GrEngine::ReadVersion(GrIStream & grstrm) +{ + int nVersion = grstrm.ReadIntFromFont(); + if (nVersion == 0x00010000) + nVersion = 0x00000001; // kludge for silly mistake + return nVersion; +} + +/*---------------------------------------------------------------------------------------------- Initialize the engine from the test file. Used for test procedures. ----------------------------------------------------------------------------------------------*/ //:Ignore @@ -1848,7 +1865,7 @@ grstrm.GetPositionInFont(&lSubTableStart); // maximum glyph ID - wchar chwTmp; + grwchar chwTmp; chwTmp = grstrm.ReadUShortFromFont(); *pchwMaxGlyphID = chwTmp; @@ -1902,7 +1919,7 @@ // rendering behaviors--ignore for now byte cBehaviors = grstrm.ReadByteFromFont(); - wchar chwBehaviors[kMaxRenderingBehavior]; + grwchar chwBehaviors[kMaxRenderingBehavior]; for (i = 0; i < cBehaviors; i++) { chwBehaviors[i] = grstrm.ReadUShortFromFont(); @@ -1936,7 +1953,7 @@ { if (nVersion <= 1) { - wchar chwUnicode = grstrm.ReadUShortFromFont(); + grwchar chwUnicode = grstrm.ReadUShortFromFont(); m_prgpsd[i].SetUnicode(chwUnicode); } else @@ -1944,7 +1961,7 @@ int nUnicode = grstrm.ReadIntFromFont(); m_prgpsd[i].SetUnicode(nUnicode); } - wchar chwPseudo = grstrm.ReadUShortFromFont(); + grwchar chwPseudo = grstrm.ReadUShortFromFont(); m_prgpsd[i].SetPseudoGlyph(chwPseudo); } @@ -2045,7 +2062,7 @@ void GrEngine::ReadFeatTable(GrIStream & grstrm, long lTableStart) { short snTmp; - wchar chwTmp; + grwchar chwTmp; int nTmp; grstrm.SetPositionInFont(lTableStart); @@ -2076,7 +2093,7 @@ nID = chwTmp; vnIDs.Push(nID); // number of settings - wchar cfset = grstrm.ReadUShortFromFont(); + grwchar cfset = grstrm.ReadUShortFromFont(); vcfset.Push(cfset); // offset to settings list nTmp = grstrm.ReadIntFromFont(); @@ -2142,14 +2159,14 @@ bool fLineBreakSave = m_fLineBreak; int cchwPreXlbContextSave = m_cchwPreXlbContext; int cchwPostXlbContextSave = m_cchwPostXlbContext; - wchar chwPseudoAttrSave = m_chwPseudoAttr; - wchar chwBWAttrSave = m_chwBWAttr; - wchar chwDirAttrSave = m_chwDirAttr; + grwchar chwPseudoAttrSave = m_chwPseudoAttr; + grwchar chwBWAttrSave = m_chwBWAttr; + grwchar chwDirAttrSave = m_chwDirAttr; int cComponentsSave = m_cComponents; int cnUserDefnSave = m_cnUserDefn; int cnCompPerLigSave = m_cnCompPerLig; int grfsdcSave = m_grfsdc; - wchar chwLBGlyphIDSave = m_chwLBGlyphID; + grwchar chwLBGlyphIDSave = m_chwLBGlyphID; int cpsdSave = m_cpsd; int dipsdInitSave = m_dipsdInit; int cPsdLoopSave = m_cPsdLoop; @@ -2224,9 +2241,9 @@ /*---------------------------------------------------------------------------------------------- Return the glyph ID for the given Unicode value. ----------------------------------------------------------------------------------------------*/ -wchar GrEngine::GetGlyphIDFromUnicode(int nUnicode) +grwchar GrEngine::GetGlyphIDFromUnicode(int nUnicode) { - wchar chwGlyphID = MapToPseudo(nUnicode); + grwchar chwGlyphID = MapToPseudo(nUnicode); if (chwGlyphID != 0) return chwGlyphID; // return a pseudo-glyph @@ -2249,7 +2266,7 @@ /*---------------------------------------------------------------------------------------------- Return the pseudo-glyph corresponding to the given Unicode input, or 0 if none. ----------------------------------------------------------------------------------------------*/ -wchar GrEngine::MapToPseudo(int nUnicode) +grwchar GrEngine::MapToPseudo(int nUnicode) { if (m_cpsd == 0) return 0; @@ -2294,9 +2311,9 @@ is just the glyph ID we're already working with, but for pseudo-glyphs it will something different. ----------------------------------------------------------------------------------------------*/ -wchar GrEngine::ActualGlyphForOutput(wchar chwGlyphID) +grwchar GrEngine::ActualGlyphForOutput(grwchar chwGlyphID) { - wchar chwActual = GlyphAttrValue(chwGlyphID, m_chwPseudoAttr); + grwchar chwActual = GlyphAttrValue(chwGlyphID, m_chwPseudoAttr); if (chwActual == 0) return chwGlyphID; // not a pseudo, we're already working with the actual glyph ID else @@ -2326,8 +2343,8 @@ } } - int cchw = (lSize / isizeof(wchar)) + 1; - wchar * pchwName = NewObj wchar[cchw]; // lSize - byte count for Uni str + int cchw = (lSize / isizeof(grwchar)) + 1; + grwchar * pchwName = NewObj grwchar[cchw]; // lSize - byte count for Uni str memcpy(pchwName, (BYTE *)m_pNameTbl + lOffset, lSize); pchwName[cchw - 1] = 0; // zero terminate if (TtfUtil::SwapWString(pchwName, cchw - 1)) @@ -2413,7 +2430,7 @@ ----------------------------------------------------------------------------------------------*/ void GrEngine::InitSlot(GrSlotState * pslot) { - wchar chwGlyphID = pslot->GlyphID(); + grwchar chwGlyphID = pslot->GlyphID(); if (m_pgtbl) { // Initialize from glyph table @@ -2478,17 +2495,17 @@ /*---------------------------------------------------------------------------------------------- Methods to pass on to the tables. ----------------------------------------------------------------------------------------------*/ -wchar GrEngine::GetClassGlyphIDAt(int nClass, int nIndex) +grwchar GrEngine::GetClassGlyphIDAt(int nClass, int nIndex) { return m_pctbl->GetGlyphID(nClass, nIndex); } -int GrEngine::GetIndexInGlyphClass(int nClass, wchar chwGlyphID) +int GrEngine::GetIndexInGlyphClass(int nClass, grwchar chwGlyphID) { return m_pctbl->FindIndex(nClass, chwGlyphID); } -int GrEngine::GlyphAttrValue(wchar chwGlyphID, int nAttrID) +int GrEngine::GlyphAttrValue(grwchar chwGlyphID, int nAttrID) { #ifdef OLD_TEST_STUFF if (!m_pgtbl) // test procedures @@ -2498,7 +2515,7 @@ return m_pgtbl->GlyphAttrValue(chwGlyphID, nAttrID); } -int GrEngine::ComponentIndexForGlyph(wchar chwGlyphID, int nCompID) +int GrEngine::ComponentIndexForGlyph(grwchar chwGlyphID, int nCompID) { #ifdef OLD_TEST_STUFF if (!m_pgtbl) // test procedures Index: GrFSM.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrFSM.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrFSM.cpp 14 Apr 2003 21:34:29 -0000 1.3 +++ GrFSM.cpp 16 Apr 2003 19:59:50 -0000 1.4 @@ -79,8 +79,8 @@ } // rule map and offsets (extra item at end gives final offset, ie, total) - m_prgirulnMin = NewObj wchar[crowSuccess + 1]; - wchar * pchw = m_prgirulnMin; + m_prgirulnMin = NewObj grwchar[crowSuccess + 1]; + grwchar * pchw = m_prgirulnMin; int i; for (i = 0; i < (crowSuccess + 1); i++, pchw++) { @@ -93,7 +93,7 @@ // than one state. int crulInMap = m_prgirulnMin[crowSuccess]; - m_prgrulnMatched = NewObj wchar[crulInMap]; + m_prgrulnMatched = NewObj grwchar[crulInMap]; pchw = m_prgrulnMatched; for (i = 0; i < crulInMap; i++, pchw++) { @@ -289,7 +289,7 @@ return (prowTop - prgrowAccepting); // Get next glyph. - wchar chwGlyphID = (cslot < 0) ? + grwchar chwGlyphID = (cslot < 0) ? psstrmOut->PeekBack(cslot)->GlyphID() : psstrmIn->Peek(cslot)->GlyphID(); @@ -348,7 +348,7 @@ // no more input return (prowTop - prgrowAccepting); - wchar chwGlyphID = psstrmIn->Peek(cslot)->GlyphID(); + grwchar chwGlyphID = psstrmIn->Peek(cslot)->GlyphID(); int col = FindColumn(chwGlyphID); short cellValue = *(m_prgprgrowXitions + ichwRowOffset + col); @@ -444,7 +444,7 @@ Search for the class range containing the glyph ID, and return the matching FSM column. Does a fast binary search that uses only shifts, no division. ----------------------------------------------------------------------------------------------*/ -int GrFSM::FindColumn(wchar chwGlyphID) +int GrFSM::FindColumn(grwchar chwGlyphID) { #ifdef _DEBUG // Check that the pre-calculated constants are correct. Index: GrFSM.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrFSM.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrFSM.h 14 Apr 2003 21:34:29 -0000 1.3 +++ GrFSM.h 16 Apr 2003 19:59:52 -0000 1.4 @@ -37,9 +37,9 @@ friend class GrFSM; protected: - wchar m_chwFirst; // first glyph ID in range - wchar m_chwLast; // last glyph ID in range - wchar m_col; // column (machine class) to which this range maps + grwchar m_chwFirst; // first glyph ID in range + grwchar m_chwLast; // last glyph ID in range + grwchar m_col; // column (machine class) to which this range maps }; /*---------------------------------------------------------------------------------------------- @@ -152,7 +152,7 @@ } protected: - int FindColumn(wchar chwGlyphID); + int FindColumn(grwchar chwGlyphID); protected: // Instance variables: int m_crow; // number of rows (states) @@ -162,11 +162,11 @@ int m_ccol; // number of columns (machine classes) - wchar * m_prgirulnMin; // m_crow-m_crowNonAcpt+1 of these; + grwchar * m_prgirulnMin; // m_crow-m_crowNonAcpt+1 of these; // index within m_prgrulnMatched, start of matched // rules for each accepting state - wchar * m_prgrulnMatched; // long ordered list of rule indices matched by + grwchar * m_prgrulnMatched; // long ordered list of rule indices matched by // subsequent states; total length is sum of number // of rules matched for each accepting state @@ -180,15 +180,15 @@ short * m_prgrowTransitions; // ((m_crow-m_crowFinal) * m_ccol) of these // debugger string offsets - wchar * m_prgibStateDebug; // for transition states; (m_crow-m_crul+1) of these + grwchar * m_prgibStateDebug; // for transition states; (m_crow-m_crul+1) of these // constants for fast binary search; these are generated by the compiler so that the // engine doesn't have to take time to do it - wchar m_dimcrInit; // (max power of 2 <= m_cmcr); + grwchar m_dimcrInit; // (max power of 2 <= m_cmcr); // size of initial range to consider - wchar m_cLoop; // log2(max power of 2 <= m_cmcr); + grwchar m_cLoop; // log2(max power of 2 <= m_cmcr); // indicates how many iterations are necessary - wchar m_imcrStart; // m_cmcr - m_dimcrInit; + grwchar m_imcrStart; // m_cmcr - m_dimcrInit; // where to start search int m_cmcr; // number of machine-class-ranges Index: GrGlyphTable.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrGlyphTable.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GrGlyphTable.cpp 14 Apr 2003 21:34:30 -0000 1.2 +++ GrGlyphTable.cpp 16 Apr 2003 19:59:52 -0000 1.3 @@ -124,7 +124,7 @@ /*---------------------------------------------------------------------------------------------- Initialization. ----------------------------------------------------------------------------------------------*/ -void GrGlyphSubTable::Initialize(int nVersion, wchar chwFlags, int cGlyphs, int cAttrs, +void GrGlyphSubTable::Initialize(int nVersion, grwchar chwFlags, int cGlyphs, int cAttrs, int cnCompPerLig) { m_nVersion = nVersion; @@ -144,7 +144,7 @@ if (m_fHasDebugStrings) { - m_prgibBIGGlyphAttrDebug = NewObj wchar[cAttrs + 1]; + m_prgibBIGGlyphAttrDebug = NewObj grwchar[cAttrs + 1]; } // Make a cache to hold a list of defined components for each glyph. This is @@ -161,7 +161,7 @@ /*---------------------------------------------------------------------------------------------- Return the attribute value for the given glyph. ----------------------------------------------------------------------------------------------*/ -int GrGlyphSubTable::GlyphAttrValue(wchar chwGlyphID, int nAttrID) +int GrGlyphSubTable::GlyphAttrValue(grwchar chwGlyphID, int nAttrID) { if (m_nAttrIDLim == 0) { @@ -204,7 +204,7 @@ else if (gatrun.m_bMinAttrID + gatrun.m_cAttrs > bAttrID) { // Found the value in this run. - wchar chw = lsbf(gatrun.m_rgchwBIGValues[bAttrID - gatrun.m_bMinAttrID]); + grwchar chw = lsbf(gatrun.m_rgchwBIGValues[bAttrID - gatrun.m_bMinAttrID]); if ((chw & 0x8000) == 0) return (int)chw; else @@ -227,7 +227,7 @@ defined for this glyph. CURRENTLY NOT USED ----------------------------------------------------------------------------------------------*/ -int GrGlyphSubTable::ComponentContainingPoint(wchar chwGlyphID, int x, int y) +int GrGlyphSubTable::ComponentContainingPoint(grwchar chwGlyphID, int x, int y) { int i = CalculateDefinedComponents(chwGlyphID); for (int inComp = 0; inComp < m_cnCompPerLig; inComp++) @@ -274,7 +274,7 @@ - return values, in source device coordinates ----------------------------------------------------------------------------------------------*/ bool GrGlyphSubTable::ComponentBoxLogUnits(IGrGraphics * pgg, - wchar chwGlyphID, int icomp, int mFontEmUnits, int dysFontAscent, + grwchar chwGlyphID, int icomp, int mFontEmUnits, int dysFontAscent, int * pxsLeft, int * pysTop, int * pxsRight, int * pysBottom) { int i = CalculateDefinedComponents(chwGlyphID); @@ -342,7 +342,7 @@ TODO: With the current implementation that stores the glyph ids in each slot, this mechanism is redundant and obsolete, and should be removed. ----------------------------------------------------------------------------------------------*/ -int GrGlyphSubTable::CalculateDefinedComponents(wchar chwGlyphID) +int GrGlyphSubTable::CalculateDefinedComponents(grwchar chwGlyphID) { // The first item is a flag indicating whether the list has been calculated; hence // the "+1" in the expresson below. @@ -375,7 +375,7 @@ @param nAttrID - the attribute of interest, assumed to be a component glyph attribute (eg. component.e.top) ----------------------------------------------------------------------------------------------*/ -bool GrGlyphSubTable::ComponentIsDefined(wchar chwGlyphID, int nAttrID) +bool GrGlyphSubTable::ComponentIsDefined(grwchar chwGlyphID, int nAttrID) { Assert(nAttrID < m_cComponents); if (nAttrID >= m_cComponents) @@ -390,7 +390,7 @@ For instance, given the glyph ID "oe" (the oe ligature) and the attr ID for component.o, the result would be 0; for component.e the result would be 1. ----------------------------------------------------------------------------------------------*/ -int GrGlyphSubTable::ComponentIndexForGlyph(wchar chwGlyphID, int nCompID) +int GrGlyphSubTable::ComponentIndexForGlyph(grwchar chwGlyphID, int nCompID) { int i = CalculateDefinedComponents(chwGlyphID); @@ -405,7 +405,7 @@ /*---------------------------------------------------------------------------------------------- Return the ID of the nth defined component attribute for the given glyph. ----------------------------------------------------------------------------------------------*/ -//int GrGlyphSubTable::NthComponentID(wchar chwGlyphID, int n) +//int GrGlyphSubTable::NthComponentID(grwchar chwGlyphID, int n) //{ // int i = CalculateDefinedComponents(chwGlyphID); // return m_pnComponents[i + 1 + n]; @@ -435,7 +435,7 @@ /*********************************************************************************************** TODO: This method is BROKEN because m_prgibBIGAttrValues has been changed. It is no - longer a wchar *. The Gloc table can contain 16-bit or 32-bit entries and must be + longer a grwchar *. The Gloc table can contain 16-bit or 32-bit entries and must be accessed accordingly. ***********************************************************************************************/ void GrGlyphSubTable::SetUpTestData() @@ -443,12 +443,12 @@ m_pgatbl = NewObj GrGlyphAttrTable(); m_pgatbl->Initialize(0, 48); - m_prgibBIGAttrValues[0] = (byte)msbf(wchar(0)); - m_prgibBIGAttrValues[1] = (byte)msbf(wchar(6)); - m_prgibBIGAttrValues[2] = (byte)msbf(wchar(20)); - m_prgibBIGAttrValues[3] = (byte)msbf(wchar(20)); - m_prgibBIGAttrValues[4] = (byte)msbf(wchar(40)); - m_prgibBIGAttrValues[5] = (byte)msbf(wchar(48)); + m_prgibBIGAttrValues[0] = (byte)msbf(grwchar(0)); + m_prgibBIGAttrValues[1] = (byte)msbf(grwchar(6)); + m_prgibBIGAttrValues[2] = (byte)msbf(grwchar(20)); + m_prgibBIGAttrValues[3] = (byte)msbf(grwchar(20)); + m_prgibBIGAttrValues[4] = (byte)msbf(grwchar(40)); + m_prgibBIGAttrValues[5] = (byte)msbf(grwchar(48)); m_pgatbl->SetUpTestData(); } @@ -499,23 +499,23 @@ // Glyph 0 gatrun.m_bMinAttrID = 1; gatrun.m_cAttrs = 2; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(11)); - gatrun.m_rgchwBIGValues[1] = msbf(wchar(22)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(11)); + gatrun.m_rgchwBIGValues[1] = msbf(grwchar(22)); memcpy(pbBIG, &gatrun, 6); pbBIG += 6; // Glyph 1 gatrun.m_bMinAttrID = 0; gatrun.m_cAttrs = 3; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(5)); - gatrun.m_rgchwBIGValues[1] = msbf(wchar(6)); - gatrun.m_rgchwBIGValues[2] = msbf(wchar(7)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(5)); + gatrun.m_rgchwBIGValues[1] = msbf(grwchar(6)); + gatrun.m_rgchwBIGValues[2] = msbf(grwchar(7)); memcpy(pbBIG, &gatrun, 8); pbBIG += 8; gatrun.m_bMinAttrID = 8; gatrun.m_cAttrs = 2; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(8)); - gatrun.m_rgchwBIGValues[1] = msbf(wchar(9)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(8)); + gatrun.m_rgchwBIGValues[1] = msbf(grwchar(9)); memcpy(pbBIG, &gatrun, 6); pbBIG += 6; @@ -524,36 +524,36 @@ // Glyph 3 gatrun.m_bMinAttrID = 1; gatrun.m_cAttrs = 1; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(111)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(111)); memcpy(pbBIG, &gatrun, 4); pbBIG += 4; gatrun.m_bMinAttrID = 3; gatrun.m_cAttrs = 1; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(333)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(333)); memcpy(pbBIG, &gatrun, 4); pbBIG += 4; gatrun.m_bMinAttrID = 5; gatrun.m_cAttrs = 1; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(555)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(555)); memcpy(pbBIG, &gatrun, 4); pbBIG += 4; gatrun.m_bMinAttrID = 7; gatrun.m_cAttrs = 1; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(777)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(777)); memcpy(pbBIG, &gatrun, 4); pbBIG += 4; gatrun.m_bMinAttrID = 9; gatrun.m_cAttrs = 1; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(999)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(999)); memcpy(pbBIG, &gatrun, 4); pbBIG += 4; // Glyph 4 gatrun.m_bMinAttrID = 5; gatrun.m_cAttrs = 3; - gatrun.m_rgchwBIGValues[0] = msbf(wchar(4)); - gatrun.m_rgchwBIGValues[1] = msbf(wchar(4)); - gatrun.m_rgchwBIGValues[2] = msbf(wchar(4)); + gatrun.m_rgchwBIGValues[0] = msbf(grwchar(4)); + gatrun.m_rgchwBIGValues[1] = msbf(grwchar(4)); + gatrun.m_rgchwBIGValues[2] = msbf(grwchar(4)); memcpy(pbBIG, &gatrun, 8); pbBIG += 8; Index: GrGlyphTable.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrGlyphTable.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GrGlyphTable.h 7 Nov 2002 13:59:51 -0000 1.2 +++ GrGlyphTable.h 16 Apr 2003 19:59:52 -0000 1.3 @@ -70,18 +70,18 @@ // Removed from release build for optimization memset(m_rgchwBIGValues, 0, isizeof(m_rgchwBIGValues)); #endif - memcpy(m_rgchwBIGValues, pbBIGEnt + 2, (m_cAttrs * isizeof(wchar))); + memcpy(m_rgchwBIGValues, pbBIGEnt + 2, (m_cAttrs * isizeof(grwchar))); } int ByteCount() { - return (2 + (m_cAttrs * isizeof(wchar))); + return (2 + (m_cAttrs * isizeof(grwchar))); } protected: byte m_bMinAttrID; // ID of first attribute in the run byte m_cAttrs; // number of attributes in the run - wchar m_rgchwBIGValues[kMaxAttrsPerRun]; + grwchar m_rgchwBIGValues[kMaxAttrsPerRun]; }; /*---------------------------------------------------------------------------------------------- @@ -168,7 +168,7 @@ // Initialization: void ReadFromFont(GrIStream & grstrm, int cGlyphs, long lGlatStart); - void Initialize(int nVersion, wchar chwFlags, int cGlyphs, int cAttrs, int cnCompPerLig); + void Initialize(int nVersion, grwchar chwFlags, int cGlyphs, int cAttrs, int cnCompPerLig); void CreateEmpty(); @@ -180,30 +180,30 @@ // General: int NumberOfGlyphAttrs() { return m_nAttrIDLim; } // 0..(m_nAttrIDLim-1) - int GlyphAttrValue(wchar chwGlyphID, int nAttrID); + int GlyphAttrValue(grwchar chwGlyphID, int nAttrID); // Ligatures: - int ComponentContainingPoint(wchar chwGlyphID, int x, int y); - bool ComponentBoxLogUnits(IGrGraphics * pgg, wchar chwGlyphID, int icomp, + int ComponentContainingPoint(grwchar chwGlyphID, int x, int y); + bool ComponentBoxLogUnits(IGrGraphics * pgg, grwchar chwGlyphID, int icomp, int mFontEmUnits, int dysAscent, int * pxsLeft, int * pysTop, int * pxsRight, int * pysBottom); protected: - int CalculateDefinedComponents(wchar chwGlyphID); - bool ComponentIsDefined(wchar chwGlyphID, int nAttrID); - int ComponentIndexForGlyph(wchar chwGlyphID, int nCompID); -// int NthComponentID(wchar chwGlyphID, int n); + int CalculateDefinedComponents(grwchar chwGlyphID); + bool ComponentIsDefined(grwchar chwGlyphID, int nAttrID); + int ComponentIndexForGlyph(grwchar chwGlyphID, int nCompID); +// int NthComponentID(grwchar chwGlyphID, int n); public: // Flags: - bool LongFormat(wchar chwFlags) // 32-bit values? + bool LongFormat(grwchar chwFlags) // 32-bit values? { return ((chwFlags & 0x01) == 0x01); // bit 0 } - bool HasAttrNames(wchar chwFlags) + bool HasAttrNames(grwchar chwFlags) { return ((chwFlags & 0x02) == 0x02); // bit 1 } - int GlocLookup(wchar chwGlyphId) + int GlocLookup(grwchar chwGlyphId) { if (m_fGlocShort) { @@ -228,7 +228,7 @@ GrGlyphAttrTable * m_pgatbl; byte * m_prgibBIGAttrValues; // byte offsets for glyph attr values bool m_fGlocShort; // flag for Gloc table format - wchar * m_prgibBIGGlyphAttrDebug; // byte offsets for glyph attr debug strings + grwchar * m_prgibBIGGlyphAttrDebug; // byte offsets for glyph attr debug strings int * m_prgnDefinedComponents; // for each glyph, cache list of component attributes that // are defined @@ -313,30 +313,30 @@ return m_vpgstbl[0]->NumberOfGlyphAttrs(); } - int GlyphAttrValue(wchar chwGlyphID, int nAttrID) + int GlyphAttrValue(grwchar chwGlyphID, int nAttrID) { Assert(m_cgstbl == 1); return m_vpgstbl[0]->GlyphAttrValue(chwGlyphID, nAttrID); } // Eventually: - //int GlyphAttrValue(wchar chwGlyphID, int nAttrID, int nStyleIndex) + //int GlyphAttrValue(grwchar chwGlyphID, int nAttrID, int nStyleIndex) //{ // return m_vpgstbl[nStyleIndex]->GlyphAttrValue(chwGlyphID, nAttrID); //} - int ComponentContainingPoint(wchar chwGlyphID, int x, int y) + int ComponentContainingPoint(grwchar chwGlyphID, int x, int y) { Assert(m_cgstbl == 1); return m_vpgstbl[0]->ComponentContainingPoint(chwGlyphID, x, y); } // Eventually: - //int ComponentContainingPoint(wchar chwGlyphID, int nStyleIndex, int x, int y) + //int ComponentContainingPoint(grwchar chwGlyphID, int nStyleIndex, int x, int y) //{ // Assert(m_cgstbl == 1); // return m_vpgstbl[nStyleIndex]->ComponentContainingPoint(chwGlyphID, nAttrID); //} - bool ComponentBoxLogUnits(IGrGraphics * pgg, wchar chwGlyphID, int icomp, + bool ComponentBoxLogUnits(IGrGraphics * pgg, grwchar chwGlyphID, int icomp, int mFontEmUnits, int dysAscent, int * pxsLeft, int * pysTop, int * pxsRight, int * pysBottom) { @@ -345,7 +345,7 @@ pxsLeft, pysTop, pxsRight, pysBottom); } - int ComponentIndexForGlyph(wchar chwGlyphID, int nCompID) + int ComponentIndexForGlyph(grwchar chwGlyphID, int nCompID) { Assert(m_cgstbl == 1); return m_vpgstbl[0]->ComponentIndexForGlyph(chwGlyphID, nCompID); Index: GrPass.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrPass.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GrPass.cpp 14 Apr 2003 21:34:30 -0000 1.5 +++ GrPass.cpp 16 Apr 2003 19:59:52 -0000 1.6 @@ -138,8 +138,8 @@ m_pfsm->ReadFromFont(grstrm, nVersion); // rule sort keys - m_prgchwRuleSortKeys = NewObj wchar[m_crul]; - wchar * pchw = m_prgchwRuleSortKeys; + m_prgchwRuleSortKeys = NewObj grwchar[m_crul]; + grwchar * pchw = m_prgchwRuleSortKeys; int irul; for (irul = 0; irul < m_crul; irul++, pchw++) { @@ -164,14 +164,14 @@ m_cbPassConstraint = 0; // constraint and action offsets for rules - m_prgibConstraintStart = NewObj wchar[m_crul + 1]; + m_prgibConstraintStart = NewObj grwchar[m_crul + 1]; pchw = m_prgibConstraintStart; for (irul = 0; irul <= m_crul; irul++, pchw++) { *pchw = grstrm.ReadUShortFromFont(); } - m_prgibActionStart = NewObj wchar[m_crul + 1]; + m_prgibActionStart = NewObj grwchar[m_crul + 1]; pchw = m_prgibActionStart; for (irul = 0; irul <= m_crul; irul++, pchw++) { @@ -241,7 +241,7 @@ NeededToResync() - psstrmOut->WritePos()); int cslotGot = 0; - wchar chwLB = ptman->LBGlyphID(); + grwchar chwLB = ptman->LBGlyphID(); // While we haven't got the number of slot we've been asked for, and there is enough // available in the input, run rules, filling up the output. @@ -578,7 +578,7 @@ GrFeatureValues fval; LgCharRenderProps * pchrp = NULL; int nUnicode = pchstrm->NextGet(ptman, &fval, &pchrp, &ichwSegOffset, &cchw); - wchar chwGlyphID = ptman->GetGlyphIDFromUnicode(nUnicode); + grwchar chwGlyphID = ptman->GetGlyphIDFromUnicode(nUnicode); GrSlotState * pslotNew; ptman->NewSlot(chwGlyphID, fval, pchrp, 0, ichwSegOffset, &pslotNew); Index: GrPass.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrPass.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrPass.h 14 Apr 2003 21:34:30 -0000 1.3 +++ GrPass.h 16 Apr 2003 19:59:54 -0000 1.4 @@ -309,18 +309,18 @@ int m_crul; // number of rules // rule sort keys, indicating precedence of rules; m_crul of these - wchar * m_prgchwRuleSortKeys; + grwchar * m_prgchwRuleSortKeys; // for each rule, the number of items in the context before the first modified item // that the constraints need to be tested on byte * m_prgcritRulePreModContext; // offset for pass-level constraints; just 1 of these - wchar m_cbPassConstraint; + grwchar m_cbPassConstraint; // offsets for constraint and action code; m_crul+1 of each of these (the last // indicates the total byte count) - wchar * m_prgibConstraintStart; - wchar * m_prgibActionStart; + grwchar * m_prgibConstraintStart; + grwchar * m_prgibActionStart; // blocks of constraint and action code byte * m_prgbPConstraintBlock; // pass-level constraints @@ -328,8 +328,8 @@ byte * m_prgbActionBlock; bool m_fHasDebugStrings; - wchar * m_prgibConstraintDebug; // m_crul+1 of these - wchar * m_prgibRuleDebug; // m_crul+1 of these + grwchar * m_prgibConstraintDebug; // m_crul+1 of these + grwchar * m_prgibRuleDebug; // m_crul+1 of these // For logging transduction process: struct RuleRecord Index: GrPassActionCode.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrPassActionCode.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrPassActionCode.cpp 14 Apr 2003 21:34:31 -0000 1.3 +++ GrPassActionCode.cpp 16 Apr 2003 19:59:54 -0000 1.4 @@ -593,7 +593,7 @@ else pslotNextInput = (fInserting)? psstrmIn->Peek(): psstrmIn->NextGet(); - wchar nGlyphReplacement = ptman->GetClassGlyphIDAt(nReplacementClass, 0); + grwchar nGlyphReplacement = ptman->GetClassGlyphIDAt(nReplacementClass, 0); GrSlotState * pslotNew; if (fInserting) @@ -684,10 +684,10 @@ GrSlotState * pslotInSelector = psstrmIn->RuleInputSlot(cslotSel, psstrmOut); - wchar nGlyphSelector = pslotInSelector->GlyphID(); + grwchar nGlyphSelector = pslotInSelector->GlyphID(); int nSelIndex = ptman->GetIndexInGlyphClass(nSelClass, nGlyphSelector); Assert(nSelIndex != -1); - wchar nGlyphReplacement = (nSelIndex == -1)? + grwchar nGlyphReplacement = (nSelIndex == -1)? nGlyphSelector: ptman->GetClassGlyphIDAt(nReplacementClass, nSelIndex); Index: GrPseudoMap.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrPseudoMap.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrPseudoMap.h 14 Apr 2003 21:34:31 -0000 1.3 +++ GrPseudoMap.h 16 Apr 2003 19:59:55 -0000 1.4 @@ -29,15 +29,15 @@ { public: unsigned int Unicode() { return m_nUnicode; } - wchar PseudoGlyph() { return m_chwPseudo; } + grwchar PseudoGlyph() { return m_chwPseudo; } - void SetUnicode(int n) { m_nUnicode = n; } - void SetPseudoGlyph(wchar chw) { m_chwPseudo = chw; } + void SetUnicode(int n) { m_nUnicode = n; } + void SetPseudoGlyph(grwchar chw) { m_chwPseudo = chw; } protected: // Instance variables: unsigned int m_nUnicode; - wchar m_chwPseudo; + grwchar m_chwPseudo; }; #endif // !GR_PSEUDOMAP_INCLUDED Index: GrSegment.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSegment.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GrSegment.cpp 14 Apr 2003 21:34:31 -0000 1.5 +++ GrSegment.cpp 16 Apr 2003 19:59:55 -0000 1.6 @@ -710,7 +710,7 @@ /*---------------------------------------------------------------------------------------------- Get the old writing system used by this segment. ----------------------------------------------------------------------------------------------*/ -GrResult GrSegment::get_OldWritingSystem(int ichwBase, int * pws, int * pows) +GrResult GrSegment::get_WritingSystem(int ichwBase, int * pws, int * pows) { ChkGrOutPtr(pws); ChkGrOutPtr(pows); @@ -1987,7 +1987,7 @@ Create the arrays to store the final output and association information. ----------------------------------------------------------------------------------------------*/ void GrSegment::SetUpOutputArrays(GrTableManager * ptman, GrSlotStream * psstrmFinal, - int cchwInThisSeg, int csloutSurface, wchar chwLB, + int cchwInThisSeg, int csloutSurface, grwchar chwLB, LgTrailingWsHandling twsh, bool fParaRtl, int nDirDepth, bool fEmpty) { Index: GrSlotState.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GrSlotState.cpp 14 Apr 2003 21:34:31 -0000 1.4 +++ GrSlotState.cpp 16 Apr 2003 19:59:56 -0000 1.5 @@ -149,7 +149,7 @@ Return the ID of the actual glyph that will be used for output and metrics. This is the same for most glyphs, but will be different for pseudo-glyphs. ----------------------------------------------------------------------------------------------*/ -wchar GrSlotAbstract::ActualGlyphForOutput(GrTableManager * ptman) +grwchar GrSlotAbstract::ActualGlyphForOutput(GrTableManager * ptman) { if (m_chwActual == kInvalidGlyph) m_chwActual = ptman->ActualGlyphForOutput(m_chwGlyphID); @@ -564,7 +564,7 @@ } -int GrSlotAbstract::GetGlyphMetric(IGrGraphics * pgg, int nMetricID, wchar chwGlyphID) +int GrSlotAbstract::GetGlyphMetric(IGrGraphics * pgg, int nMetricID, grwchar chwGlyphID) { GrResult res; int xysRet = 0; Index: GrSlotState.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GrSlotState.h 2 Jan 2003 21:18:47 -0000 1.3 +++ GrSlotState.h 16 Apr 2003 19:59:57 -0000 1.4 @@ -98,10 +98,10 @@ m_prgnVarLenBuf = pn; } - wchar GlyphID() { return m_chwGlyphID; } - wchar RawActualGlyph() { return m_chwActual; } + grwchar GlyphID() { return m_chwGlyphID; } + grwchar RawActualGlyph() { return m_chwActual; } int IsSpace(GrTableManager * ptman); - int GetGlyphMetric(IGrGraphics * pgg, int nGlyphMetricID, wchar chwGlyphID); + int GetGlyphMetric(IGrGraphics * pgg, int nGlyphMetricID, grwchar chwGlyphID); int StyleIndex() { return m_nStyleIndex; } void GetFeatureValues(GrFeatureValues * pfval) @@ -192,7 +192,7 @@ m_islotPosPass = kNotYetSet; } - wchar ActualGlyphForOutput(GrTableManager * ptman); + grwchar ActualGlyphForOutput(GrTableManager * ptman); // Variable-length buffer: @@ -258,8 +258,8 @@ } protected: - wchar m_chwGlyphID; - wchar m_chwActual; // actual glyph to output (which is a different glyph for pseudos) + grwchar m_chwGlyphID; + grwchar m_chwActual; // actual glyph to output (which is a different glyph for pseudos) int m_islotPosPass; // index of slot in positioning streams, relative to first official // slot in the segment (possibly the LB slot) @@ -379,7 +379,7 @@ // General: int RawSegOffset() { return m_ichwSegOffset; } - void SetGlyphID(wchar chw) + void SetGlyphID(grwchar chw) { m_chwGlyphID = chw; m_chwActual = kInvalidGlyph; @@ -423,15 +423,15 @@ { } - bool IsLineBreak(wchar chwLB) + bool IsLineBreak(grwchar chwLB) { return (m_chwGlyphID == chwLB); } - bool IsInitialLineBreak(wchar chwLB) + bool IsInitialLineBreak(grwchar chwLB) { return (IsLineBreak(chwLB) && m_fInitialL... [truncated message content] |