From ddce1db1e800e537d1b8c3f8afd260d2e2313204 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 14 Feb 2008 13:15:05 +0000 Subject: graphite update, sync with xetex repository r.567 git-svn-id: svn://tug.org/texlive/trunk@6624 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/libs/graphite-engine/src/font/FileFont.cpp | 19 +++++++++++-------- Build/source/libs/graphite-engine/src/font/Font.cpp | 8 +++++--- .../libs/graphite-engine/src/segment/GrEngine.cpp | 2 +- .../libs/graphite-engine/src/segment/GrPass.cpp | 6 ++++++ .../libs/graphite-engine/src/segment/GrSlotState.cpp | 3 +++ .../libs/graphite-engine/src/segment/GrSlotStream.cpp | 4 ++-- .../graphite-engine/src/segment/GrTableManager.cpp | 3 +-- .../libs/graphite-engine/src/segment/Segment.cpp | 2 +- .../graphite-engine/src/segment/TransductionLog.cpp | 4 ++-- 9 files changed, 32 insertions(+), 19 deletions(-) (limited to 'Build/source/libs/graphite-engine/src') diff --git a/Build/source/libs/graphite-engine/src/font/FileFont.cpp b/Build/source/libs/graphite-engine/src/font/FileFont.cpp index 122a904063f..4600b788ed2 100755 --- a/Build/source/libs/graphite-engine/src/font/FileFont.cpp +++ b/Build/source/libs/graphite-engine/src/font/FileFont.cpp @@ -1,5 +1,5 @@ /*--------------------------------------------------------------------*//*:Ignore this sentence. -Copyright (C) 1999, 2001, 2005 SIL International. All rights reserved. +Copyright (C) 1999 - 2008 SIL International. All rights reserved. Distributable under the terms of either the Common Public License or the GNU Lesser General Public License, as specified in the LICENSING.txt file. @@ -198,17 +198,20 @@ FileFont::initializeFromFace() // We could use something like "if (sizeof(std::wstring::value_type) == 4)" here, // but a compile-time switch is preferable. #if SIZEOF_WCHAR_T == 4 - for (int c16 = 0; c16 < cchw; ) + for (int cch16 = 0; cch16 < cchw; ) { - int charUsed = 0; - utf32 cch32 = GrCharStream::Utf16ToUtf32(&(rgchwFace[c16]), - cchw - c16, &charUsed); - m_stuFaceName.push_back(cch32); - c16 += charUsed; + int cch16Used = 0; + utf32 ch32 = GrCharStream::Utf16ToUtf32(&(rgchwFace[cch16]), + cchw - cch16, &cch16Used); + m_stuFaceName.push_back(ch32); + cch16 += cch16Used; } // } #else - m_stuFaceName.assign(rgchwFace); + m_stuFaceName.assign(rgchwFace); + // VS 2005 needs this: + //for (int cch16 = 0; cch16 < cchw; cch16++) + // m_stuFaceName.push_back(rgchwFace[cch16]); #endif pTable = readTable(ktiHead, lSize); if (!m_fIsValid || !pTable) diff --git a/Build/source/libs/graphite-engine/src/font/Font.cpp b/Build/source/libs/graphite-engine/src/font/Font.cpp index 7a7d071763e..666be63ed6f 100644 --- a/Build/source/libs/graphite-engine/src/font/Font.cpp +++ b/Build/source/libs/graphite-engine/src/font/Font.cpp @@ -1,5 +1,5 @@ /*--------------------------------------------------------------------*//*:Ignore this sentence. -Copyright (C) 1999, 2001, 2005 SIL International. All rights reserved. +Copyright (C) 1999 - 2008 SIL International. All rights reserved. Distributable under the terms of either the Common Public License or the GNU Lesser General Public License, as specified in the LICENSING.txt file. @@ -133,7 +133,7 @@ void Font::initialiseFontFace(bool fDumbFallback) } /*---------------------------------------------------------------------------------------------- - Return uniquely identifying information that will be used a the key for this font + Return uniquely identifying information that will be used as the key for this font in the font cache. This includes the font face name and the bold and italic flags. ----------------------------------------------------------------------------------------------*/ void Font::UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic) @@ -154,7 +154,9 @@ void Font::UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic) std::copy(src_start, src_start + cchw, rgchwFace); rgchwFace[cchw] = 0; // zero terminate TtfUtil::SwapWString(rgchwFace, cchw); - stuFace.assign(rgchwFace, rgchwFace + cchw); + for (size_t ich16 = 0; ich16 < cchw; ich16++) // to handle situation where wchar_t is 4 bytes + stuFace.push_back(wchar_t(rgchwFace[ich16])); + ///stuFace.assign(rgchwFace, rgchwFace + cchw); const void * pOs2Tbl = getTable(TtfUtil::TableIdTag(ktiOs2), &cbSize); TtfUtil::FontOs2Style(pOs2Tbl, fBold, fItalic); diff --git a/Build/source/libs/graphite-engine/src/segment/GrEngine.cpp b/Build/source/libs/graphite-engine/src/segment/GrEngine.cpp index 62a33b6a4ed..57d2a2ba16e 100644 --- a/Build/source/libs/graphite-engine/src/segment/GrEngine.cpp +++ b/Build/source/libs/graphite-engine/src/segment/GrEngine.cpp @@ -604,7 +604,7 @@ void GrEngine::MakeSegment( GetWritingSystemDirection(pgts, ichMin); // Find the end of the range to render with the current font. - int nDirDepth; + int nDirDepth = 0; int ichFontLim; int ichStrmLim = 0; int ichSegLim = 0; diff --git a/Build/source/libs/graphite-engine/src/segment/GrPass.cpp b/Build/source/libs/graphite-engine/src/segment/GrPass.cpp index 8e2048f0f6f..26eb3a3deb6 100644 --- a/Build/source/libs/graphite-engine/src/segment/GrPass.cpp +++ b/Build/source/libs/graphite-engine/src/segment/GrPass.cpp @@ -1804,6 +1804,12 @@ int GrBidiPass::Unwind(GrTableManager * ptman, else { islotIn = min(islotChanged, psstrmIn->ReadPos()); islotIn = max(islotIn - 1, 0); + while (islotIn > 0 && !StrongDir(psstrmIn->SlotAt(islotIn)->Directionality())) + { + psstrmIn->SlotAt(islotIn)->ZapDirLevel(); + islotIn--; + } + Assert(islotIn == 0 || psstrmIn->SlotAt(islotIn)->DirHasBeenProcessed()); islotOut = 0; while (islotIn > 0 && (islotOut = psstrmIn->ChunkInNext(islotIn)) == -1) --islotIn; diff --git a/Build/source/libs/graphite-engine/src/segment/GrSlotState.cpp b/Build/source/libs/graphite-engine/src/segment/GrSlotState.cpp index b18ae95a63f..f2d61e45eed 100644 --- a/Build/source/libs/graphite-engine/src/segment/GrSlotState.cpp +++ b/Build/source/libs/graphite-engine/src/segment/GrSlotState.cpp @@ -143,6 +143,9 @@ void GrSlotState::InitializeFrom(GrSlotState * pslotOld, int ipass) m_vpslotAssoc.clear(); m_vpslotAssoc.push_back(pslotOld); + m_dircProc = pslotOld->m_dircProc; + m_fDirProcessed = pslotOld->m_fDirProcessed; + // Since we're going on to a new pass, no point in copying these: m_ipassFsmCol = -1; m_colFsm = -1; diff --git a/Build/source/libs/graphite-engine/src/segment/GrSlotStream.cpp b/Build/source/libs/graphite-engine/src/segment/GrSlotStream.cpp index f71aefdee3a..db6a5c8af7e 100644 --- a/Build/source/libs/graphite-engine/src/segment/GrSlotStream.cpp +++ b/Build/source/libs/graphite-engine/src/segment/GrSlotStream.cpp @@ -832,8 +832,8 @@ int GrSlotStream::GetSlotDirLevel(EngineState * pengst, int islot, dircLB = (dircLB == kdircLlb) ? kdircL : kdircR; for (int iislot = 0; iislot < signed(vislotTrailingWS.size()); iislot++) { - islot = vislotTrailingWS[iislot]; - m_vpslot[islot]->SetDirProcessed(dircLB); + int islotTmp = vislotTrailingWS[iislot]; + m_vpslot[islotTmp]->SetDirProcessed(dircLB); } } diff --git a/Build/source/libs/graphite-engine/src/segment/GrTableManager.cpp b/Build/source/libs/graphite-engine/src/segment/GrTableManager.cpp index dfb49717946..cc125a3d9b3 100644 --- a/Build/source/libs/graphite-engine/src/segment/GrTableManager.cpp +++ b/Build/source/libs/graphite-engine/src/segment/GrTableManager.cpp @@ -1122,7 +1122,6 @@ void GrTableManager::InitializeForNextSeg(Segment * pseg, bool fNextSegNeedsContext, GrCharStream * pchstrm) { byte pbNextSegDat[256]; - int cbNextMax = 256; int cbNextSegDat; int * pcbNextSegDat = &cbNextSegDat; @@ -1964,7 +1963,7 @@ GrResult EngineState::GetGlyphAttrForJustification(int iGlyph, int jgat, int nLe float * pValueRet) { GrResult res; - int valueRetInt; + int valueRetInt = 0; switch(jgat) { case kjgatWeight: diff --git a/Build/source/libs/graphite-engine/src/segment/Segment.cpp b/Build/source/libs/graphite-engine/src/segment/Segment.cpp index 69e5349bca3..db8f2bc8849 100644 --- a/Build/source/libs/graphite-engine/src/segment/Segment.cpp +++ b/Build/source/libs/graphite-engine/src/segment/Segment.cpp @@ -3391,7 +3391,7 @@ int Segment::SelectBb(std::vector & viginf, bool fRTL) // The idea is that it is going to be harder to hit than the bigger glyph. float smallestArea = float(1000000000.0); float largestArea = 0.0; - size_t iiginfSmallest; + size_t iiginfSmallest = 0; size_t iiginf; for (iiginf = 0; iiginf < viginf.size(); iiginf++) { diff --git a/Build/source/libs/graphite-engine/src/segment/TransductionLog.cpp b/Build/source/libs/graphite-engine/src/segment/TransductionLog.cpp index 29a1be2af12..ee528110103 100644 --- a/Build/source/libs/graphite-engine/src/segment/TransductionLog.cpp +++ b/Build/source/libs/graphite-engine/src/segment/TransductionLog.cpp @@ -1620,8 +1620,8 @@ void GrSlotState::LogSlotAttribute(GrTableManager * ptman, pslotPrev = pslotPrev->m_pslotPrevState; // General-purpose variables for em-unit attributes: - int mThis; - int mPrev; + int mThis = 0; + int mPrev = 0; switch (slat) { case kslatShiftX: -- cgit v1.2.3