View | Details | Raw Unified | Return to issue 112730
Collapse All | Expand All

(-)misc/silgraphite-2.3.1/engine/include/graphite/GrCommon.h (-1 / +4 lines)
Lines 18-23 Link Here
18
#ifndef GRCOMMON_INCLUDED
18
#ifndef GRCOMMON_INCLUDED
19
#define GRCOMMON_INCLUDED
19
#define GRCOMMON_INCLUDED
20
20
21
#define _SECURE_SCL 0	// to allow GlyphSetIterator to work, which points off the end of a vector
22
#define _HAS_ITERATOR_DEBUGGING 0
21
23
22
// Standard Headers.
24
// Standard Headers.
23
25
Lines 33-38 Link Here
33
#include <vector>
35
#include <vector>
34
#include <algorithm>
36
#include <algorithm>
35
#include <string>
37
#include <string>
38
///#include <stdexcept> -- possibly needed for std::string Xran and Xlen functions??
36
39
37
// Uncomment this to allow multiple versions of gr to coexist
40
// Uncomment this to allow multiple versions of gr to coexist
38
// in the same program e.g. pangographite with gtk uses namespace gr
41
// in the same program e.g. pangographite with gtk uses namespace gr
Lines 41-47 Link Here
41
// Provided the client includes GrClient.h first this #define is
44
// Provided the client includes GrClient.h first this #define is
42
// picked up by all files.
45
// picked up by all files.
43
46
44
//#define gr gr2
47
#define gr gr3ooo
45
48
46
// Project headers
49
// Project headers
47
#include "GrPlatform.h"
50
#include "GrPlatform.h"
(-)misc/silgraphite-2.3.1/engine/include/graphite/GrMstypes.h (-2 / +2 lines)
Lines 24-34 Link Here
24
24
25
typedef signed long	    HRESULT;
25
typedef signed long	    HRESULT;
26
26
27
inline const long InterlockedIncrement(long *const intr_lck) {
27
inline long InterlockedIncrement(long *const intr_lck) {
28
	return ++*intr_lck;
28
	return ++*intr_lck;
29
}
29
}
30
30
31
inline const long InterlockedDecrement(long *const intr_lck) {
31
inline long InterlockedDecrement(long *const intr_lck) {
32
	return --*intr_lck;
32
	return --*intr_lck;
33
}
33
}
34
34
(-)misc/silgraphite-2.3.1/engine/makefile.vc7 (-4 lines)
Lines 48-58 Link Here
48
CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
48
CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
49
!ENDIF
49
!ENDIF
50
50
51
!IF "$(OS)" == "Windows_NT"
52
NULL=
51
NULL=
53
!ELSE 
54
NULL=nul
55
!ENDIF
56
52
57
clean :
53
clean :
58
    @- rd /s/q .\release_temp
54
    @- rd /s/q .\release_temp
(-)misc/silgraphite-2.3.1/engine/makefile.vc8 (-11 / +12 lines)
Lines 2-12 Link Here
2
TARGET=graphite
2
TARGET=graphite
3
3
4
CPP=cl.exe
4
CPP=cl.exe
5
CPPFLAGS=/Zc:wchar_t- /nologo /W4 /GR /EHsc /I "./src/font" /I "./src/painter" /I "./src/segment" /I "./src/textsource" /I "./src/generic" /I "./include/graphite" /I "../wrappers/win32" /D "GR_NAMESPACE" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "TRACING"  /Fp"$(INTDIR)\graphite.pch" /Fd"$(INTDIR)\\" /FD /c
5
### HDU: disabled building with the normal compile flags
6
###CPPFLAGS= /Zc:wchar_t- /nologo /W4 /GR /EHsc /I "./src/font" /I "./src/painter" /I "./src/segment" /I "./src/textsource" /I "./src/generic" /I "./include/graphite" /I "../wrappers/win32" /D "GR_NAMESPACE" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "TRACING"  /Fp"$(INTDIR)\graphite.pch" /Fd"$(INTDIR)\\" /FD /c
7
### HDU: because for full binary compatibility with the rest of OOo all compile flags must match exactly
8
###       which is especially true for template-heavy C++ code with non-default config (e.g. _STLP_DEBUG enabled)
9
CPPFLAGS= $(CFLAGS4MSC) /nologo /W4 /I "./src/font" /I "./src/painter" /I "./src/segment" /I "./src/textsource" /I "./src/generic" /I "./include/graphite" /I "../wrappers/win32" /D "GR_NAMESPACE" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "TRACING"  /Fp"$(INTDIR)\graphite.pch" /FD /c
10
6
# /Wp62
11
# /Wp62
7
12
8
LINK=link.exe
13
LINK=link.exe
9
LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /pdb:"$(OUTDIR)\\graphite.pdb" /machine:I386 /out:"$(OUTDIR)\\$(TARGET).dll" /implib:"$(OUTDIR)\\$(TARGET).lib"
14
LINK_FLAGS=$(ADDLIBS) kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /pdb:"$(OUTDIR)\\graphite.pdb" /machine:I386 /out:"$(OUTDIR)\\$(TARGET).dll" /implib:"$(OUTDIR)\\$(TARGET).lib"
10
15
11
BSC32=bscmake.exe
16
BSC32=bscmake.exe
12
BSC32_FLAGS=/nologo /o"$(OUTDIR)\\$(TARGET).bsc" 
17
BSC32_FLAGS=/nologo /o"$(OUTDIR)\\$(TARGET).bsc" 
Lines 24-44 Link Here
24
SBREXT = .sbr
29
SBREXT = .sbr
25
30
26
!IF "$(CFG)" == "DEBUG"
31
!IF "$(CFG)" == "DEBUG"
27
CPP_DEBUG=/D "DEBUG" /Gm /GR /ZI /Od /RTC1 /FR"$(INTDIR)\\" /$(MLIB)d
32
CPP_DEBUG=/D "DEBUG" /Gm /GR /Od /RTC1 /FR"$(INTDIR)\\"
28
# CPP_DEBUG=/D "DEBUG" /Gm /GR /ZI /Od /RTC1 /FR"$(INTDIR)\\" /MDd
33
# CPP_DEBUG=/D "DEBUG" /Gm /GR /ZI /Od /RTC1 /FR"$(INTDIR)\\" /MDd
29
34
30
OUTDIR=.\debug
35
OUTDIR=.\debug
31
INTDIR=.\debug_temp
36
INTDIR=.\debug_temp
32
LINK_DEBUG= MSVCRTD.lib /debug /incremental:yes #/pdbtype:sept
37
LINK_DEBUG= /debug 
33
38
34
all : lib lib_dll bsc
39
all : lib lib_dll bsc
35
40
36
!ELSE
41
!ELSE
37
CPP_DEBUG=/D "NDEBUG" /O2 /$(MLIB)
42
CPP_DEBUG=/D "NDEBUG" /O2
38
# CPP_DEBUG=/D "NDEBUG" /O2 /MD
43
# CPP_DEBUG=/D "NDEBUG" /O2 /MD
39
OUTDIR=.\release
44
OUTDIR=.\release
40
INTDIR=.\release_temp
45
INTDIR=.\release_temp
41
LINK_DEBUG= MSVCRT.lib /incremental:no /NODEFAULTLIB:libc
46
LINK_DEBUG= /incremental:no /NODEFAULTLIB:libc
42
47
43
all : lib lib_dll
48
all : lib lib_dll
44
49
Lines 48-58 Link Here
48
CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
53
CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
49
!ENDIF
54
!ENDIF
50
55
51
!IF "$(OS)" == "Windows_NT"
52
NULL=
56
NULL=
53
!ELSE 
54
NULL=nul
55
!ENDIF
56
57
57
clean :
58
clean :
58
    @- rd /s/q .\release_temp
59
    @- rd /s/q .\release_temp
Lines 779-785 Link Here
779
	@- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileFont$(OBJEXT)" $?
780
	@- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileFont$(OBJEXT)" $?
780
	
781
	
781
"$(INTDIR)\FileFont_dll$(OBJEXT)" : "src/font/FileFont.cpp"
782
"$(INTDIR)\FileFont_dll$(OBJEXT)" : "src/font/FileFont.cpp"
782
	@- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FileFont_dll$(OBJEXT)" $?
783
	$(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FileFont_dll$(OBJEXT)" $?
783
	
784
	
784
!ENDIF
785
!ENDIF
785
786
(-)misc/silgraphite-2.3.1/engine/src/font/FileFont.cpp (-12 / +12 lines)
Lines 207-217 Link Here
207
				cch16 += cch16Used;
207
				cch16 += cch16Used;
208
			}
208
			}
209
//		}
209
//		}
210
#else
210
#elif 1
211
		m_stuFaceName.assign(rgchwFace);
211
		m_stuFaceName.assign(rgchwFace);
212
		// VS 2005 needs this:
212
#else	// VS 2005 needs this:
213
		//for (int cch16 = 0; cch16 < cchw; cch16++)
213
		for (int cch16 = 0; cch16 < cchw; cch16++)
214
		//	m_stuFaceName.push_back(rgchwFace[cch16]);
214
			m_stuFaceName.push_back(rgchwFace[cch16]);
215
#endif
215
#endif
216
		pTable = readTable(ktiHead, lSize);
216
		pTable = readTable(ktiHead, lSize);
217
		if (!m_fIsValid || !pTable) 
217
		if (!m_fIsValid || !pTable) 
Lines 233-239 Link Here
233
FileFont::readTable(int /*TableId*/ tid, size_t & size)
233
FileFont::readTable(int /*TableId*/ tid, size_t & size)
234
{
234
{
235
	const TableId tableId = TableId(tid);
235
	const TableId tableId = TableId(tid);
236
	bool isValid = true;
236
	bool isTableValid = true;
237
	size_t lOffset = 0, lSize = 0;
237
	size_t lOffset = 0, lSize = 0;
238
	if (!m_pTableCache)
238
	if (!m_pTableCache)
239
	{
239
	{
Lines 245-253 Link Here
245
	size = m_pTableCache->getTableSize(tableId);
245
	size = m_pTableCache->getTableSize(tableId);
246
	// check whether it is already in the cache
246
	// check whether it is already in the cache
247
	if (pTable) return pTable;
247
	if (pTable) return pTable;
248
	isValid &= TtfUtil::GetTableInfo(tableId, m_pHeader, m_pTableDir, 
248
	isTableValid &= TtfUtil::GetTableInfo(tableId, m_pHeader, m_pTableDir, 
249
			lOffset, lSize);
249
			lOffset, lSize);
250
	if (!isValid) 
250
	if (!isTableValid) 
251
		return NULL;
251
		return NULL;
252
	fseek(m_pfile, lOffset, SEEK_SET);
252
	fseek(m_pfile, lOffset, SEEK_SET);
253
	// only allocate if needed
253
	// only allocate if needed
Lines 255-270 Link Here
255
	
255
	
256
	if (!pTable) 
256
	if (!pTable) 
257
	{
257
	{
258
		isValid = false;
258
		isTableValid = false;
259
		return NULL;
259
		return NULL;
260
	}
260
	}
261
	size_t bytesRead = fread(pTable, 1, lSize, m_pfile);
261
	size_t bytesRead = fread(pTable, 1, lSize, m_pfile);
262
	isValid = bytesRead == lSize;
262
	isTableValid = bytesRead == lSize;
263
	if (isValid)
263
	if (isTableValid)
264
	{
264
	{
265
		isValid &= TtfUtil::CheckTable(tableId, pTable, lSize);
265
		isTableValid &= TtfUtil::CheckTable(tableId, pTable, lSize);
266
	}
266
	}
267
	if (!isValid) 
267
	if (!isTableValid) 
268
	{
268
	{
269
		return 0;
269
		return 0;
270
	}
270
	}
(-)misc/silgraphite-2.3.1/engine/src/font/Font.cpp (-4 / +4 lines)
Lines 626-632 Link Here
626
		Assert(false);
626
		Assert(false);
627
		m_ifeat = m_cfeat;
627
		m_ifeat = m_cfeat;
628
	}
628
	}
629
	else if (m_ifeat + n < 0)
629
	else if (static_cast<int>(m_ifeat) + n < 0)
630
	{
630
	{
631
		// Can't decrement.
631
		// Can't decrement.
632
		Assert(false);
632
		Assert(false);
Lines 727-733 Link Here
727
		Assert(false);
727
		Assert(false);
728
		m_ifset = m_cfset;
728
		m_ifset = m_cfset;
729
	}
729
	}
730
	if (m_ifset + n < 0)
730
	if (static_cast<int>(m_ifset) + n < 0)
731
	{
731
	{
732
		// Can't decrement.
732
		// Can't decrement.
733
		Assert(false);
733
		Assert(false);
Lines 820-826 Link Here
820
		Assert(false);
820
		Assert(false);
821
		m_ilang = m_clang;
821
		m_ilang = m_clang;
822
	}
822
	}
823
	else if (m_ilang + n < 0)
823
	else if (static_cast<int>(m_ilang) + n < 0)
824
	{
824
	{
825
		// Can't decrement.
825
		// Can't decrement.
826
		Assert(false);
826
		Assert(false);
Lines 906-912 Link Here
906
		Assert(false);
906
		Assert(false);
907
		m_ilang = m_clang;
907
		m_ilang = m_clang;
908
	}
908
	}
909
	else if (m_ilang + n < 0)
909
	else if (static_cast<int>(m_ilang) + n < 0)
910
	{
910
	{
911
		// Can't decrement.
911
		// Can't decrement.
912
		Assert(false);
912
		Assert(false);
(-)misc/silgraphite-2.3.1/engine/src/font/TtfUtil.cpp (-7 / +7 lines)
Lines 492-498 Link Here
492
	const Sfnt::FontHeader * pTable = 
492
	const Sfnt::FontHeader * pTable = 
493
			reinterpret_cast<const Sfnt::FontHeader *>(pHead);
493
			reinterpret_cast<const Sfnt::FontHeader *>(pHead);
494
	
494
	
495
	return read(((pTable->mac_style) & 0x00000002) != 0);
495
	return ((read(pTable->mac_style) & 0x00000002) != 0);
496
}
496
}
497
497
498
/*----------------------------------------------------------------------------------------------
498
/*----------------------------------------------------------------------------------------------
Lines 1108-1115 Link Here
1108
	{ // loca entries are two bytes and have been divided by two
1108
	{ // loca entries are two bytes and have been divided by two
1109
		if (nGlyphId <= (lLocaSize >> 1) - 1) // allow sentinel value to be accessed
1109
		if (nGlyphId <= (lLocaSize >> 1) - 1) // allow sentinel value to be accessed
1110
		{
1110
		{
1111
			const uint16 * pTable = reinterpret_cast<const uint16 *>(pLoca);
1111
			const uint16 * pTableLoca = reinterpret_cast<const uint16 *>(pLoca);
1112
			return (read(pTable[nGlyphId]) << 1);
1112
			return (read(pTableLoca[nGlyphId]) << 1);
1113
		}
1113
		}
1114
	}
1114
	}
1115
	
1115
	
Lines 1117-1124 Link Here
1117
	{ // loca entries are four bytes
1117
	{ // loca entries are four bytes
1118
		if (nGlyphId <= (lLocaSize >> 2) - 1)
1118
		if (nGlyphId <= (lLocaSize >> 2) - 1)
1119
		{
1119
		{
1120
			const uint32 * pTable = reinterpret_cast<const uint32 *>(pLoca);
1120
			const uint32 * pTableLoca = reinterpret_cast<const uint32 *>(pLoca);
1121
			return read(pTable[nGlyphId]);
1121
			return read(pTableLoca[nGlyphId]);
1122
		}
1122
		}
1123
	}
1123
	}
1124
1124
Lines 1586-1592 Link Here
1586
1586
1587
	for (size_t i = 0; i < cCompId; i++)
1587
	for (size_t i = 0; i < cCompId; i++)
1588
	{
1588
	{
1589
		void * pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]), 
1589
		pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]), 
1590
										pGlyf, pLoca, lLocaSize, pHead);
1590
										pGlyf, pLoca, lLocaSize, pHead);
1591
		if (pSimpleGlyf == NULL) {return false;}
1591
		if (pSimpleGlyf == NULL) {return false;}
1592
1592
Lines 1748-1754 Link Here
1748
----------------------------------------------------------------------------------------------*/
1748
----------------------------------------------------------------------------------------------*/
1749
bool GlyfPoints(gr::gid16 nGlyphId, const void * pGlyf, 
1749
bool GlyfPoints(gr::gid16 nGlyphId, const void * pGlyf, 
1750
		const void * pLoca, size_t lLocaSize, const void * pHead, 
1750
		const void * pLoca, size_t lLocaSize, const void * pHead, 
1751
		const int * prgnContourEndPoint, size_t cnEndPoints, 
1751
		const int * /*prgnContourEndPoint*/, size_t /*cnEndPoints*/, 
1752
		int * prgnX, int * prgnY, bool * prgfOnCurve, size_t cnPoints)
1752
		int * prgnX, int * prgnY, bool * prgfOnCurve, size_t cnPoints)
1753
{
1753
{
1754
	std::fill_n(prgnX, cnPoints, INT_MAX);
1754
	std::fill_n(prgnX, cnPoints, INT_MAX);
(-)misc/silgraphite-2.3.1/engine/src/painter/SegmentPainter.cpp (-11 / +19 lines)
Lines 353-359 Link Here
353
	@param bOn				- true if we are turning on (ignored in this implementation)
353
	@param bOn				- true if we are turning on (ignored in this implementation)
354
----------------------------------------------------------------------------------------------*/
354
----------------------------------------------------------------------------------------------*/
355
bool SegmentPainter::drawSelectionRange(int ichwAnchor, int ichwEnd,
355
bool SegmentPainter::drawSelectionRange(int ichwAnchor, int ichwEnd,
356
	float ydLineTop, float ydLineBottom, bool bOn)
356
	float ydLineTop, float ydLineBottom, bool /*bOn*/)
357
{
357
{
358
	if (g_fDrawing)
358
	if (g_fDrawing)
359
		return true;
359
		return true;
Lines 993-999 Link Here
993
								an I-beam (std selection)
993
								an I-beam (std selection)
994
----------------------------------------------------------------------------------------------*/
994
----------------------------------------------------------------------------------------------*/
995
void SegmentPainter::CalcOrDrawInsertionPoint(
995
void SegmentPainter::CalcOrDrawInsertionPoint(
996
	int ichwIP, bool fAssocPrev, bool bOn, bool fForceSplit,
996
	int ichwIP, bool fAssocPrev, bool /*bOn*/, bool fForceSplit,
997
	Rect * prdPrimary, Rect * prdSecondary)
997
	Rect * prdPrimary, Rect * prdSecondary)
998
{
998
{
999
	GrResult res = kresOk;
999
	GrResult res = kresOk;
Lines 1277-1283 Link Here
1277
							if NULL, do the drawing
1277
							if NULL, do the drawing
1278
----------------------------------------------------------------------------------------------*/
1278
----------------------------------------------------------------------------------------------*/
1279
void SegmentPainter::InvertIBeam(float xs, float ysTop, float ysBottom,
1279
void SegmentPainter::InvertIBeam(float xs, float ysTop, float ysBottom,
1280
	bool fAssocPrev, Rect * prdRet)
1280
	bool /*fAssocPrev*/, Rect * prdRet)
1281
{
1281
{
1282
	float xd = ScaleXToDest(xs);
1282
	float xd = ScaleXToDest(xs);
1283
	float ydTop = ScaleYToDest(ysTop);
1283
	float ydTop = ScaleYToDest(ysTop);
Lines 1675-1681 Link Here
1675
}
1675
}
1676
1676
1677
bool SegmentPainter::AtEdgeOfCluster(GrSlotOutput * psloutBase, int isloutBase,
1677
bool SegmentPainter::AtEdgeOfCluster(GrSlotOutput * psloutBase, int isloutBase,
1678
	GrSlotOutput * pslout, int islout, bool fBefore)
1678
	GrSlotOutput * /*pslout*/, int islout, bool fBefore)
1679
{
1679
{
1680
	//	Compare pslout to all the members of the cluster. If it is the minimum or maximum, it
1680
	//	Compare pslout to all the members of the cluster. If it is the minimum or maximum, it
1681
	//	is at an edge.
1681
	//	is at an edge.
Lines 1778-1789 Link Here
1778
			}
1778
			}
1779
			for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
1779
			for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
1780
			{
1780
			{
1781
				for (int ichw = pslout->FirstUnderlyingComponent(icomp) ; 
1781
				for (int ichwTemp = pslout->FirstUnderlyingComponent(icomp) ; 
1782
					ichw <= pslout->LastUnderlyingComponent(icomp) ;
1782
					ichwTemp <= pslout->LastUnderlyingComponent(icomp) ;
1783
					ichw++)
1783
					ichwTemp++)
1784
				{
1784
				{
1785
					if (m_pseg->m_prgiComponent[ichw - m_pseg->m_ichwAssocsMin] == icomp)
1785
					if (m_pseg->m_prgiComponent[ichwTemp - m_pseg->m_ichwAssocsMin] == icomp)
1786
						prgfAllSelected[ichw] = fAll;
1786
						prgfAllSelected[ichwTemp] = fAll;
1787
				}
1787
				}
1788
			}
1788
			}
1789
		}
1789
		}
Lines 2304-2310 Link Here
2304
	Assert that there are no overlaps among all the rectangles in the array, which should
2304
	Assert that there are no overlaps among all the rectangles in the array, which should
2305
	be the case if AdjustRectsToNotOverlap is working properly.
2305
	be the case if AdjustRectsToNotOverlap is working properly.
2306
----------------------------------------------------------------------------------------------*/
2306
----------------------------------------------------------------------------------------------*/
2307
#ifdef _DEBUG
2307
void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & vrect)
2308
void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & vrect)
2309
#else
2310
void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & /*vrect*/)
2311
#endif
2308
{
2312
{
2309
#ifdef _DEBUG
2313
#ifdef _DEBUG
2310
	for (int irect1 = 0; irect1 < signed(vrect.size() - 1); irect1++)
2314
	for (int irect1 = 0; irect1 < signed(vrect.size() - 1); irect1++)
Lines 2452-2458 Link Here
2452
	Assert that there are no overlaps among all the rectangles in the array, which should
2456
	Assert that there are no overlaps among all the rectangles in the array, which should
2453
	be the case if AdjustRectsToNotOverlap is working properly.
2457
	be the case if AdjustRectsToNotOverlap is working properly.
2454
----------------------------------------------------------------------------------------------*/
2458
----------------------------------------------------------------------------------------------*/
2459
#ifdef _DEBUG
2455
void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & vls)
2460
void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & vls)
2461
#else
2462
void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & /*vls*/)
2463
#endif
2456
{
2464
{
2457
#ifdef _DEBUG
2465
#ifdef _DEBUG
2458
	for (int ils1 = 0; ils1 < (int)vls.size() - 1; ils1++)
2466
	for (int ils1 = 0; ils1 < (int)vls.size() - 1; ils1++)
Lines 2884-2890 Link Here
2884
	{
2892
	{
2885
		if (icompNext != icompCurr)
2893
		if (icompNext != icompCurr)
2886
		{
2894
		{
2887
			float xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
2895
			xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
2888
			if (fMovingRight && xsHorizNext > xsHorizCurr)
2896
			if (fMovingRight && xsHorizNext > xsHorizCurr)
2889
				break;
2897
				break;
2890
			else if (!fMovingRight && xsHorizNext < xsHorizCurr)
2898
			else if (!fMovingRight && xsHorizNext < xsHorizCurr)
Lines 2996-3002 Link Here
2996
/*----------------------------------------------------------------------------------------------
3004
/*----------------------------------------------------------------------------------------------
2997
	Make sure the font is set to use the character properties required by this segment.
3005
	Make sure the font is set to use the character properties required by this segment.
2998
----------------------------------------------------------------------------------------------*/
3006
----------------------------------------------------------------------------------------------*/
2999
void SegmentPainter::SetFontProps(unsigned long clrFore, unsigned long clrBack)
3007
void SegmentPainter::SetFontProps(unsigned long /*clrFore*/, unsigned long /*clrBack*/)
3000
{
3008
{
3001
	return;
3009
	return;
3002
}
3010
}
(-)misc/silgraphite-2.3.1/engine/src/segment/FileInput.cpp (-1 / +1 lines)
Lines 80-86 Link Here
80
#ifdef GR_FW
80
#ifdef GR_FW
81
bool GrBufferIStream::Open(std::wstring stuFileName, int kMode)
81
bool GrBufferIStream::Open(std::wstring stuFileName, int kMode)
82
#else
82
#else
83
bool GrBufferIStream::Open(const char * pcFileName, std::ios::openmode kMode)
83
bool GrBufferIStream::Open(const char * /*pcFileName*/, std::ios::openmode /*kMode*/)
84
#endif
84
#endif
85
{
85
{
86
	Assert(false); // use OpenBuffer
86
	Assert(false); // use OpenBuffer
(-)misc/silgraphite-2.3.1/engine/src/segment/GrCharStream.cpp (-1 / +4 lines)
Lines 417-424 Link Here
417
	return true;
417
	return true;
418
*/
418
*/
419
}
419
}
420
420
#ifdef NDEBUG
421
bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType /*utf*/)
422
#else
421
bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType utf)
423
bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType utf)
424
#endif
422
{
425
{
423
	Assert(ichs >= 0);
426
	Assert(ichs >= 0);
424
	Assert(ichs <= cchs);
427
	Assert(ichs <= cchs);
(-)misc/silgraphite-2.3.1/engine/src/segment/GrClassTable.h (+4 lines)
Lines 54-60 Link Here
54
	/*------------------------------------------------------------------------------------------
54
	/*------------------------------------------------------------------------------------------
55
		Copy the raw memory into the instance.
55
		Copy the raw memory into the instance.
56
	------------------------------------------------------------------------------------------*/
56
	------------------------------------------------------------------------------------------*/
57
#ifdef NDEBUG
58
	void CopyFrom(data16 * pchwStart, int /*cchw*/)
59
#else
57
	void CopyFrom(data16 * pchwStart, int cchw)
60
	void CopyFrom(data16 * pchwStart, int cchw)
61
#endif
58
	{
62
	{
59
		m_cgixBIG = pchwStart[0];
63
		m_cgixBIG = pchwStart[0];
60
		m_digixBIGInit = pchwStart[1];
64
		m_digixBIGInit = pchwStart[1];
(-)misc/silgraphite-2.3.1/engine/src/segment/GrEngine.cpp (-17 / +27 lines)
Lines 159-170 Link Here
159
GrEngine::~GrEngine()
159
GrEngine::~GrEngine()
160
{
160
{
161
	DestroyEverything();
161
	DestroyEverything();
162
	#ifdef _MSC_VER
162
//	#ifdef _MSC_VER
163
	if (!_CrtCheckMemory())
163
//	if (!_CrtCheckMemory())
164
	{
164
//	{
165
		OutputDebugString(L"bad memory");
165
//		OutputDebugString(L"bad memory");
166
	}
166
//	}
167
	#endif
167
//	#endif
168
}
168
}
169
169
170
/*----------------------------------------------------------------------------------------------
170
/*----------------------------------------------------------------------------------------------
Lines 173-184 Link Here
173
void GrEngine::DestroyEverything()
173
void GrEngine::DestroyEverything()
174
{
174
{
175
	DestroyContents();
175
	DestroyContents();
176
	#ifdef _MSC_VER
176
//	#ifdef _MSC_VER
177
	if (!_CrtCheckMemory())
177
//	if (!_CrtCheckMemory())
178
	{
178
//	{
179
		OutputDebugString(L"bad memory");
179
//		OutputDebugString(L"bad memory");
180
	}
180
//	}
181
	#endif
181
//	#endif
182
182
183
	m_strCtrlFileReg.erase();
183
	m_strCtrlFileReg.erase();
184
	m_strCtrlFileBold.erase();
184
	m_strCtrlFileBold.erase();
Lines 417-423 Link Here
417
	@return The supported script direction(s). If more than one, the application is
417
	@return The supported script direction(s). If more than one, the application is
418
	responsible for choosing the most appropriate.
418
	responsible for choosing the most appropriate.
419
----------------------------------------------------------------------------------------------*/
419
----------------------------------------------------------------------------------------------*/
420
#ifdef NDEBUG
421
GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * /*prgchwErrMsg*/, int /*cchMaxErrMsg*/)
422
#else
420
GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
423
GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
424
#endif
421
{
425
{
422
	ChkGrOutPtr(pgrfsdc);
426
	ChkGrOutPtr(pgrfsdc);
423
	ChkGrArrayArg(prgchwErrMsg, cchMaxErrMsg);
427
	ChkGrArrayArg(prgchwErrMsg, cchMaxErrMsg);
Lines 789-795 Link Here
789
	Record a system error indicating a bad error in rendering using a supposedly valid font.
793
	Record a system error indicating a bad error in rendering using a supposedly valid font.
790
	OBSOLETE
794
	OBSOLETE
791
----------------------------------------------------------------------------------------------*/
795
----------------------------------------------------------------------------------------------*/
792
void GrEngine::RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMax, GrResult res)
796
void GrEngine::RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMax, GrResult /*res*/)
793
{
797
{
794
	if (prgchwErrMsg == NULL || cchMax == 0)
798
	if (prgchwErrMsg == NULL || cchMax == 0)
795
		return;
799
		return;
Lines 970-976 Link Here
970
/*----------------------------------------------------------------------------------------------
974
/*----------------------------------------------------------------------------------------------
971
	Return whether the text is asking for bold and/or italic text.
975
	Return whether the text is asking for bold and/or italic text.
972
----------------------------------------------------------------------------------------------*/
976
----------------------------------------------------------------------------------------------*/
973
void GrEngine::GetStyles(Font * pfont, int ichwMin, bool * pfBold, bool * pfItalic)
977
void GrEngine::GetStyles(Font * pfont, int /*ichwMin*/, bool * pfBold, bool * pfItalic)
974
{
978
{
975
	*pfBold = pfont->bold();
979
	*pfBold = pfont->bold();
976
	*pfItalic = pfont->italic();
980
	*pfItalic = pfont->italic();
Lines 981-987 Link Here
981
	Should only be called when we know we are using a base font, or when we are reading
985
	Should only be called when we know we are using a base font, or when we are reading
982
	the base font to see if it is valid.
986
	the base font to see if it is valid.
983
----------------------------------------------------------------------------------------------*/
987
----------------------------------------------------------------------------------------------*/
988
#ifdef NDEBUG
989
void GrEngine::SwitchGraphicsFont(bool /*fBase*/)
990
#else
984
void GrEngine::SwitchGraphicsFont(bool fBase)
991
void GrEngine::SwitchGraphicsFont(bool fBase)
992
#endif
985
{
993
{
986
	Assert(!fBase || m_stuBaseFaceName.size() > 0);
994
	Assert(!fBase || m_stuBaseFaceName.size() > 0);
987
995
Lines 1135-1141 Link Here
1135
		m_chwJShrink0 = 0xffff;
1143
		m_chwJShrink0 = 0xffff;
1136
		m_chwJStep0 = 0xffff;
1144
		m_chwJStep0 = 0xffff;
1137
		m_chwJWeight0 = 0xffff;
1145
		m_chwJWeight0 = 0xffff;
1138
		for (int i = 0; i < m_cJLevels; i++)
1146
		for (i = 0; i < m_cJLevels; i++)
1139
		{
1147
		{
1140
			//	justification glyph attribute IDs
1148
			//	justification glyph attribute IDs
1141
			bTmp = grstrm.ReadByteFromFont();
1149
			bTmp = grstrm.ReadByteFromFont();
Lines 1210-1219 Link Here
1210
1218
1211
	//	rendering behaviors--ignore for now
1219
	//	rendering behaviors--ignore for now
1212
	byte cBehaviors = grstrm.ReadByteFromFont();
1220
	byte cBehaviors = grstrm.ReadByteFromFont();
1213
	unsigned int nBehaviors[kMaxRenderingBehavior];
1221
	int nTmp;
1222
	//unsigned int nBehaviors[kMaxRenderingBehavior]; -- this big buffer causes a stack overflow in Multiscribe; rework eventually
1214
	for (i = 0; i < cBehaviors; i++)
1223
	for (i = 0; i < cBehaviors; i++)
1215
	{
1224
	{
1216
		nBehaviors[i] = unsigned(grstrm.ReadIntFromFont());
1225
		//nBehaviors[i] = unsigned(grstrm.ReadIntFromFont());
1226
		nTmp = unsigned(grstrm.ReadIntFromFont());
1217
	}
1227
	}
1218
1228
1219
	//	linebreak glyph ID
1229
	//	linebreak glyph ID
(-)misc/silgraphite-2.3.1/engine/src/segment/GrFSM.cpp (-2 / +2 lines)
Lines 46-52 Link Here
46
	Fill in the FSM by reading from the font stream.
46
	Fill in the FSM by reading from the font stream.
47
	Assumes the stream is in the correct position.
47
	Assumes the stream is in the correct position.
48
----------------------------------------------------------------------------------------------*/
48
----------------------------------------------------------------------------------------------*/
49
bool GrFSM::ReadFromFont(GrIStream & grstrm, int fxdVersion)
49
bool GrFSM::ReadFromFont(GrIStream & grstrm, int /*fxdVersion*/)
50
{
50
{
51
	short snTmp;
51
	short snTmp;
52
	
52
	
Lines 138-144 Link Here
138
	Fill in the FSM's state table by reading from the font stream.
138
	Fill in the FSM's state table by reading from the font stream.
139
	Assumes the stream is in the correct position.
139
	Assumes the stream is in the correct position.
140
----------------------------------------------------------------------------------------------*/
140
----------------------------------------------------------------------------------------------*/
141
bool GrFSM::ReadStateTableFromFont(GrIStream & grstrm, int fxdVersion)
141
bool GrFSM::ReadStateTableFromFont(GrIStream & grstrm, int /*fxdVersion*/)
142
{
142
{
143
	int cCells = ((m_crow - m_crowFinal) * m_ccol);
143
	int cCells = ((m_crow - m_crowFinal) * m_ccol);
144
	m_prgrowTransitions = new short[cCells];
144
	m_prgrowTransitions = new short[cCells];
(-)misc/silgraphite-2.3.1/engine/src/segment/GrFeature.cpp (-3 / +12 lines)
Lines 186-192 Link Here
186
/*----------------------------------------------------------------------------------------------
186
/*----------------------------------------------------------------------------------------------
187
	Read the languages from the font.
187
	Read the languages from the font.
188
----------------------------------------------------------------------------------------------*/
188
----------------------------------------------------------------------------------------------*/
189
bool GrLangTable::ReadFromFont(GrIStream * pgrstrm, int fxdVersion)
189
bool GrLangTable::ReadFromFont(GrIStream * pgrstrm, int /*fxdVersion*/)
190
{
190
{
191
	GrIStream & grstrm = *pgrstrm;
191
	GrIStream & grstrm = *pgrstrm;
192
	
192
	
Lines 206-218 Link Here
206
206
207
	m_cbOffset0 = (lsbf)(m_prglang[0].cbOffsetBIG);
207
	m_cbOffset0 = (lsbf)(m_prglang[0].cbOffsetBIG);
208
208
209
	Assert((lsbf)(m_prglang[m_clang].cFeaturesBIG) == 0); // bogus entry has no settings
209
	if ((lsbf)(m_prglang[m_clang].cFeaturesBIG) == 0) // bogus entry has no settings
210
	{
210
	cb = (lsbf)(m_prglang[m_clang].cbOffsetBIG) - m_cbOffset0;
211
	cb = (lsbf)(m_prglang[m_clang].cbOffsetBIG) - m_cbOffset0;
211
	Assert(cb % sizeof(FeatSet) == 0); // # of bytes fits nicely into FeatSet class
212
		if (cb % sizeof(FeatSet) == 0) // # of bytes fits nicely into FeatSet class
213
		{
212
	int cfset = cb / sizeof(FeatSet);
214
	int cfset = cb / sizeof(FeatSet);
213
	m_prgfset = new FeatSet[cfset];
215
	m_prgfset = new FeatSet[cfset];
214
	m_cfset = cfset;
216
	m_cfset = cfset;
215
	grstrm.ReadBlockFromFont(m_prgfset, cb);
217
	grstrm.ReadBlockFromFont(m_prgfset, cb);
218
		}
219
		else return false;
220
	}
221
	else
222
	{
223
		return false;
224
	}
216
225
217
	return true;
226
	return true;
218
}
227
}
(-)misc/silgraphite-2.3.1/engine/src/segment/GrPass.cpp (-10 / +15 lines)
Lines 279-287 Link Here
279
	@param twsh					- how we are handling trailing white-space
279
	@param twsh					- how we are handling trailing white-space
280
	@param pnRet				- return value
280
	@param pnRet				- return value
281
	@param pcslotGot			- return the number of slots gotten
281
	@param pcslotGot			- return the number of slots gotten
282
	@param pislotFinalBreak		- return the index of the final slot, when we are removing
282
	@param pislotFinalBreak		- index of the final slot (LB or actual glyph), or -1;
283
									the trailing white-space and so the end of the segment
283
									adjusted when we are removing the trailing white-space and
284
									will be before the any actual line-break slot
284
									so the end of the segment will be before the any actual
285
									line-break slot
285
286
286
	@return kNextPass if we were able to generated the number requested, or processing is
287
	@return kNextPass if we were able to generated the number requested, or processing is
287
		complete; otherwise return the number of slots needed from the previous pass.
288
		complete; otherwise return the number of slots needed from the previous pass.
Lines 465-471 Link Here
465
void GrBidiPass::ExtendOutput(GrTableManager * ptman,
466
void GrBidiPass::ExtendOutput(GrTableManager * ptman,
466
	GrSlotStream* psstrmIn, GrSlotStream* psstrmOut,
467
	GrSlotStream* psstrmIn, GrSlotStream* psstrmOut,
467
	int cslotNeededByNext, TrWsHandling twsh,
468
	int cslotNeededByNext, TrWsHandling twsh,
468
	int * pnRet, int * pcslotGot, int * pislotFinalBreak)
469
	int * pnRet, int * pcslotGot, int * /*pislotFinalBreak*/)
469
{
470
{
470
	Assert(psstrmIn->SlotsToReprocess() == 0);
471
	Assert(psstrmIn->SlotsToReprocess() == 0);
471
472
Lines 776-782 Link Here
776
int GrPass::ExtendFinalOutput(GrTableManager * ptman,
777
int GrPass::ExtendFinalOutput(GrTableManager * ptman,
777
	GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
778
	GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
778
	float xsSpaceAllotted, bool fWidthIsCharCount, bool fInfiniteWidth,
779
	float xsSpaceAllotted, bool fWidthIsCharCount, bool fInfiniteWidth,
779
	bool fHaveLineBreak, bool fMustBacktrack, LineBrk lbMax, TrWsHandling twsh,
780
	bool fHaveLineBreak, bool fMustBacktrack, LineBrk /*lbMax*/, TrWsHandling twsh,
780
	int * pislotLB, float * pxsWidth)
781
	int * pislotLB, float * pxsWidth)
781
{
782
{
782
	EngineState * pengst = ptman->State();
783
	EngineState * pengst = ptman->State();
Lines 897-903 Link Here
897
	Remove undesirable trailing white-space.
898
	Remove undesirable trailing white-space.
898
----------------------------------------------------------------------------------------------*/
899
----------------------------------------------------------------------------------------------*/
899
int GrPass::RemoveTrailingWhiteSpace(GrTableManager * ptman, GrSlotStream * psstrmOut,
900
int GrPass::RemoveTrailingWhiteSpace(GrTableManager * ptman, GrSlotStream * psstrmOut,
901
#ifdef NDEBUG
902
	TrWsHandling /*twsh*/, int * pislotFinalBreak)
903
#else
900
	TrWsHandling twsh, int * pislotFinalBreak)
904
	TrWsHandling twsh, int * pislotFinalBreak)
905
#endif
901
{
906
{
902
	EngineState * pengst = ptman->State();
907
	EngineState * pengst = ptman->State();
903
908
Lines 944-950 Link Here
944
	should never be necessary if they've set up their tables right.
949
	should never be necessary if they've set up their tables right.
945
----------------------------------------------------------------------------------------------*/
950
----------------------------------------------------------------------------------------------*/
946
void GrPass::CheckInputProgress(GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
951
void GrPass::CheckInputProgress(GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
947
	int islotOrigInput)
952
	int /*islotOrigInput*/)
948
{
953
{
949
	int islotInput = psstrmInput->ReadPosForNextGet();
954
	int islotInput = psstrmInput->ReadPosForNextGet();
950
//	Assert(islotInput >= islotOrigInput); -- no longer true now that we can back up
955
//	Assert(islotInput >= islotOrigInput); -- no longer true now that we can back up
Lines 1752-1758 Link Here
1752
----------------------------------------------------------------------------------------------*/
1757
----------------------------------------------------------------------------------------------*/
1753
int GrPass::Unwind(GrTableManager * ptman,
1758
int GrPass::Unwind(GrTableManager * ptman,
1754
	int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
1759
	int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
1755
	bool fFirst)
1760
	bool /*fFirst*/)
1756
{
1761
{
1757
	//	Back up the number of slots required for the longest rule context,
1762
	//	Back up the number of slots required for the longest rule context,
1758
	//	but if we land in the middle of a chunk, go forward to its boundary.
1763
	//	but if we land in the middle of a chunk, go forward to its boundary.
Lines 1824-1830 Link Here
1824
----------------------------------------------------------------------------------------------*/
1829
----------------------------------------------------------------------------------------------*/
1825
int GrBidiPass::Unwind(GrTableManager * ptman,
1830
int GrBidiPass::Unwind(GrTableManager * ptman,
1826
	int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
1831
	int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
1827
	bool fFirst)
1832
	bool /*fFirst*/)
1828
{
1833
{
1829
	int islotIn;
1834
	int islotIn;
1830
	int islotOut;
1835
	int islotOut;
Lines 1901-1908 Link Here
1901
	OBSOLETE
1906
	OBSOLETE
1902
----------------------------------------------------------------------------------------------*/
1907
----------------------------------------------------------------------------------------------*/
1903
//:Ignore
1908
//:Ignore
1904
void GrPosPass::Unattach(GrSlotStream * psstrmIn, int islotIn,
1909
void GrPosPass::Unattach(GrSlotStream * /*psstrmIn*/, int /*islotIn*/,
1905
	GrSlotStream * psstrmOut, int islotOut, int islotLB)
1910
	GrSlotStream * /*psstrmOut*/, int /*islotOut*/, int /*islotLB*/)
1906
{
1911
{
1907
	//	Because this is a positioning pass, there is a one-to-one correspondence between
1912
	//	Because this is a positioning pass, there is a one-to-one correspondence between
1908
	//	the slots in the input and the slots in the output. Thus we can make simplifying
1913
	//	the slots in the input and the slots in the output. Thus we can make simplifying
(-)misc/silgraphite-2.3.1/engine/src/segment/GrPass.h (-9 / +9 lines)
Lines 197-203 Link Here
197
	bool ReadFromFont(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion, int nOffset);
197
	bool ReadFromFont(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion, int nOffset);
198
	void InitializeWithNoRules();
198
	void InitializeWithNoRules();
199
199
200
	virtual void SetTopDirLevel(int n)
200
	virtual void SetTopDirLevel(int /*n*/)
201
	{	// only GrBidiPass does anything interesting
201
	{	// only GrBidiPass does anything interesting
202
	}
202
	}
203
203
Lines 253-265 Link Here
253
		m_pzpst->SetResyncSkip(n);
253
		m_pzpst->SetResyncSkip(n);
254
	}
254
	}
255
255
256
	virtual void DoCleanUpSegMin(GrTableManager * ptman,
256
	virtual void DoCleanUpSegMin(GrTableManager * /*ptman*/,
257
		GrSlotStream * psstrmIn, int islotInitReadPos, GrSlotStream * psstrmOut)
257
		GrSlotStream * /*psstrmIn*/, int /*islotInitReadPos*/, GrSlotStream * /*psstrmOut*/)
258
	{
258
	{
259
	}
259
	}
260
260
261
	virtual void DoCleanUpSegLim(GrTableManager * ptman, GrSlotStream * psstrmOut,
261
	virtual void DoCleanUpSegLim(GrTableManager * /*ptman*/, GrSlotStream * /*psstrmOut*/,
262
		TrWsHandling twsh)
262
		TrWsHandling /*twsh*/)
263
	{
263
	{
264
	}
264
	}
265
265
Lines 383-390 Link Here
383
	void MapChunks(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
383
	void MapChunks(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
384
		int islotChunkI, int islotChunkO, int cslotReprocessed);
384
		int islotChunkI, int islotChunkO, int cslotReprocessed);
385
385
386
	virtual void Unattach(GrSlotStream * psstrmIn, int islotIn,	// GrPosPass overrides
386
	virtual void Unattach(GrSlotStream * /*psstrmIn*/, int /*islotIn*/,	// GrPosPass overrides
387
		GrSlotStream * psstrmOut, int islotOut, int islotLB)
387
		GrSlotStream * /*psstrmOut*/, int /*islotOut*/, int /*islotLB*/)
388
	{
388
	{
389
	}
389
	}
390
390
Lines 500-507 Link Here
500
500
501
protected:
501
protected:
502
	//	Irrelevant when generating glyphs.
502
	//	Irrelevant when generating glyphs.
503
	virtual void RunRule(GrTableManager *, int ruln,
503
	virtual void RunRule(GrTableManager *, int /*ruln*/,
504
		GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
504
		GrSlotStream * /*psstrmInput*/, GrSlotStream * /*psstrmOutput*/)
505
	{
505
	{
506
		Assert(false);
506
		Assert(false);
507
	}
507
	}
(-)misc/silgraphite-2.3.1/engine/src/segment/GrPassActionCode.cpp (-15 / +32 lines)
Lines 632-639 Link Here
632
/*----------------------------------------------------------------------------------------------
632
/*----------------------------------------------------------------------------------------------
633
	We are finished processing a slot; go on to the next slot, or possibly go backwards.
633
	We are finished processing a slot; go on to the next slot, or possibly go backwards.
634
----------------------------------------------------------------------------------------------*/
634
----------------------------------------------------------------------------------------------*/
635
void GrPass::DoNext(GrTableManager * ptman,
635
#ifdef NDEBUG
636
	int cslot, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
636
void GrPass::DoNext(GrTableManager * /*ptman*/,
637
	int /*cslot*/, GrSlotStream * /*psstrmIn*/, GrSlotStream * /*psstrmOut*/)
638
#else
639
void GrPass::DoNext(GrTableManager * /*ptman*/,
640
	int cslot, GrSlotStream * /*psstrmIn*/, GrSlotStream * /*psstrmOut*/)
641
#endif
637
{
642
{
638
	gAssert(cslot == 1);	// for now anyway
643
	gAssert(cslot == 1);	// for now anyway
639
}
644
}
Lines 690-695 Link Here
690
		psstrmOut->SetSegMinToWritePos(false);
695
		psstrmOut->SetSegMinToWritePos(false);
691
	if (fSetSegLim)
696
	if (fSetSegLim)
692
		psstrmOut->SetSegLimToWritePos(false);
697
		psstrmOut->SetSegLimToWritePos(false);
698
	//gid16 chw; chw = pslotNew->GlyphID();
693
	psstrmOut->NextPut(pslotNew);
699
	psstrmOut->NextPut(pslotNew);
694
}
700
}
695
701
Lines 729-734 Link Here
729
		psstrmOut->SetSegMinToWritePos(false);
735
		psstrmOut->SetSegMinToWritePos(false);
730
	if (fSetSegLim)
736
	if (fSetSegLim)
731
		psstrmOut->SetSegLimToWritePos(false);
737
		psstrmOut->SetSegLimToWritePos(false);
738
	//gid16 chw; chw = pslotNew->GlyphID();
732
	psstrmOut->NextPut(pslotNew);
739
	psstrmOut->NextPut(pslotNew);
733
}
740
}
734
741
Lines 825-831 Link Here
825
	@param psstrmIn / Out		- input/output streams
832
	@param psstrmIn / Out		- input/output streams
826
----------------------------------------------------------------------------------------------*/
833
----------------------------------------------------------------------------------------------*/
827
void GrPass::DoPutSubs3(GrTableManager * ptman, bool fInserting,
834
void GrPass::DoPutSubs3(GrTableManager * ptman, bool fInserting,
828
	int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int cslotSel3, int nSelClass3,
835
	int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int /*cslotSel3*/, int nSelClass3,
829
	int nReplacementClass,
836
	int nReplacementClass,
830
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
837
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
831
{
838
{
Lines 888-894 Link Here
888
	Common part of all the DoPutSubs... methods.
895
	Common part of all the DoPutSubs... methods.
889
----------------------------------------------------------------------------------------------*/
896
----------------------------------------------------------------------------------------------*/
890
void GrPass::DoPutSubsAux(GrTableManager * ptman, bool fInserting, gid16 nGlyphReplacement,
897
void GrPass::DoPutSubsAux(GrTableManager * ptman, bool fInserting, gid16 nGlyphReplacement,
891
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
898
	GrSlotStream * /*psstrmIn*/, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
892
	bool fAtSegMin, bool fAtSegLim)
899
	bool fAtSegMin, bool fAtSegLim)
893
{
900
{
894
	EngineState * pengst = ptman->State();
901
	EngineState * pengst = ptman->State();
Lines 915-920 Link Here
915
		psstrmOut->SetSegMinToWritePos(false);
922
		psstrmOut->SetSegMinToWritePos(false);
916
	if (fSetSegLim)
923
	if (fSetSegLim)
917
		psstrmOut->SetSegLimToWritePos(false);
924
		psstrmOut->SetSegLimToWritePos(false);
925
	//gid16 chw; chw = pslotNew->GlyphID();
918
	psstrmOut->NextPut(pslotNew);
926
	psstrmOut->NextPut(pslotNew);
919
}
927
}
920
928
Lines 924-930 Link Here
924
	and its after-assoc to the slot before it. This makes it basically unselectable.
932
	and its after-assoc to the slot before it. This makes it basically unselectable.
925
	OBSOLETE - handled by slot initialization code
933
	OBSOLETE - handled by slot initialization code
926
----------------------------------------------------------------------------------------------*/
934
----------------------------------------------------------------------------------------------*/
927
void GrPass::SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * psstrmIn)
935
void GrPass::SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * /*psstrmIn*/)
928
{
936
{
929
	pslotNew->ClearAssocs();
937
	pslotNew->ClearAssocs();
930
}
938
}
Lines 943-948 Link Here
943
		psstrmOut->SetSegLimToWritePos();
951
		psstrmOut->SetSegLimToWritePos();
944
952
945
	GrSlotState * pslot = psstrmIn->NextGet();
953
	GrSlotState * pslot = psstrmIn->NextGet();
954
	//gid16 chw; chw = pslotNew->GlyphID();
946
	pslot->MarkDeleted();
955
	pslot->MarkDeleted();
947
956
948
	if (ptman->LoggingTransduction())
957
	if (ptman->LoggingTransduction())
Lines 957-963 Link Here
957
	@param fInserting			- whether current slot was inserted
966
	@param fInserting			- whether current slot was inserted
958
	@param psstrmIn / Out		- input/output streams
967
	@param psstrmIn / Out		- input/output streams
959
----------------------------------------------------------------------------------------------*/
968
----------------------------------------------------------------------------------------------*/
960
void GrPass::DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool fInserting,
969
void GrPass::DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool /*fInserting*/,
961
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
970
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
962
{
971
{
963
	gAssert((unsigned)cnAssocs == vnAssocs.size());
972
	gAssert((unsigned)cnAssocs == vnAssocs.size());
Lines 997-1003 Link Here
997
	@param vnStack				- stack to read value from
1006
	@param vnStack				- stack to read value from
998
	@param psstrmIn / Out		- input/output streams
1007
	@param psstrmIn / Out		- input/output streams
999
----------------------------------------------------------------------------------------------*/
1008
----------------------------------------------------------------------------------------------*/
1009
#ifdef NDEBUG
1010
void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool /*fInserting*/,
1011
#else
1000
void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool fInserting,
1012
void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool fInserting,
1013
#endif
1001
	SlotAttrName slat, int slati, std::vector<int> & vnStack,
1014
	SlotAttrName slat, int slati, std::vector<int> & vnStack,
1002
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1015
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1003
{
1016
{
Lines 1192-1198 Link Here
1192
	@param psstrmIn				- input stream
1205
	@param psstrmIn				- input stream
1193
----------------------------------------------------------------------------------------------*/
1206
----------------------------------------------------------------------------------------------*/
1194
void GrPass::DoPushSlotAttr(GrTableManager * ptman,
1207
void GrPass::DoPushSlotAttr(GrTableManager * ptman,
1195
	int nSlotRef, bool fInserting,
1208
	int nSlotRef, bool /*fInserting*/,
1196
	SlotAttrName slat, int slati, std::vector<int> & vnStack,
1209
	SlotAttrName slat, int slati, std::vector<int> & vnStack,
1197
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1210
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1198
{
1211
{
Lines 1236-1251 Link Here
1236
1249
1237
	case kslatAttTo:		nVal = pslot->AttachTo();			break;
1250
	case kslatAttTo:		nVal = pslot->AttachTo();			break;
1238
	case kslatAttLevel:		nVal = pslot->AttachLevel();		break;
1251
	case kslatAttLevel:		nVal = pslot->AttachLevel();		break;
1239
	case kslatAttAtX:		nVal = pslot->AttachAtX(ptman, psstrmIn); break;
1240
	case kslatAttAtY:		nVal = pslot->AttachAtY();			break;
1252
	case kslatAttAtY:		nVal = pslot->AttachAtY();			break;
1241
	case kslatAttAtGpt:		nVal = pslot->AttachAtGpoint();		break;
1253
	case kslatAttAtGpt:		nVal = pslot->AttachAtGpoint();		break;
1242
	case kslatAttAtXoff:	nVal = pslot->AttachAtXOffset();	break;
1254
	case kslatAttAtXoff:	nVal = pslot->AttachAtXOffset();	break;
1243
	case kslatAttAtYoff:	nVal = pslot->AttachAtYOffset();	break;
1255
	case kslatAttAtYoff:	nVal = pslot->AttachAtYOffset();	break;
1244
	case kslatAttWithX:		nVal = pslot->AttachWithX(ptman, psstrmIn); break;
1245
	case kslatAttWithY:		nVal = pslot->AttachWithY();		break;
1256
	case kslatAttWithY:		nVal = pslot->AttachWithY();		break;
1246
	case kslatAttWithGpt:	nVal = pslot->AttachWithGpoint();	break;
1257
	case kslatAttWithGpt:	nVal = pslot->AttachWithGpoint();	break;
1247
	case kslatAttWithXoff:	nVal = pslot->AttachWithXOffset();	break;
1258
	case kslatAttWithXoff:	nVal = pslot->AttachWithXOffset();	break;
1248
	case kslatAttWithYoff:	nVal = pslot->AttachWithYOffset();	break;
1259
	case kslatAttWithYoff:	nVal = pslot->AttachWithYOffset();	break;
1260
	case kslatAttAtX:		nVal = pslot->AttachAtX(ptman, psstrmIn);	break;
1261
	case kslatAttWithX:		nVal = pslot->AttachWithX(ptman, psstrmIn);	break;
1249
1262
1250
	case kslatMeasureSol:	nVal = pslot->MeasureSol();			break;
1263
	case kslatMeasureSol:	nVal = pslot->MeasureSol();			break;
1251
	case kslatMeasureEol:	nVal = pslot->MeasureEol();			break;
1264
	case kslatMeasureEol:	nVal = pslot->MeasureEol();			break;
Lines 1282-1288 Link Here
1282
	@param vnStack				- stack to push onto
1295
	@param vnStack				- stack to push onto
1283
	@param psstrmIn				- input stream
1296
	@param psstrmIn				- input stream
1284
----------------------------------------------------------------------------------------------*/
1297
----------------------------------------------------------------------------------------------*/
1285
void GrPass::DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
1298
void GrPass::DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
1286
	int nGlyphAttr,
1299
	int nGlyphAttr,
1287
	std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1300
	std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1288
{
1301
{
Lines 1307-1313 Link Here
1307
	@param vnStack				- stack to push onto
1320
	@param vnStack				- stack to push onto
1308
	@param psstrmIn				- input stream
1321
	@param psstrmIn				- input stream
1309
----------------------------------------------------------------------------------------------*/
1322
----------------------------------------------------------------------------------------------*/
1310
void GrPass::DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
1323
void GrPass::DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
1311
	int nGlyphAttr, std::vector<int> & vnStack,
1324
	int nGlyphAttr, std::vector<int> & vnStack,
1312
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1325
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1313
{
1326
{
Lines 1337-1343 Link Here
1337
	@param vnStack				- stack to push onto
1350
	@param vnStack				- stack to push onto
1338
	@param psstrmIn				- input stream
1351
	@param psstrmIn				- input stream
1339
----------------------------------------------------------------------------------------------*/
1352
----------------------------------------------------------------------------------------------*/
1340
void GrPass::DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
1353
void GrPass::DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
1341
	int nGlyphAttr, int nAttLevel,
1354
	int nGlyphAttr, int nAttLevel,
1342
	std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1355
	std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1343
{
1356
{
Lines 1364-1370 Link Here
1364
	@param psstrmIn				- input stream
1377
	@param psstrmIn				- input stream
1365
	@param psstrmOut			- output stream
1378
	@param psstrmOut			- output stream
1366
----------------------------------------------------------------------------------------------*/
1379
----------------------------------------------------------------------------------------------*/
1367
void GrPass::DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
1380
void GrPass::DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
1368
	int nGlyphAttr, int nAttLevel,
1381
	int nGlyphAttr, int nAttLevel,
1369
	std::vector<int> & vnStack,
1382
	std::vector<int> & vnStack,
1370
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1383
	GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
Lines 1399-1405 Link Here
1399
	}
1412
	}
1400
	else
1413
	else
1401
	{
1414
	{
1402
		pslot->CalcCompositeMetrics(ptman, psstrmIn, nAttLevel, true);
1415
		pslot->CalcCompositeMetrics(ptman, psstrmIn, NULL, nAttLevel, true);
1403
1416
1404
		float xy;
1417
		float xy;
1405
		switch (gmet)
1418
		switch (gmet)
Lines 1435-1441 Link Here
1435
	@param psstrmIn				- input stream
1448
	@param psstrmIn				- input stream
1436
	@param psstrmOut			- output stream
1449
	@param psstrmOut			- output stream
1437
----------------------------------------------------------------------------------------------*/
1450
----------------------------------------------------------------------------------------------*/
1438
void GrPass::DoPushFeatValue(GrTableManager * ptman, int nSlotRef, bool fInserting,
1451
#ifdef NDEBUG
1452
void GrPass::DoPushFeatValue(GrTableManager * /*ptman*/, int nSlotRef, bool /*fInserting*/,
1453
#else
1454
void GrPass::DoPushFeatValue(GrTableManager * /*ptman*/, int nSlotRef, bool fInserting,
1455
#endif
1439
	int nFeat, std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1456
	int nFeat, std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
1440
{
1457
{
1441
	gAssert(!fInserting);
1458
	gAssert(!fInserting);
(-)misc/silgraphite-2.3.1/engine/src/segment/GrSlotState.cpp (-22 / +51 lines)
Lines 261-267 Link Here
261
	root or attached leaf slots.
261
	root or attached leaf slots.
262
	OBSOLETE
262
	OBSOLETE
263
----------------------------------------------------------------------------------------------*/
263
----------------------------------------------------------------------------------------------*/
264
void GrSlotState::FixAttachmentTree(GrSlotState * pslotOld)
264
void GrSlotState::FixAttachmentTree(GrSlotState * /*pslotOld*/)
265
{
265
{
266
#if 0
266
#if 0
267
	pslotOld->m_vpslotAttLeaves.CopyTo(m_vpslotAttLeaves);
267
	pslotOld->m_vpslotAttLeaves.CopyTo(m_vpslotAttLeaves);
Lines 524-536 Link Here
524
		GrSlotState * pslot;
524
		GrSlotState * pslot;
525
		if (HasComponents())
525
		if (HasComponents())
526
		{
526
		{
527
			for (int iComponent = 0; iComponent < m_cnCompPerLig; iComponent++)
527
			for (int iLigComponent = 0; iLigComponent < m_cnCompPerLig; iLigComponent++)
528
			{
528
			{
529
				pslot = CompRefSlot(iComponent);
529
				pslot = CompRefSlot(iLigComponent);
530
				if (pslot)
530
				if (pslot)
531
				{
531
				{
532
					Assert(PassModified() >= pslot->PassModified());
532
					Assert(PassModified() >= pslot->PassModified());
533
					pslot->AllComponentRefs(vichw, vicomp, iComponent);
533
					pslot->AllComponentRefs(vichw, vicomp, iLigComponent);
534
				}
534
				}
535
			}
535
			}
536
		}
536
		}
Lines 1024-1030 Link Here
1024
	NOTE: the caller is responsible to zap the cached positions of following glyphs
1024
	NOTE: the caller is responsible to zap the cached positions of following glyphs
1025
	in the stream.
1025
	in the stream.
1026
----------------------------------------------------------------------------------------------*/
1026
----------------------------------------------------------------------------------------------*/
1027
void GrSlotState::AttachToRoot(GrTableManager * ptman, GrSlotStream * psstrm,
1027
void GrSlotState::AttachToRoot(GrTableManager * /*ptman*/, GrSlotStream * psstrm,
1028
	GrSlotState * pslotNewRoot)
1028
	GrSlotState * pslotNewRoot)
1029
{
1029
{
1030
	GrSlotState * pslotOldRoot = (m_dislotRootFixed == 0) ?
1030
	GrSlotState * pslotOldRoot = (m_dislotRootFixed == 0) ?
Lines 1063-1069 Link Here
1063
1063
1064
	float xsWidth, xsVisWidth;
1064
	float xsWidth, xsVisWidth;
1065
	if (m_xsPositionX == kNegInfFloat || m_ysPositionY == kNegInfFloat)
1065
	if (m_xsPositionX == kNegInfFloat || m_ysPositionY == kNegInfFloat)
1066
		ptman->CalcPositionsUpTo(psstrmOut->m_ipass, this, &xsWidth, &xsVisWidth);
1066
		ptman->CalcPositionsUpTo(psstrmOut->m_ipass, this, true, &xsWidth, &xsVisWidth);
1067
1067
1068
	*pmXPos = ptman->LogToEmUnits(m_xsPositionX);
1068
	*pmXPos = ptman->LogToEmUnits(m_xsPositionX);
1069
	*pmYPos = ptman->LogToEmUnits(m_ysPositionY);
1069
	*pmYPos = ptman->LogToEmUnits(m_ysPositionY);
Lines 1077-1083 Link Here
1077
{
1077
{
1078
	Assert(m_dislotRootFixed == m_srAttachTo);
1078
	Assert(m_dislotRootFixed == m_srAttachTo);
1079
	GrSlotState * pslotRoot = AttachRoot(psstrm);
1079
	GrSlotState * pslotRoot = AttachRoot(psstrm);
1080
	CalcRootMetrics(ptman, psstrm, kPosInfinity);
1080
	CalcRootMetrics(ptman, psstrm, NULL, kPosInfinity);
1081
	if (pslotRoot)
1081
	if (pslotRoot)
1082
		pslotRoot->AdjustRootMetrics(ptman, psstrm);
1082
		pslotRoot->AdjustRootMetrics(ptman, psstrm);
1083
}
1083
}
Lines 1086-1098 Link Here
1086
	Calculate the composite metrics for this slot.
1086
	Calculate the composite metrics for this slot.
1087
1087
1088
	@param psstrm			- stream for which we are calculating it
1088
	@param psstrm			- stream for which we are calculating it
1089
	@param psstrmNext		- because when processing in the middle of a pass, we may need to
1090
								get the slot from the following (output) stream
1089
	@param nLevel			- attachment level we are asking for; kPosInifinity means all levels
1091
	@param nLevel			- attachment level we are asking for; kPosInifinity means all levels
1090
	@param fThorough		- true: do a thorough recalculation; false: don't recalculate
1092
	@param fThorough		- true: do a thorough recalculation; false: don't recalculate
1091
								metrics for leaves (are they assumed to be accurate???)
1093
								metrics for leaves (are they assumed to be accurate???)
1092
								--currently not used
1094
								--currently not used
1093
----------------------------------------------------------------------------------------------*/
1095
----------------------------------------------------------------------------------------------*/
1094
void GrSlotState::CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
1096
void GrSlotState::CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
1095
	int nLevel, bool fThorough)
1097
	GrSlotStream * psstrmNext, int nLevel, bool fThorough)
1096
{
1098
{
1097
	if (m_nCompositeLevel == nLevel)
1099
	if (m_nCompositeLevel == nLevel)
1098
		return;
1100
		return;
Lines 1101-1119 Link Here
1101
	{
1103
	{
1102
		Assert(m_dislotRootFixed == m_srAttachTo);
1104
		Assert(m_dislotRootFixed == m_srAttachTo);
1103
		GrSlotState * pslotRoot = AttachRoot(psstrm);
1105
		GrSlotState * pslotRoot = AttachRoot(psstrm);
1106
		// Kludge to handle the fact that we might have gotten the root from the wrong stream.
1107
		// Calling MidPassSlotAt finds the right one.
1108
		if (psstrmNext && pslotRoot)
1109
		{
1110
			int islotRoot = pslotRoot->PosPassIndex();
1111
			pslotRoot = psstrm->MidPassSlotAt(islotRoot, psstrmNext);
1112
		}
1104
1113
1105
		InitMetrics(ptman, pslotRoot);
1114
		InitMetrics(ptman, pslotRoot);
1106
1115
1107
		for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
1116
		for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
1108
		{
1117
		{
1109
			GrSlotState * pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[islot]);
1118
			GrSlotState * pslotLeaf;
1119
			if (psstrmNext)
1120
			{
1121
				// Calculating a position in the middle of processing a pass.
1122
				pslotLeaf = psstrm->MidPassSlotAt(PosPassIndex() + m_vdislotAttLeaves[islot],
1123
					psstrmNext);
1124
			}
1125
			else
1126
			{
1127
				// Calculating the final position.
1128
				pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[islot]);
1129
			}
1130
1110
			if (pslotLeaf->AttachLevel() <= nLevel)
1131
			if (pslotLeaf->AttachLevel() <= nLevel)
1111
				pslotLeaf->CalcCompositeMetrics(ptman, psstrm, nLevel, fThorough);
1132
				pslotLeaf->CalcCompositeMetrics(ptman, psstrm, psstrmNext, nLevel, fThorough);
1112
			else
1133
			else
1113
				//	this slot will be ignored in the composite metrics
1134
				//	this slot will be ignored in the composite metrics
1114
				pslotLeaf->ZapRootMetrics();
1135
				pslotLeaf->ZapRootMetrics();
1115
		}
1136
		}
1116
		CalcRootMetrics(ptman, psstrm, nLevel);
1137
		CalcRootMetrics(ptman, psstrm, psstrmNext, nLevel);
1117
1138
1118
		m_nCompositeLevel = nLevel;
1139
		m_nCompositeLevel = nLevel;
1119
	}
1140
	}
Lines 1129-1153 Link Here
1129
/*----------------------------------------------------------------------------------------------
1150
/*----------------------------------------------------------------------------------------------
1130
	Calculate the metrics for this node and all its leaf nodes.
1151
	Calculate the metrics for this node and all its leaf nodes.
1131
----------------------------------------------------------------------------------------------*/
1152
----------------------------------------------------------------------------------------------*/
1132
void GrSlotState::CalcRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm, int nLevel)
1153
void GrSlotState::CalcRootMetrics(GrTableManager * /*ptman*/, GrSlotStream * psstrm,
1154
	GrSlotStream * psstrmNext, int nLevel)
1133
{
1155
{
1134
	for (size_t idislot = 0; idislot < m_vdislotAttLeaves.size(); idislot++)
1156
	for (size_t idislot = 0; idislot < m_vdislotAttLeaves.size(); idislot++)
1135
	{
1157
	{
1136
		GrSlotState * pslot = SlotAtOffset(psstrm, m_vdislotAttLeaves[idislot]);
1158
		GrSlotState * pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[idislot]);
1137
		if (pslot->AttachLevel() > nLevel)
1159
		// Kludge to handle the fact that we might have gotten the leaf from the wrong stream.
1160
		// Calling MidPassSlotAt finds the right one.
1161
		if (psstrmNext)
1162
		{
1163
			int islot = pslotLeaf->PosPassIndex();
1164
			pslotLeaf = psstrm->MidPassSlotAt(islot, psstrmNext);
1165
		}
1166
		if (pslotLeaf->AttachLevel() > nLevel)
1138
			continue;
1167
			continue;
1139
1168
1140
		m_xsClusterXOffset = min(m_xsClusterXOffset, pslot->m_xsClusterXOffset);
1169
		m_xsClusterXOffset = min(m_xsClusterXOffset, pslotLeaf->m_xsClusterXOffset);
1141
		if (!pslot->m_fIgnoreAdvance)
1170
		if (!pslotLeaf->m_fIgnoreAdvance)
1142
		{
1171
		{
1143
			m_xsClusterAdv = max(
1172
			m_xsClusterAdv = max(
1144
				m_xsClusterAdv,
1173
				m_xsClusterAdv,
1145
				pslot->m_xsClusterAdv + m_xsRootShiftX);
1174
				pslotLeaf->m_xsClusterAdv + m_xsRootShiftX);
1146
		}
1175
		}
1147
		m_xsClusterBbLeft = min(m_xsClusterBbLeft, pslot->m_xsClusterBbLeft);
1176
		m_xsClusterBbLeft = min(m_xsClusterBbLeft, pslotLeaf->m_xsClusterBbLeft);
1148
		m_xsClusterBbRight = max(m_xsClusterBbRight, pslot->m_xsClusterBbRight);
1177
		m_xsClusterBbRight = max(m_xsClusterBbRight, pslotLeaf->m_xsClusterBbRight);
1149
		m_ysClusterBbTop = max(m_ysClusterBbTop, pslot->m_ysClusterBbTop);
1178
		m_ysClusterBbTop = max(m_ysClusterBbTop, pslotLeaf->m_ysClusterBbTop);
1150
		m_ysClusterBbBottom = min(m_ysClusterBbBottom, pslot->m_ysClusterBbBottom);
1179
		m_ysClusterBbBottom = min(m_ysClusterBbBottom, pslotLeaf->m_ysClusterBbBottom);
1151
	}
1180
	}
1152
}
1181
}
1153
1182
Lines 1263-1269 Link Here
1263
/*----------------------------------------------------------------------------------------------
1292
/*----------------------------------------------------------------------------------------------
1264
	Y-offsets of a single glyph relative to the previous advance position.
1293
	Y-offsets of a single glyph relative to the previous advance position.
1265
----------------------------------------------------------------------------------------------*/
1294
----------------------------------------------------------------------------------------------*/
1266
float GrSlotState::GlyphYOffset(GrSlotStream * psstrm)
1295
float GrSlotState::GlyphYOffset(GrSlotStream * /*psstrm*/)
1267
{
1296
{
1268
	return m_ysOffsetY;
1297
	return m_ysOffsetY;
1269
}
1298
}
(-)misc/silgraphite-2.3.1/engine/src/segment/GrSlotState.h (-10 / +15 lines)
Lines 308-314 Link Here
308
	{
308
	{
309
		return m_islotPosPass;
309
		return m_islotPosPass;
310
	}
310
	}
311
#ifdef NDEBUG
312
	void SetPosPassIndex(int islot, bool /*fInputToPosPass1*/)
313
#else
311
	void SetPosPassIndex(int islot, bool fInputToPosPass1)
314
	void SetPosPassIndex(int islot, bool fInputToPosPass1)
315
#endif
312
	{
316
	{
313
		// If we're resetting it, it should be to the same value as before:
317
		// If we're resetting it, it should be to the same value as before:
314
		Assert(fInputToPosPass1 || m_islotPosPass == kNotYetSet || m_islotPosPass == islot);
318
		Assert(fInputToPosPass1 || m_islotPosPass == kNotYetSet || m_islotPosPass == islot);
Lines 386-397 Link Here
386
		return (IsInitialLineBreak(chwLB) || IsFinalLineBreak(chwLB));
390
		return (IsInitialLineBreak(chwLB) || IsFinalLineBreak(chwLB));
387
		//return (m_chwGlyphID == chwLB); // TODO: remove
391
		//return (m_chwGlyphID == chwLB); // TODO: remove
388
	}
392
	}
389
	bool IsInitialLineBreak(gid16 chwLB)
393
	bool IsInitialLineBreak(gid16 /*chwLB*/)
390
	{
394
	{
391
		return (m_spsl == kspslLbInitial);
395
		return (m_spsl == kspslLbInitial);
392
		//return (IsLineBreak(chwLB) && m_fInitialLB == true); // TODO: remove
396
		//return (IsLineBreak(chwLB) && m_fInitialLB == true); // TODO: remove
393
	}
397
	}
394
	bool IsFinalLineBreak(gid16 chwLB)
398
	bool IsFinalLineBreak(gid16 /*chwLB*/)
395
	{
399
	{
396
		return (m_spsl == kspslLbFinal);
400
		return (m_spsl == kspslLbFinal);
397
		//return (IsLineBreak(chwLB) && m_fInitialLB == false); // TODO: remove
401
		//return (IsLineBreak(chwLB) && m_fInitialLB == false); // TODO: remove
Lines 475-481 Link Here
475
		return m_mAttachAtX;
479
		return m_mAttachAtX;
476
	}
480
	}
477
481
478
	int AttachWithX(GrTableManager * ptman, GrSlotStream * psstrm)
482
	int AttachWithX(GrTableManager * /*ptman*/, GrSlotStream * /*psstrm*/)
479
	{
483
	{
480
		if (m_mAttachAtX == kNotYetSet)
484
		if (m_mAttachAtX == kNotYetSet)
481
		{
485
		{
Lines 615-621 Link Here
615
		GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis);
619
		GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis);
616
620
617
	void CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
621
	void CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
618
		int nLevel, bool fThorough = false);
622
		GrSlotStream * psstrmNext, int nLevel, bool fThorough = false);
619
623
620
	void Position(GrTableManager * ptman,
624
	void Position(GrTableManager * ptman,
621
		GrSlotStream * psstrmOut, int * pmXPos, int * pmYPos);
625
		GrSlotStream * psstrmOut, int * pmXPos, int * pmYPos);
Lines 646-652 Link Here
646
	{
650
	{
647
		return ClusterBbLeft(psstrm) + xs;
651
		return ClusterBbLeft(psstrm) + xs;
648
	}
652
	}
649
	float ClusterRsb(GrSlotStream * psstrm, float xs)
653
	float ClusterRsb(GrSlotStream * /*psstrm*/, float xs)
650
	{
654
	{
651
		return ClusterAdvWidthFrom(xs) - ClusterBbRightFrom(xs);
655
		return ClusterAdvWidthFrom(xs) - ClusterBbRightFrom(xs);
652
	}
656
	}
Lines 668-686 Link Here
668
	{
672
	{
669
		return ClusterBbRightFrom(Base(psstrm)->ClusterRootOffset());
673
		return ClusterBbRightFrom(Base(psstrm)->ClusterRootOffset());
670
	}
674
	}
671
	float ClusterBbTop(GrSlotStream * psstrm)
675
	float ClusterBbTop(GrSlotStream * /*psstrm*/)
672
	{
676
	{
673
		return m_ysClusterBbTop;
677
		return m_ysClusterBbTop;
674
	}
678
	}
675
	float ClusterBbBottom(GrSlotStream * psstrm)
679
	float ClusterBbBottom(GrSlotStream * /*psstrm*/)
676
	{
680
	{
677
		return m_ysClusterBbBottom;
681
		return m_ysClusterBbBottom;
678
	}
682
	}
679
	float ClusterBbWidth(GrSlotStream * psstrm)
683
	float ClusterBbWidth(GrSlotStream * /*psstrm*/)
680
	{
684
	{
681
		return m_xsClusterBbRight - m_xsClusterBbLeft + 1;
685
		return m_xsClusterBbRight - m_xsClusterBbLeft + 1;
682
	}
686
	}
683
	float ClusterBbHeight(GrSlotStream * psstrm)
687
	float ClusterBbHeight(GrSlotStream * /*psstrm*/)
684
	{
688
	{
685
		return m_ysClusterBbTop - m_ysClusterBbBottom + 1;
689
		return m_ysClusterBbTop - m_ysClusterBbBottom + 1;
686
	}
690
	}
Lines 990-996 Link Here
990
	void InitMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
994
	void InitMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
991
	void InitLeafMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
995
	void InitLeafMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
992
	void InitRootMetrics(GrTableManager * ptman);
996
	void InitRootMetrics(GrTableManager * ptman);
993
	void CalcRootMetrics(GrTableManager * ptman, GrSlotStream *, int nLevel);
997
	void CalcRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
998
		GrSlotStream * psstrmNext, int nLevel);
994
	void AttachToRoot(GrTableManager * ptman, GrSlotStream *, GrSlotState * pslotNewRoot);
999
	void AttachToRoot(GrTableManager * ptman, GrSlotStream *, GrSlotState * pslotNewRoot);
995
	void AttachLogUnits(GrTableManager * ptman,
1000
	void AttachLogUnits(GrTableManager * ptman,
996
		GrSlotState * pslotRoot,
1001
		GrSlotState * pslotRoot,
(-)misc/silgraphite-2.3.1/engine/src/segment/GrSlotStream.cpp (-10 / +52 lines)
Lines 189-200 Link Here
189
	stream position when the rule is being run.
189
	stream position when the rule is being run.
190
190
191
	@param dislot		- how far back to peek before the write position
191
	@param dislot		- how far back to peek before the write position
192
							when the rule started; a negative number
192
							WHEN THE RULE STARTED; a negative number
193
							(NOTE: the current write position is irrelevant)
193
							(NOTE: the current write position is irrelevant)
194
	@param fNullOkay	- true if it's okay to return NULL in the situation where we're asking
194
	@param fNullOkay	- true if it's okay to return NULL in the situation where we're asking
195
							for something before the beginning of the stream
195
							for something before the beginning of the stream
196
----------------------------------------------------------------------------------------------*/
196
----------------------------------------------------------------------------------------------*/
197
#ifdef NDEBUG
198
GrSlotState * GrSlotStream::PeekBack(int dislot, bool /*fNullOkay*/)
199
#else
197
GrSlotState * GrSlotStream::PeekBack(int dislot, bool fNullOkay)
200
GrSlotState * GrSlotStream::PeekBack(int dislot, bool fNullOkay)
201
#endif
198
{
202
{
199
	Assert(dislot < 0);
203
	Assert(dislot < 0);
200
	if (dislot < m_islotRuleStartWrite * -1)
204
	if (dislot < m_islotRuleStartWrite * -1)
Lines 1104-1109 Link Here
1104
	case kdircRLO:
1108
	case kdircRLO:
1105
	case kdircRLE:
1109
	case kdircRLE:
1106
	case kdircPdfR:
1110
	case kdircPdfR:
1111
	case kdircRlb:
1107
		return true;
1112
		return true;
1108
1113
1109
	case kdircNeutral:
1114
	case kdircNeutral:
Lines 1212-1218 Link Here
1212
			return true;
1217
			return true;
1213
1218
1214
		float xsWidth, xsVisWidth;
1219
		float xsWidth, xsVisWidth;
1215
		ptman->CalcPositionsUpTo(m_ipass, NULL, &xsWidth, &xsVisWidth);
1220
		ptman->CalcPositionsUpTo(m_ipass, NULL, false, &xsWidth, &xsVisWidth);
1216
1221
1217
		*pxsWidth = (fIgnoreTrailingWS || twsh == ktwshOnlyWs) ? xsVisWidth : xsWidth;
1222
		*pxsWidth = (fIgnoreTrailingWS || twsh == ktwshOnlyWs) ? xsVisWidth : xsWidth;
1218
        return (*pxsWidth < xsSpaceAllotted);
1223
        return (*pxsWidth < xsSpaceAllotted);
Lines 1322-1328 Link Here
1322
	@param islotMin			- first slot that is officially part of the segment (after initial LB)
1327
	@param islotMin			- first slot that is officially part of the segment (after initial LB)
1323
----------------------------------------------------------------------------------------------*/
1328
----------------------------------------------------------------------------------------------*/
1324
int GrSlotStream::MakeSegmentBreak(GrTableManager * ptman,
1329
int GrSlotStream::MakeSegmentBreak(GrTableManager * ptman,
1325
	int islotPrevBreak, bool fInsertedLB, int islotStartTry,
1330
	int /*islotPrevBreak*/, bool /*fInsertedLB*/, int islotStartTry,
1326
	LineBrk lb, TrWsHandling twsh, int islotMin,
1331
	LineBrk lb, TrWsHandling twsh, int islotMin,
1327
	LineBrk * plbNextToTry)
1332
	LineBrk * plbNextToTry)
1328
{
1333
{
Lines 1576-1582 Link Here
1576
	Return the break weight of the given slot, which should be a line-break.
1581
	Return the break weight of the given slot, which should be a line-break.
1577
	OBSOLETE??
1582
	OBSOLETE??
1578
----------------------------------------------------------------------------------------------*/
1583
----------------------------------------------------------------------------------------------*/
1584
#ifdef NDEBUG
1585
LineBrk GrSlotStream::BreakWeightAt(gid16 /*chwLB*/, int islot)
1586
#else
1579
LineBrk GrSlotStream::BreakWeightAt(gid16 chwLB, int islot)
1587
LineBrk GrSlotStream::BreakWeightAt(gid16 chwLB, int islot)
1588
#endif
1580
{	
1589
{	
1581
	GrSlotState * pslot = GetSlotAt(islot);
1590
	GrSlotState * pslot = GetSlotAt(islot);
1582
	Assert(pslot->IsLineBreak(chwLB));
1591
	Assert(pslot->IsLineBreak(chwLB));
Lines 1769-1775 Link Here
1769
	@param fBackingUp		- this chunk results in the stream position moving backwards,
1778
	@param fBackingUp		- this chunk results in the stream position moving backwards,
1770
								so clear anything we're backing over
1779
								so clear anything we're backing over
1771
----------------------------------------------------------------------------------------------*/
1780
----------------------------------------------------------------------------------------------*/
1772
void GrSlotStream::MapInputChunk(int islotInputMin, int islotOutputMin, int islotInputLim,
1781
void GrSlotStream::MapInputChunk(int islotInputMin, int islotOutputMin, int /*islotInputLim*/,
1773
	bool fSkipChunkStart, bool fBackingUp)
1782
	bool fSkipChunkStart, bool fBackingUp)
1774
{
1783
{
1775
	Assert(AssertValid());
1784
	Assert(AssertValid());
Lines 1828-1834 Link Here
1828
	@param fBackingUp		- this chunk results in the stream position moving backwards,
1837
	@param fBackingUp		- this chunk results in the stream position moving backwards,
1829
								so clear anything we're backing over
1838
								so clear anything we're backing over
1830
----------------------------------------------------------------------------------------------*/
1839
----------------------------------------------------------------------------------------------*/
1831
void GrSlotStream::MapOutputChunk(int islotOutputMin, int islotInputMin, int islotOutputLim,
1840
void GrSlotStream::MapOutputChunk(int islotOutputMin, int islotInputMin, int /*islotOutputLim*/,
1832
	bool fSkipChunkStart, int cslotReprocess, bool fBackingUp)
1841
	bool fSkipChunkStart, int cslotReprocess, bool fBackingUp)
1833
{
1842
{
1834
	Assert(AssertValid());
1843
	Assert(AssertValid());
Lines 1863-1869 Link Here
1863
	Ensure that the chunk maps for a pair of streams match properly. The recipient is
1872
	Ensure that the chunk maps for a pair of streams match properly. The recipient is
1864
	the input stream.
1873
	the input stream.
1865
----------------------------------------------------------------------------------------------*/
1874
----------------------------------------------------------------------------------------------*/
1875
#ifdef _DEBUG
1866
void GrSlotStream::AssertChunkMapsValid(GrSlotStream * psstrmOut)
1876
void GrSlotStream::AssertChunkMapsValid(GrSlotStream * psstrmOut)
1877
#else
1878
void GrSlotStream::AssertChunkMapsValid(GrSlotStream * )
1879
#endif
1867
{
1880
{
1868
#ifdef _DEBUG
1881
#ifdef _DEBUG
1869
	GrSlotStream * psstrmIn = this;
1882
	GrSlotStream * psstrmIn = this;
Lines 1915-1921 Link Here
1915
	Ensure that corresponding items in the streams of a positioning pass have matching
1924
	Ensure that corresponding items in the streams of a positioning pass have matching
1916
	stream indices. The recipient is the output stream.
1925
	stream indices. The recipient is the output stream.
1917
----------------------------------------------------------------------------------------------*/
1926
----------------------------------------------------------------------------------------------*/
1927
#ifdef _DEBUG
1918
void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * psstrmIn)
1928
void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * psstrmIn)
1929
#else
1930
void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * )
1931
#endif
1919
{
1932
{
1920
#ifdef _DEBUG
1933
#ifdef _DEBUG
1921
	if (!GotIndexOffset())
1934
	if (!GotIndexOffset())
Lines 1939-1945 Link Here
1939
	in the output stream. (Currently the compiler ensures this by making it an error
1948
	in the output stream. (Currently the compiler ensures this by making it an error
1940
	to write rules that don't do this.)
1949
	to write rules that don't do this.)
1941
----------------------------------------------------------------------------------------------*/
1950
----------------------------------------------------------------------------------------------*/
1951
#ifdef _DEBUG
1942
void GrSlotStream::AssertAttachmentsInOutput(int islotMin, int islotLim)
1952
void GrSlotStream::AssertAttachmentsInOutput(int islotMin, int islotLim)
1953
#else
1954
void GrSlotStream::AssertAttachmentsInOutput(int , int )
1955
#endif
1943
{
1956
{
1944
#ifdef _DEBUG
1957
#ifdef _DEBUG
1945
	for (int islot = islotMin; islot < islotLim; islot++)
1958
	for (int islot = islotMin; islot < islotLim; islot++)
Lines 2007-2013 Link Here
2007
	Record the number of slots in the stream that are previous to the official start of the
2016
	Record the number of slots in the stream that are previous to the official start of the
2008
	segment.
2017
	segment.
2009
----------------------------------------------------------------------------------------------*/
2018
----------------------------------------------------------------------------------------------*/
2019
#ifdef _DEBUG
2010
void GrSlotStream::CalcIndexOffset(GrTableManager * ptman)
2020
void GrSlotStream::CalcIndexOffset(GrTableManager * ptman)
2021
#else
2022
void GrSlotStream::CalcIndexOffset(GrTableManager * )
2023
#endif
2011
{
2024
{
2012
	if (GotIndexOffset())
2025
	if (GotIndexOffset())
2013
		return; // already figured it
2026
		return; // already figured it
Lines 2203-2208 Link Here
2203
}
2212
}
2204
2213
2205
/*----------------------------------------------------------------------------------------------
2214
/*----------------------------------------------------------------------------------------------
2215
	In the middle of running a pass, return the given slot to use in processing.
2216
	Read it from the reprocess buffer if appropriate, or for slots previous to the current
2217
	position, read from the output stream (psstrmNext).
2218
2219
	psstrmNext may be NULL when processing is complete, therefore we only have one stream to
2220
	deal with.
2221
----------------------------------------------------------------------------------------------*/
2222
GrSlotState * GrSlotStream::MidPassSlotAt(int islot, GrSlotStream * psstrmNext)
2223
{
2224
	int islotInput = islot - ReadPosForNextGet() + 1; // +1 because RuleInputSlot takes 0 to mean the previously read slot
2225
	GrSlotState * pslot = RuleInputSlot(islotInput, psstrmNext);
2226
	return pslot;
2227
}
2228
2229
/*----------------------------------------------------------------------------------------------
2206
	Return the "current" input item from the rule's perspective, ie, the last slot read.
2230
	Return the "current" input item from the rule's perspective, ie, the last slot read.
2207
	So dislotOffset = 0 means not the slot at the read position but one slot earlier.
2231
	So dislotOffset = 0 means not the slot at the read position but one slot earlier.
2208
2232
Lines 2214-2220 Link Here
2214
	@param fNullOkay	- true if it's okay to return NULL in the situation where we're asking
2238
	@param fNullOkay	- true if it's okay to return NULL in the situation where we're asking
2215
							for something before the beginning of the stream
2239
							for something before the beginning of the stream
2216
----------------------------------------------------------------------------------------------*/
2240
----------------------------------------------------------------------------------------------*/
2217
2218
GrSlotState * GrSlotStream::RuleInputSlot(int dislotOffset, GrSlotStream * psstrmOutput,
2241
GrSlotState * GrSlotStream::RuleInputSlot(int dislotOffset, GrSlotStream * psstrmOutput,
2219
	bool fNullOkay)
2242
	bool fNullOkay)
2220
{
2243
{
Lines 2244-2251 Link Here
2244
2267
2245
			if (cslotOffsetBack >= cslotPostReproc + cslotValidReproc)
2268
			if (cslotOffsetBack >= cslotPostReproc + cslotValidReproc)
2246
			{
2269
			{
2247
				// Read from the output stream.
2270
				// Read from the output stream. (Remember that PeekBack works relative to
2248
				int dislotTmp = dislotOffset - 1 + cslotPostReproc + cslotValidReproc;
2271
				// the rule-start write position, not the current write position.)
2272
				int dislotTmp = dislotOffset - 1 + cslotPostReproc
2273
					+ cslotValidReproc - SlotsToReprocess();
2249
				Assert(dislotTmp < 0);
2274
				Assert(dislotTmp < 0);
2250
				return psstrmOutput->PeekBack(dislotTmp);
2275
				return psstrmOutput->PeekBack(dislotTmp);
2251
			}
2276
			}
Lines 2253-2259 Link Here
2253
			{
2278
			{
2254
				if (m_islotReprocPos > -1)
2279
				if (m_islotReprocPos > -1)
2255
				{
2280
				{
2256
					//	Current read pos is inside reprocess buffer.
2281
					//	Current read pos could be inside reprocess buffer.
2257
					Assert(cslotPostReproc == 0);
2282
					Assert(cslotPostReproc == 0);
2258
					int islotStartReadReprocBuf = m_vpslotReproc.size() - cslotValidReproc;
2283
					int islotStartReadReprocBuf = m_vpslotReproc.size() - cslotValidReproc;
2259
					Assert(islotStartReadReprocBuf >= 0);
2284
					Assert(islotStartReadReprocBuf >= 0);
Lines 2342-2350 Link Here
2342
			else if (pslotAfter)
2367
			else if (pslotAfter)
2343
				pslot->Associate(pslotAfter);
2368
				pslot->Associate(pslotAfter);
2344
			else
2369
			else
2370
			{
2345
				// Weird, but can happen with an empty segment.
2371
				// Weird, but can happen with an empty segment.
2346
				Warn("No assocations");
2372
				Warn("No assocations");
2347
2373
			}
2348
//			Assert(pslot->m_vpslotAssoc.Size() > 0);
2374
//			Assert(pslot->m_vpslotAssoc.Size() > 0);
2349
			pslot->m_fNeutralAssocs = true;
2375
			pslot->m_fNeutralAssocs = true;
2350
		}
2376
		}
(-)misc/silgraphite-2.3.1/engine/src/segment/GrSlotStream.h (-2 / +8 lines)
Lines 107-113 Link Here
107
		ReleaseSlots(0, m_vpslot.size());
107
		ReleaseSlots(0, m_vpslot.size());
108
	}
108
	}
109
109
110
	void ReleaseSlots(int islotMin, int islotLim)
110
	void ReleaseSlots(int /*islotMin*/, int /*islotLim*/)
111
	{
111
	{
112
		//	A slot stream is responsible for deleting the slot states that it created,
112
		//	A slot stream is responsible for deleting the slot states that it created,
113
		//	that is, the ones whose modified tag equals this stream's pass index.
113
		//	that is, the ones whose modified tag equals this stream's pass index.
Lines 182-187 Link Here
182
		return Peek(islot - ReadPosForNextGet());
182
		return Peek(islot - ReadPosForNextGet());
183
	}
183
	}
184
184
185
	//	Return the functional read position, taking into account the reprocess buffer.
185
	int ReadPosForNextGet()
186
	int ReadPosForNextGet()
186
	{
187
	{
187
		return ReadPos() - SlotsToReprocess();
188
		return ReadPos() - SlotsToReprocess();
Lines 260-271 Link Here
260
261
261
	void MarkFullyWritten();
262
	void MarkFullyWritten();
262
263
264
#ifdef NDEBUG
265
	void SetSegMin(int islot, bool /*fAdjusting*/ = false)
266
#else
263
	void SetSegMin(int islot, bool fAdjusting = false)
267
	void SetSegMin(int islot, bool fAdjusting = false)
268
#endif
264
	{
269
	{
265
		Assert(fAdjusting || m_islotSegMin == -1 || m_islotSegMin == islot);
270
		Assert(fAdjusting || m_islotSegMin == -1 || m_islotSegMin == islot);
266
		m_islotSegMin = islot;
271
		m_islotSegMin = islot;
267
	}
272
	}
268
	void SetSegMinToWritePos(bool fMod = true)
273
	void SetSegMinToWritePos(bool /*fMod*/ = true)
269
	{
274
	{
270
		if (m_islotSegMin == -1)
275
		if (m_islotSegMin == -1)
271
			m_islotSegMin = m_islotWritePos;
276
			m_islotSegMin = m_islotWritePos;
Lines 456-461 Link Here
456
		}
461
		}
457
	}
462
	}
458
463
464
	GrSlotState * MidPassSlotAt(int islot, GrSlotStream * psstrmNext = NULL);
459
	GrSlotState * RuleInputSlot(int dislot = 0, GrSlotStream * psstrmOut = NULL,
465
	GrSlotState * RuleInputSlot(int dislot = 0, GrSlotStream * psstrmOut = NULL,
460
		bool fNullOkay = false);
466
		bool fNullOkay = false);
461
	GrSlotState * RuleOutputSlot(int dislot = 0);
467
	GrSlotState * RuleOutputSlot(int dislot = 0);
(-)misc/silgraphite-2.3.1/engine/src/segment/GrTableManager.cpp (-16 / +33 lines)
Lines 25-32 Link Here
25
DEFINE_THIS_FILE
25
DEFINE_THIS_FILE
26
#ifndef _WIN32
26
#ifndef _WIN32
27
#include <stdlib.h>
27
#include <stdlib.h>
28
#include <math.h>
29
#endif
28
#endif
29
#include <math.h>
30
30
31
//:>********************************************************************************************
31
//:>********************************************************************************************
32
//:>	Forward declarations
32
//:>	Forward declarations
Lines 572-578 Link Here
572
		else
572
		else
573
		{
573
		{
574
			Assert(!m_engst.m_fInsertedLB);
574
			Assert(!m_engst.m_fInsertedLB);
575
			Assert(islotUnderBreak == -1 || m_engst.m_fFinalLB);
575
			//Assert(islotUnderBreak == -1 || m_engst.m_fFinalLB); -- no, ExtendGlyphIDOutput clearly sets islotUnderBreak regardless
576
		}
576
		}
577
		int islotTmp = OutputStream(m_cpass - 1)->WritePos();
577
		int islotTmp = OutputStream(m_cpass - 1)->WritePos();
578
		GrSlotState * pslotTmp;
578
		GrSlotState * pslotTmp;
Lines 931-937 Link Here
931
	@param plbFound			- kind of line-break created
931
	@param plbFound			- kind of line-break created
932
----------------------------------------------------------------------------------------------*/
932
----------------------------------------------------------------------------------------------*/
933
bool GrTableManager::Backtrack(int * pislotPrevBreak,
933
bool GrTableManager::Backtrack(int * pislotPrevBreak,
934
	LineBrk * plbMin, LineBrk lbMax, TrWsHandling twsh, bool fMoreText,
934
	LineBrk * plbMin, LineBrk lbMax, TrWsHandling twsh, bool /*fMoreText*/,
935
	int ichwCallerBtLim, bool fEndLine,
935
	int ichwCallerBtLim, bool fEndLine,
936
	LineBrk * plbFound)
936
	LineBrk * plbFound)
937
{
937
{
Lines 1343-1349 Link Here
1343
	Calculate the associations, and record the output slots in the segment.
1343
	Calculate the associations, and record the output slots in the segment.
1344
----------------------------------------------------------------------------------------------*/
1344
----------------------------------------------------------------------------------------------*/
1345
void GrTableManager::RecordAssocsAndOutput(Font * pfont,
1345
void GrTableManager::RecordAssocsAndOutput(Font * pfont,
1346
	Segment * pseg, bool fWidthIsCharCount,
1346
	Segment * pseg, bool /*fWidthIsCharCount*/,
1347
	TrWsHandling twsh, bool fParaRtl, int nDirDepth)
1347
	TrWsHandling twsh, bool fParaRtl, int nDirDepth)
1348
{
1348
{
1349
	int cchwUnderlying = pseg->stopCharacter() - pseg->startCharacter();
1349
	int cchwUnderlying = pseg->stopCharacter() - pseg->startCharacter();
Lines 1362-1368 Link Here
1362
#endif // OLD_TEST_STUFF
1362
#endif // OLD_TEST_STUFF
1363
1363
1364
	//	Make sure the final positions are set for every glyph.
1364
	//	Make sure the final positions are set for every glyph.
1365
	CalcPositionsUpTo(m_cpass-1, reinterpret_cast<GrSlotState *>(NULL),
1365
	CalcPositionsUpTo(m_cpass-1, reinterpret_cast<GrSlotState *>(NULL), false,
1366
		&xsTotalWidth, &xsVisWidth); 
1366
		&xsTotalWidth, &xsVisWidth); 
1367
	pseg->SetWidths(xsVisWidth, xsTotalWidth);
1367
	pseg->SetWidths(xsVisWidth, xsTotalWidth);
1368
1368
Lines 1377-1383 Link Here
1377
	Calculate the underlying-to-surface associations and ligature mappings.
1377
	Calculate the underlying-to-surface associations and ligature mappings.
1378
	Assumes the arrays have been properly initialized.
1378
	Assumes the arrays have been properly initialized.
1379
----------------------------------------------------------------------------------------------*/
1379
----------------------------------------------------------------------------------------------*/
1380
void GrTableManager::CalculateAssociations(Segment * pseg, int csloutSurface)
1380
void GrTableManager::CalculateAssociations(Segment * pseg, int /*csloutSurface*/)
1381
{
1381
{
1382
	GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
1382
	GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
1383
1383
Lines 2350-2367 Link Here
2350
								final pass, but it could be another if positions are
2350
								final pass, but it could be another if positions are
2351
								requested by the rules themselves
2351
								requested by the rules themselves
2352
	@param pslotLast		- last slot that needs to be positioned, or NULL
2352
	@param pslotLast		- last slot that needs to be positioned, or NULL
2353
	@param fMidPass			- calculating the position of some slot in the middle of the pass
2353
	@param pxsWidth			- return the total width used so far
2354
	@param pxsWidth			- return the total width used so far
2354
	@param psxVisibleWidth	- return the visible width so far
2355
	@param psxVisibleWidth	- return the visible width so far
2355
2356
2356
	MOVE to EngineState
2357
	MOVE to EngineState
2357
----------------------------------------------------------------------------------------------*/
2358
----------------------------------------------------------------------------------------------*/
2358
void GrTableManager::CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
2359
void GrTableManager::CalcPositionsUpTo(int ipass, GrSlotState * pslotLast, bool fMidPass,
2359
	float * pxsWidth, float * pxsVisibleWidth)
2360
	float * pxsWidth, float * pxsVisibleWidth)
2360
{
2361
{
2361
	Assert(ipass >= m_ipassPos1 - 1);
2362
	Assert(ipass >= m_ipassPos1 - 1);
2362
2363
2363
	int isstrm = ipass;
2364
	int isstrm = ipass;
2364
	GrSlotStream * psstrm = OutputStream(isstrm);
2365
	GrSlotStream * psstrm = OutputStream(isstrm);
2366
	GrSlotStream * psstrmNext = (isstrm >= m_cpass - 1) ? NULL : OutputStream(isstrm + 1);
2365
	Assert(psstrm->GotIndexOffset());
2367
	Assert(psstrm->GotIndexOffset());
2366
	if (psstrm->WritePos() <= psstrm->IndexOffset())
2368
	if (psstrm->WritePos() <= psstrm->IndexOffset())
2367
	{
2369
	{
Lines 2399-2405 Link Here
2399
	//	to be later in the stream than the last actual slot passed in.
2401
	//	to be later in the stream than the last actual slot passed in.
2400
	if (!psstrm->HasSlotAtPosPassIndex(pslotLast->AttachRootPosPassIndex()))
2402
	if (!psstrm->HasSlotAtPosPassIndex(pslotLast->AttachRootPosPassIndex()))
2401
		return;
2403
		return;
2402
	GrSlotState * pslotLastBase = pslotLast->Base(psstrm);
2404
	GrSlotState * pslotLastBase = (fMidPass && pslotLast->PosPassIndex() < psstrm->WritePos())
2405
		? pslotLast->Base(psstrmNext)
2406
		: pslotLast->Base(psstrm);
2403
2407
2404
	if (ipass == m_cpass - 1 && m_engst.m_islotPosNext > -1)
2408
	if (ipass == m_cpass - 1 && m_engst.m_islotPosNext > -1)
2405
	{
2409
	{
Lines 2428-2433 Link Here
2428
	}
2432
	}
2429
2433
2430
	std::vector<GrSlotState *> vpslotAttached;
2434
	std::vector<GrSlotState *> vpslotAttached;
2435
	std::vector<GrSlotStream *> vpsstrmAttached;
2431
2436
2432
	bool fRtl = RightToLeft();
2437
	bool fRtl = RightToLeft();
2433
2438
Lines 2435-2447 Link Here
2435
	{
2440
	{
2436
		Assert(islot < psstrm->SlotsPresent());
2441
		Assert(islot < psstrm->SlotsPresent());
2437
2442
2438
		pslot = (isstrm == ipass) ?	psstrm->SlotAt(islot) :	psstrm->OutputSlotAt(islot);
2443
		GrSlotStream * psstrmThis = psstrm;
2444
		if (fMidPass && islot < psstrm->WritePos())
2445
		{
2446
			pslot = psstrm->MidPassSlotAt(islot, psstrmNext);
2447
			psstrmThis = psstrmNext;
2448
		}
2449
		else
2450
		{
2451
			//pslot = (isstrm == ipass) ?	psstrm->SlotAt(islot) :	psstrm->OutputSlotAt(islot);
2452
			pslot = psstrm->SlotAt(islot);
2453
		}
2439
2454
2440
		if (!pslot->IsBase())
2455
		if (!pslot->IsBase())
2441
		{
2456
		{
2442
			//	This slot is attached to another; it will be positioned strictly
2457
			//	This slot is attached to another; it will be positioned strictly
2443
			//	relative to that one. This happens in the loop below.
2458
			//	relative to that one. This happens in the loop below.
2444
			vpslotAttached.push_back(pslot);
2459
			vpslotAttached.push_back(pslot);
2460
			vpsstrmAttached.push_back(psstrmThis);
2445
		}
2461
		}
2446
		else
2462
		else
2447
		{
2463
		{
Lines 2455-2461 Link Here
2455
			}
2471
			}
2456
2472
2457
			//	Make sure the metrics are the complete ones.
2473
			//	Make sure the metrics are the complete ones.
2458
			pslot->CalcCompositeMetrics(this, psstrm, kPosInfinity, true);
2474
			pslot->CalcCompositeMetrics(this, psstrm, psstrmNext, kPosInfinity, true);
2459
2475
2460
			float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
2476
			float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
2461
			float ysInc = pslot->GlyphYOffset(psstrm);
2477
			float ysInc = pslot->GlyphYOffset(psstrm);
Lines 2514-2521 Link Here
2514
2530
2515
	for (size_t ipslot = 0; ipslot < vpslotAttached.size(); ipslot++)
2531
	for (size_t ipslot = 0; ipslot < vpslotAttached.size(); ipslot++)
2516
	{
2532
	{
2517
		GrSlotState * pslot = vpslotAttached[ipslot];
2533
		GrSlotState * pslotAtt = vpslotAttached[ipslot];
2518
		GrSlotState * pslotBase = pslot->Base(psstrm);
2534
		GrSlotStream * psstrmAtt = vpsstrmAttached[ipslot];
2535
		GrSlotState * pslotBase = pslotAtt->Base(psstrmAtt);
2519
		if (pslotBase->XPosition() == kNegInfinity || pslotBase->YPosition() == kNegInfinity)
2536
		if (pslotBase->XPosition() == kNegInfinity || pslotBase->YPosition() == kNegInfinity)
2520
		{
2537
		{
2521
			Assert(false);
2538
			Assert(false);
Lines 2523-2532 Link Here
2523
		}
2540
		}
2524
		float xsCluster = pslotBase->XPosition() - pslotBase->GlyphXOffset(psstrm, fakeItalicRatio);
2541
		float xsCluster = pslotBase->XPosition() - pslotBase->GlyphXOffset(psstrm, fakeItalicRatio);
2525
		float ysCluster = pslotBase->YPosition() - pslotBase->GlyphYOffset(psstrm);
2542
		float ysCluster = pslotBase->YPosition() - pslotBase->GlyphYOffset(psstrm);
2526
		float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
2543
		float xsInc = pslotAtt->GlyphXOffset(psstrm, fakeItalicRatio);
2527
		float ysInc = pslot->GlyphYOffset(psstrm);
2544
		float ysInc = pslotAtt->GlyphYOffset(psstrm);
2528
		pslot->SetXPos(xsCluster + xsInc);
2545
		pslotAtt->SetXPos(xsCluster + xsInc);
2529
		pslot->SetYPos(ysCluster + ysInc);
2546
		pslotAtt->SetYPos(ysCluster + ysInc);
2530
2547
2531
		//	My theory is that we don't need to adjust *pxsWidth here, because the width of
2548
		//	My theory is that we don't need to adjust *pxsWidth here, because the width of
2532
		//	any non-base slots should be factored into the advance width of their cluster
2549
		//	any non-base slots should be factored into the advance width of their cluster
(-)misc/silgraphite-2.3.1/engine/src/segment/GrTableManager.h (-1 / +1 lines)
Lines 442-448 Link Here
442
	int LogToEmUnits(float xys);
442
	int LogToEmUnits(float xys);
443
	bool GPointToXY(gid16 chwGlyphID, int nGPoint, float * xs, float * ys);
443
	bool GPointToXY(gid16 chwGlyphID, int nGPoint, float * xs, float * ys);
444
444
445
	void CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
445
	void CalcPositionsUpTo(int ipass, GrSlotState * pslotLast, bool fMidPass,
446
		float * pxsWidth, float * pxsVisibleWidth);
446
		float * pxsWidth, float * pxsVisibleWidth);
447
447
448
	void InitPosCache()
448
	void InitPosCache()
(-)misc/silgraphite-2.3.1/engine/src/segment/Platform.cpp (-1 / +1 lines)
Lines 103-109 Link Here
103
{
103
{
104
	// assumes NULL terminated strings
104
	// assumes NULL terminated strings
105
	const utf16 *start = s;
105
	const utf16 *start = s;
106
	for (; *s; ++s);
106
	for (; *s; ++s) {};
107
	
107
	
108
	return s - start;
108
	return s - start;
109
}
109
}
(-)misc/silgraphite-2.3.1/engine/src/segment/Segment.cpp (-16 / +24 lines)
Lines 1178-1184 Link Here
1178
	part of the segment.
1178
	part of the segment.
1179
----------------------------------------------------------------------------------------------*/
1179
----------------------------------------------------------------------------------------------*/
1180
float Segment::getRangeWidth(int ichMin, int ichLim,
1180
float Segment::getRangeWidth(int ichMin, int ichLim,
1181
	bool fStartLine, bool fEndLine, bool fSkipSpace)
1181
	bool /*fStartLine*/, bool /*fEndLine*/, bool fSkipSpace)
1182
{
1182
{
1183
	if (m_dxsWidth < 0)
1183
	if (m_dxsWidth < 0)
1184
	{
1184
	{
Lines 1549-1555 Link Here
1549
void Segment::SetUpOutputArrays(Font * pfont, GrTableManager * ptman,
1549
void Segment::SetUpOutputArrays(Font * pfont, GrTableManager * ptman,
1550
	GrSlotStream * psstrmFinal,
1550
	GrSlotStream * psstrmFinal,
1551
	int cchwInThisSeg, int csloutSurface, gid16 chwLB,
1551
	int cchwInThisSeg, int csloutSurface, gid16 chwLB,
1552
#ifdef NDEBUG
1553
	TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool /*fEmpty*/)
1554
#else
1552
	TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool fEmpty)
1555
	TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool fEmpty)
1556
#endif
1553
{
1557
{
1554
	m_mFontEmUnits = EngineImpl()->GetFontEmUnits();
1558
	m_mFontEmUnits = EngineImpl()->GetFontEmUnits();
1555
1559
Lines 1725-1731 Link Here
1725
	Set up the data structures that represent the actual rendered glyphs for the new segment.
1729
	Set up the data structures that represent the actual rendered glyphs for the new segment.
1726
----------------------------------------------------------------------------------------------*/
1730
----------------------------------------------------------------------------------------------*/
1727
void Segment::SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal,
1731
void Segment::SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal,
1728
	gid16 chwLB, int nDirDepth, int islotMin, int cslot)
1732
	gid16 chwLB, int /*nDirDepth*/, int islotMin, int cslot)
1729
{
1733
{
1730
	//int paraDirLevel = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
1734
	//int paraDirLevel = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
1731
1735
Lines 1751-1757 Link Here
1751
1755
1752
	m_isloutGinf0 = -1;
1756
	m_isloutGinf0 = -1;
1753
	int iginf = 0;
1757
	int iginf = 0;
1754
	for (int islot = islotMin; islot < cslot; islot++)
1758
	for (islot = islotMin; islot < cslot; islot++)
1755
	{
1759
	{
1756
		GrSlotState * pslot = psstrmFinal->SlotAt(islot);
1760
		GrSlotState * pslot = psstrmFinal->SlotAt(islot);
1757
1761
Lines 2160-2166 Link Here
2160
	@param ichwUnder		- character index relative to the official beginning of the segment
2164
	@param ichwUnder		- character index relative to the official beginning of the segment
2161
	@param islot			- processed glyph it maps to
2165
	@param islot			- processed glyph it maps to
2162
----------------------------------------------------------------------------------------------*/
2166
----------------------------------------------------------------------------------------------*/
2163
void Segment::MarkSlotInPrevSeg(int ichwUnder, int islot)
2167
void Segment::MarkSlotInPrevSeg(int ichwUnder, int /*islot*/)
2164
{
2168
{
2165
	if (ichwUnder >= m_ichwAssocsMin)
2169
	if (ichwUnder >= m_ichwAssocsMin)
2166
		m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] = kNegInfinity;
2170
		m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] = kNegInfinity;
Lines 2174-2180 Link Here
2174
	@param ichwUnder		- character index relative to the official beginning of the segment
2178
	@param ichwUnder		- character index relative to the official beginning of the segment
2175
	@param islot			- processed glyph it maps to
2179
	@param islot			- processed glyph it maps to
2176
----------------------------------------------------------------------------------------------*/
2180
----------------------------------------------------------------------------------------------*/
2177
void Segment::MarkSlotInNextSeg(int ichwUnder, int islot)
2181
void Segment::MarkSlotInNextSeg(int ichwUnder, int /*islot*/)
2178
{
2182
{
2179
	if (ichwUnder < m_ichwAssocsLim)
2183
	if (ichwUnder < m_ichwAssocsLim)
2180
		m_prgisloutAfter[ichwUnder - m_ichwAssocsMin] = kPosInfinity;
2184
		m_prgisloutAfter[ichwUnder - m_ichwAssocsMin] = kPosInfinity;
Lines 2351-2357 Link Here
2351
	@param pfAfter			- return true if they clicked on trailing side; possibly NULL
2355
	@param pfAfter			- return true if they clicked on trailing side; possibly NULL
2352
----------------------------------------------------------------------------------------------*/
2356
----------------------------------------------------------------------------------------------*/
2353
int Segment::LogicalSurfaceToUnderlying(int islout, float xsOffset, float ysClick,
2357
int Segment::LogicalSurfaceToUnderlying(int islout, float xsOffset, float ysClick,
2354
	float dxsGlyphWidth, float dysGlyphHeight, bool * pfAfter)
2358
	float dxsGlyphWidth, float /*dysGlyphHeight*/, bool * pfAfter)
2355
{
2359
{
2356
	Assert(islout >= 0);
2360
	Assert(islout >= 0);
2357
	Assert(islout < m_cslout);
2361
	Assert(islout < m_cslout);
Lines 2529-2559 Link Here
2529
	else if (fBefore)
2533
	else if (fBefore)
2530
	{
2534
	{
2531
		int isloutRet;
2535
		int isloutRet;
2532
		int ichw = ichwSegOffset;
2536
		int ichwTemp = ichwSegOffset;
2533
		//	If no association has been made, loop forward to the next slot
2537
		//	If no association has been made, loop forward to the next slot
2534
		//	we are before. As a last resort, answer kPosInfinity, meaning we
2538
		//	we are before. As a last resort, answer kPosInfinity, meaning we
2535
		//	aren't before anything.
2539
		//	aren't before anything.
2536
		do
2540
		do
2537
		{
2541
		{
2538
			isloutRet = m_prgisloutBefore[ichw - m_ichwAssocsMin];
2542
			isloutRet = m_prgisloutBefore[ichwTemp - m_ichwAssocsMin];
2539
			do { ++ichw; }
2543
			do { ++ichwTemp; }
2540
			while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
2544
			while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwTemp));
2541
		} while (isloutRet == kPosInfinity && ichw < m_ichwAssocsLim);
2545
		} while (isloutRet == kPosInfinity && ichwTemp < m_ichwAssocsLim);
2542
		return isloutRet;
2546
		return isloutRet;
2543
	}
2547
	}
2544
	else
2548
	else
2545
	{
2549
	{
2546
		int isloutRet;
2550
		int isloutRet;
2547
		int ichw = ichwSegOffset;
2551
		int ichwTemp = ichwSegOffset;
2548
		//	If no association has been made, loop backward to the previous slot
2552
		//	If no association has been made, loop backward to the previous slot
2549
		//	we are after. As a last resort, answer kNegInfinity, meaning we
2553
		//	we are after. As a last resort, answer kNegInfinity, meaning we
2550
		//	aren't after anything.
2554
		//	aren't after anything.
2551
		do
2555
		do
2552
		{
2556
		{
2553
			isloutRet = m_prgisloutAfter[ichw - m_ichwAssocsMin];
2557
			isloutRet = m_prgisloutAfter[ichwTemp - m_ichwAssocsMin];
2554
			do { --ichw; }
2558
			do { --ichwTemp; }
2555
			while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
2559
			while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwTemp));
2556
		} while (isloutRet == kNegInfinity && ichw >= 0);
2560
		} while (isloutRet == kNegInfinity && ichwTemp >= 0);
2557
		return isloutRet;
2561
		return isloutRet;
2558
	}
2562
	}
2559
	Assert(false); // should never reach here
2563
	Assert(false); // should never reach here
Lines 2748-2754 Link Here
2748
	that root glyph as one of its roots.
2752
	that root glyph as one of its roots.
2749
	OBSOLETE
2753
	OBSOLETE
2750
----------------------------------------------------------------------------------------------*/
2754
----------------------------------------------------------------------------------------------*/
2755
#ifdef _DEBUG
2751
void Segment::AssertValidClusters(GrSlotStream * psstrm)
2756
void Segment::AssertValidClusters(GrSlotStream * psstrm)
2757
#else
2758
void Segment::AssertValidClusters(GrSlotStream * /*psstrm*/)
2759
#endif
2752
{
2760
{
2753
#ifdef _DEBUG
2761
#ifdef _DEBUG
2754
	for (int islot = 0; islot < psstrm->WritePos(); islot++)
2762
	for (int islot = 0; islot < psstrm->WritePos(); islot++)
(-)misc/silgraphite-2.3.1/engine/src/segment/TransductionLog.cpp (-13 / +13 lines)
Lines 175-181 Link Here
175
	Output a file showing a log of the transduction process and the resulting segment.
175
	Output a file showing a log of the transduction process and the resulting segment.
176
----------------------------------------------------------------------------------------------*/
176
----------------------------------------------------------------------------------------------*/
177
void GrTableManager::WriteXductnLog(std::ostream & strmOut,
177
void GrTableManager::WriteXductnLog(std::ostream & strmOut,
178
	GrCharStream * pchstrm, Segment * psegRet,
178
	GrCharStream * pchstrm, Segment * /*psegRet*/,
179
	int cbPrevSegDat, byte * pbPrevSegDat)
179
	int cbPrevSegDat, byte * pbPrevSegDat)
180
{
180
{
181
	if (cbPrevSegDat == 0)
181
	if (cbPrevSegDat == 0)
Lines 416-423 Link Here
416
	the raw (UTF-16 or UTF-8) chars for display. To do this we get the raw characters
416
	the raw (UTF-16 or UTF-8) chars for display. To do this we get the raw characters
417
	directly from the text source.
417
	directly from the text source.
418
----------------------------------------------------------------------------------------------*/
418
----------------------------------------------------------------------------------------------*/
419
void GrCharStream::GetLogDataRaw(GrTableManager * ptman, int cchl, int cchrBackup,
419
void GrCharStream::GetLogDataRaw(GrTableManager * /*ptman*/, int cchl, int cchrBackup,
420
	int cchrMaxRaw, int * prgchl,
420
	int /*cchrMaxRaw*/, int * prgchl,
421
	utf16 * prgchw2, utf16 * prgchw3, utf16 * prgchw4, utf16 * prgchw5, utf16 * prgchw6, 
421
	utf16 * prgchw2, utf16 * prgchw3, utf16 * prgchw4, utf16 * prgchw5, utf16 * prgchw6, 
422
	int * prgcchr)
422
	int * prgcchr)
423
{
423
{
Lines 441-447 Link Here
441
	case kutf8:
441
	case kutf8:
442
		prgchsRunText8 = new utf8[cchrRange];
442
		prgchsRunText8 = new utf8[cchrRange];
443
		m_pgts->fetch(ichrMin, cchrRange, prgchsRunText8);
443
		m_pgts->fetch(ichrMin, cchrRange, prgchsRunText8);
444
		for (int ichr = 0; ichr < cchrRange; ichr++)
444
		for (ichr = 0; ichr < cchrRange; ichr++)
445
			prgchwRunText[ichr] = (utf16)prgchsRunText8[ichr];	// zero-extend into UTF-16 buffer
445
			prgchwRunText[ichr] = (utf16)prgchsRunText8[ichr];	// zero-extend into UTF-16 buffer
446
		break;
446
		break;
447
	case kutf16:
447
	case kutf16:
Lines 634-640 Link Here
634
	m_pzpst->LogRulesFiredAndFailed(strmOut, psstrmIn);
634
	m_pzpst->LogRulesFiredAndFailed(strmOut, psstrmIn);
635
}
635
}
636
636
637
void PassState::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn)
637
void PassState::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * /*psstrmIn*/)
638
{
638
{
639
639
640
	strmOut << "PASS " << m_ipass << "\n\n" << "Rules matched: ";
640
	strmOut << "PASS " << m_ipass << "\n\n" << "Rules matched: ";
Lines 1193-1199 Link Here
1193
	if (fAnyPseudos)
1193
	if (fAnyPseudos)
1194
	{
1194
	{
1195
		strmOut << "Actual glyphs: ";
1195
		strmOut << "Actual glyphs: ";
1196
		for (int islout = 0; islout < m_cslout; islout++)
1196
		for (islout = 0; islout < m_cslout; islout++)
1197
		{
1197
		{
1198
			GrSlotOutput * psloutTmp = m_prgslout + islout;
1198
			GrSlotOutput * psloutTmp = m_prgslout + islout;
1199
			if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
1199
			if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
Lines 1319-1325 Link Here
1319
	Write out the header lines for the slot contents.
1319
	Write out the header lines for the slot contents.
1320
----------------------------------------------------------------------------------------------*/
1320
----------------------------------------------------------------------------------------------*/
1321
void GrTableManager::LogSlotHeader(std::ostream & strmOut, int islotLim,
1321
void GrTableManager::LogSlotHeader(std::ostream & strmOut, int islotLim,
1322
	int cspPerSlot, int cspLeading, int islotMin)
1322
	int /*cspPerSlot*/, int cspLeading, int islotMin)
1323
{
1323
{
1324
	islotLim = min(islotLim, MAX_SLOTS);
1324
	islotLim = min(islotLim, MAX_SLOTS);
1325
1325
Lines 1721-1727 Link Here
1721
1721
1722
	case kslatAttAtX:	// always do these in pairs
1722
	case kslatAttAtX:	// always do these in pairs
1723
	case kslatAttAtY:
1723
	case kslatAttAtY:
1724
		if (m_mAttachAtX != (pslotPrev ? pslotPrev->m_mAttachAtX : kNotYetSet) ||
1724
		if (m_mAttachAtX != (pslotPrev ? pslotPrev->m_mAttachAtX : static_cast<short>(kNotYetSet)) ||
1725
			m_mAttachAtY != (pslotPrev ? pslotPrev->m_mAttachAtY : 0))
1725
			m_mAttachAtY != (pslotPrev ? pslotPrev->m_mAttachAtY : 0))
1726
		{
1726
		{
1727
			ptman->LogInTable(strmOut,
1727
			ptman->LogInTable(strmOut,
Lines 1730-1736 Link Here
1730
		}
1730
		}
1731
		break;
1731
		break;
1732
	case kslatAttAtGpt:
1732
	case kslatAttAtGpt:
1733
		if (m_nAttachAtGpoint != (pslotPrev ? pslotPrev->m_nAttachAtGpoint : kNotYetSet))
1733
		if (m_nAttachAtGpoint != (pslotPrev ? pslotPrev->m_nAttachAtGpoint : static_cast<short>(kNotYetSet)))
1734
		{
1734
		{
1735
			ptman->LogInTable(strmOut,
1735
			ptman->LogInTable(strmOut,
1736
				((m_nAttachAtGpoint == kGpointZero) ? 0 : m_nAttachAtGpoint));
1736
				((m_nAttachAtGpoint == kGpointZero) ? 0 : m_nAttachAtGpoint));
Lines 1750-1756 Link Here
1750
1750
1751
	case kslatAttWithX:	// always do these in pairs
1751
	case kslatAttWithX:	// always do these in pairs
1752
	case kslatAttWithY:
1752
	case kslatAttWithY:
1753
		if (m_mAttachWithX != (pslotPrev ? pslotPrev->m_mAttachWithX : kNotYetSet) ||
1753
		if (m_mAttachWithX != (pslotPrev ? pslotPrev->m_mAttachWithX : static_cast<short>(kNotYetSet)) ||
1754
			m_mAttachWithY != (pslotPrev ? pslotPrev->m_mAttachWithY : 0))
1754
			m_mAttachWithY != (pslotPrev ? pslotPrev->m_mAttachWithY : 0))
1755
		{
1755
		{
1756
			ptman->LogInTable(strmOut,
1756
			ptman->LogInTable(strmOut,
Lines 1759-1765 Link Here
1759
		}
1759
		}
1760
		break;
1760
		break;
1761
	case kslatAttWithGpt:
1761
	case kslatAttWithGpt:
1762
		if (m_nAttachWithGpoint != (pslotPrev ? pslotPrev->m_nAttachWithGpoint : kNotYetSet))
1762
		if (m_nAttachWithGpoint != (pslotPrev ? pslotPrev->m_nAttachWithGpoint : static_cast<short>(kNotYetSet)))
1763
		{
1763
		{
1764
			ptman->LogInTable(strmOut,
1764
			ptman->LogInTable(strmOut,
1765
				((m_nAttachWithGpoint == kGpointZero) ? 0 : m_nAttachWithGpoint));
1765
				((m_nAttachWithGpoint == kGpointZero) ? 0 : m_nAttachWithGpoint));
Lines 1786-1799 Link Here
1786
		break;
1786
		break;
1787
1787
1788
	case kslatBreak:
1788
	case kslatBreak:
1789
		if (m_lb != (pslotPrev ? pslotPrev->m_lb : kNotYetSet8))
1789
		if (m_lb != (pslotPrev ? pslotPrev->m_lb : static_cast<sdata8>(kNotYetSet8)))
1790
		{
1790
		{
1791
			ptman->LogBreakWeightInTable(strmOut, m_lb);
1791
			ptman->LogBreakWeightInTable(strmOut, m_lb);
1792
			return;
1792
			return;
1793
		}
1793
		}
1794
		break;
1794
		break;
1795
	case kslatDir:
1795
	case kslatDir:
1796
		if (m_dirc != (pslotPrev ? pslotPrev->m_dirc : kNotYetSet8))
1796
		if (m_dirc != (pslotPrev ? pslotPrev->m_dirc : static_cast<sdata8>(kNotYetSet8)))
1797
		{
1797
		{
1798
			ptman->LogDirCodeInTable(strmOut, m_dirc);
1798
			ptman->LogDirCodeInTable(strmOut, m_dirc);
1799
			return;
1799
			return;
(-)misc/silgraphite-2.3.1/engine/test/ProfileHarness/GrUtfTextSrc.cpp (-7 / +7 lines)
Lines 210-221 Link Here
210
}
210
}
211
211
212
212
213
bool GrUtfTextSrc::getRightToLeft(gr::toffset ich)
213
bool GrUtfTextSrc::getRightToLeft(gr::toffset /*ich*/)
214
{
214
{
215
	return mRtl; // assumes src only contains one direction
215
	return mRtl; // assumes src only contains one direction
216
}
216
}
217
217
218
unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset ich)
218
unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset /*ich*/)
219
{
219
{
220
	return (mRtl) ? 1 : 0; // TBD
220
	return (mRtl) ? 1 : 0; // TBD
221
}
221
}
Lines 254-260 Link Here
254
	return range;
254
	return range;
255
}
255
}
256
	
256
	
257
size_t GrUtfTextSrc::getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset)
257
size_t GrUtfTextSrc::getFontFeatures(gr::toffset /*ich*/, gr::FeatureSetting * /*prgfset*/)
258
{
258
{
259
	return 0;
259
	return 0;
260
}
260
}
Lines 277-290 Link Here
277
277
278
// these should be called I hope
278
// these should be called I hope
279
float
279
float
280
GrUtfTextSrc::getFontSize(gr::toffset ich)
280
GrUtfTextSrc::getFontSize(gr::toffset /*ich*/)
281
{
281
{
282
	assert(mFont);
282
	assert(mFont);
283
	return mPointSize;
283
	return mPointSize;
284
}
284
}
285
285
286
bool
286
bool
287
GrUtfTextSrc::getBold(gr::toffset ich)
287
GrUtfTextSrc::getBold(gr::toffset /*ich*/)
288
{
288
{
289
	assert(mFont);
289
	assert(mFont);
290
//	NS_ASSERTION(false, "unexpected call to getBold");
290
//	NS_ASSERTION(false, "unexpected call to getBold");
Lines 293-299 Link Here
293
}
293
}
294
294
295
bool
295
bool
296
GrUtfTextSrc::getItalic(gr::toffset ich)
296
GrUtfTextSrc::getItalic(gr::toffset /*ich*/)
297
{
297
{
298
	assert(mFont);
298
	assert(mFont);
299
	//NS_ASSERTION(false, "unexpected call to getItalic");
299
	//NS_ASSERTION(false, "unexpected call to getItalic");
Lines 301-307 Link Here
301
	return mFont->italic();
301
	return mFont->italic();
302
}
302
}
303
303
304
gr::isocode GrUtfTextSrc::getLanguage(gr::toffset ich)
304
gr::isocode GrUtfTextSrc::getLanguage(gr::toffset /*ich*/)
305
{
305
{
306
  gr::isocode unknown;
306
  gr::isocode unknown;
307
  std::fill_n(unknown.rgch, 4, '\0');
307
  std::fill_n(unknown.rgch, 4, '\0');
(-)misc/silgraphite-2.3.1/engine/test/ProfileHarness/GrUtfTextSrc.h (-8 / +8 lines)
Lines 79-85 Link Here
79
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer);
79
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer);
80
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
80
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
81
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8  * prgchsBuffer);
81
  virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8  * prgchsBuffer);
82
  virtual gr::GrResult getFaceName(int ich, unsigned int cchMax,
82
  virtual gr::GrResult getFaceName(int /*ich*/, unsigned int /*cchMax*/,
83
    gr::utf16 * prgchFaceName, unsigned int * pcchLen) 
83
    gr::utf16 * prgchFaceName, unsigned int * pcchLen) 
84
  {
84
  {
85
    prgchFaceName[0] = 0;
85
    prgchFaceName[0] = 0;
Lines 92-103 Link Here
92
  virtual bool getItalic(gr::toffset ich);
92
  virtual bool getItalic(gr::toffset ich);
93
  virtual bool getRightToLeft(gr::toffset ich);
93
  virtual bool getRightToLeft(gr::toffset ich);
94
  virtual unsigned int getDirectionDepth(gr::toffset ich);
94
  virtual unsigned int getDirectionDepth(gr::toffset ich);
95
  virtual float getVerticalOffset(gr::toffset ich) { return 0;};
95
  virtual float getVerticalOffset(gr::toffset /*ich*/) { return 0;};
96
  virtual gr::isocode getLanguage(gr::toffset ich);
96
  virtual gr::isocode getLanguage(gr::toffset ich);
97
97
98
  virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
98
  virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
99
  virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
99
  virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
100
  virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2) { return true; };
100
  virtual bool sameSegment(gr::toffset /*ich1*/, gr::toffset /*ich2*/) { return true; };
101
101
102
protected:
102
protected:
103
  bool checkBuffer8();
103
  bool checkBuffer8();
Lines 129-139 Link Here
129
  virtual void getColors(gr::toffset ich, int * pclrFore, int * pclrBack);
129
  virtual void getColors(gr::toffset ich, int * pclrFore, int * pclrBack);
130
130
131
  // Shouldn't be here!  
131
  // Shouldn't be here!  
132
  virtual gr::GrResult Fetch(int ichMin, int ichLim, gr::utf16 * prgchBuf) { return gr::kresNotImpl; };
132
  virtual gr::GrResult Fetch(int /*ichMin*/, int /*ichLim*/, gr::utf16 * /*prgchBuf*/) { return gr::kresNotImpl; };
133
  virtual gr::GrResult get_Length(int * pcch) { return gr::kresNotImpl; };
133
  virtual gr::GrResult get_Length(int * /*pcch*/) { return gr::kresNotImpl; };
134
  virtual gr::GrResult GetFontVariations(int ich,
134
  virtual gr::GrResult GetFontVariations(int /*ich*/,
135
    wchar_t * prgchFontVar, int ichMax, int * pich,
135
    wchar_t * /*prgchFontVar*/, int /*ichMax*/, int * /*pich*/,
136
    int * pichMin, int * pichLim) { return gr::kresNotImpl; };
136
    int * /*pichMin*/, int * /*pichLim*/) { return gr::kresNotImpl; };
137
137
138
};
138
};
139
139
(-)misc/silgraphite-2.3.1/engine/test/ProfileHarness/ProfileHarness.cpp (-2 / +2 lines)
Lines 39-52 Link Here
39
typedef std::pair< gr::GlyphIterator, gr::GlyphIterator > GlyphRange;
39
typedef std::pair< gr::GlyphIterator, gr::GlyphIterator > GlyphRange;
40
40
41
#ifndef HAVE_STRTOF
41
#ifndef HAVE_STRTOF
42
float strtof(char * text, char ** ignore)
42
float strtof(char * text, char ** /*ignore*/)
43
{
43
{
44
  return static_cast<float>(atof(text));
44
  return static_cast<float>(atof(text));
45
}
45
}
46
#endif
46
#endif
47
47
48
#ifndef HAVE_STRTOL
48
#ifndef HAVE_STRTOL
49
long strtol(char * text, char ** ignore)
49
long strtol(char * text, char ** /*ignore*/)
50
{
50
{
51
  return atol(text);
51
  return atol(text);
52
}
52
}
(-)misc/silgraphite-2.3.1/engine/test/RegressionTest/GrJustifier.cpp (-1 / +1 lines)
Lines 327-333 Link Here
327
					&dxStretchAchieved);
327
					&dxStretchAchieved);
328
				for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
328
				for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
329
				{
329
				{
330
					int iiGlyph = viiGlyphsRem[iiiGlyph];
330
					iiGlyph = viiGlyphsRem[iiiGlyph];
331
					vdxStretchLeft[iiGlyph] = vdxStretchRem[iiiGlyph];
331
					vdxStretchLeft[iiGlyph] = vdxStretchRem[iiiGlyph];
332
					vdxWidth[iiGlyph] = vdxWidthRem[iiiGlyph];
332
					vdxWidth[iiGlyph] = vdxWidthRem[iiiGlyph];
333
				}
333
				}
(-)misc/silgraphite-2.3.1/engine/test/RegressionTest/RegressionTest.cpp (-1 / +1 lines)
Lines 675-681 Link Here
675
	OutputErrorAux(ptcase, strErr, i, true, valueFound, valueExpected);
675
	OutputErrorAux(ptcase, strErr, i, true, valueFound, valueExpected);
676
}
676
}
677
677
678
void OutputErrorAux(TestCase * ptcase, std::string strErr, int i,
678
void OutputErrorAux(TestCase * /*ptcase*/, std::string strErr, int i,
679
	bool showValues, int valueFound, int valueExpected)
679
	bool showValues, int valueFound, int valueExpected)
680
{
680
{
681
//	if (g_debugMode)
681
//	if (g_debugMode)
(-)misc/silgraphite-2.3.1/engine/test/RegressionTest/SimpleTextSrc.cpp (-3 / +3 lines)
Lines 70-76 Link Here
70
/*----------------------------------------------------------------------------------------------
70
/*----------------------------------------------------------------------------------------------
71
	Return true if the text uses a right-to-left writing system.
71
	Return true if the text uses a right-to-left writing system.
72
----------------------------------------------------------------------------------------------*/
72
----------------------------------------------------------------------------------------------*/
73
bool SimpleTextSrc::getRightToLeft(toffset ich)
73
bool SimpleTextSrc::getRightToLeft(toffset /*ich*/)
74
{
74
{
75
	return false;
75
	return false;
76
}
76
}
Lines 78-84 Link Here
78
/*----------------------------------------------------------------------------------------------
78
/*----------------------------------------------------------------------------------------------
79
	Return the depth of embedding of the writing system.
79
	Return the depth of embedding of the writing system.
80
----------------------------------------------------------------------------------------------*/
80
----------------------------------------------------------------------------------------------*/
81
unsigned int SimpleTextSrc::getDirectionDepth(toffset ich)
81
unsigned int SimpleTextSrc::getDirectionDepth(toffset /*ich*/)
82
{
82
{
83
	return 0;
83
	return 0;
84
}
84
}
Lines 87-93 Link Here
87
	Return the vertical offset of the text. This simple implementation provides no
87
	Return the vertical offset of the text. This simple implementation provides no
88
	vertical offset.
88
	vertical offset.
89
----------------------------------------------------------------------------------------------*/
89
----------------------------------------------------------------------------------------------*/
90
float SimpleTextSrc::getVerticalOffset(toffset ich)
90
float SimpleTextSrc::getVerticalOffset(toffset /*ich*/)
91
{
91
{
92
	return 0;
92
	return 0;
93
}
93
}
(-)misc/silgraphite-2.3.1/engine/test/RegressionTest/SimpleTextSrc.h (-7 / +7 lines)
Lines 59-70 Link Here
59
	{
59
	{
60
		return m_cchLength;
60
		return m_cchLength;
61
	}
61
	}
62
	virtual size_t fetch(toffset ichMin, size_t cch, utf32 * prgchBuffer)
62
	virtual size_t fetch(toffset /*ichMin*/, size_t /*cch*/, utf32 * /*prgchBuffer*/)
63
	{
63
	{
64
		throw;
64
		throw;
65
	}
65
	}
66
	virtual size_t fetch(toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
66
	virtual size_t fetch(toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
67
	virtual size_t fetch(toffset ichMin, size_t cch, utf8  * prgchsBuffer)
67
	virtual size_t fetch(toffset /*ichMin*/, size_t /*cch*/, utf8  * /*prgchsBuffer*/)
68
	{
68
	{
69
		throw;
69
		throw;
70
	};
70
	};
Lines 73-86 Link Here
73
	virtual unsigned int getDirectionDepth(toffset ich);
73
	virtual unsigned int getDirectionDepth(toffset ich);
74
	virtual float getVerticalOffset(toffset ich);
74
	virtual float getVerticalOffset(toffset ich);
75
75
76
	virtual isocode getLanguage(toffset ich)
76
	virtual isocode getLanguage(toffset /*ich*/)
77
	{
77
	{
78
		isocode ret;
78
		isocode ret;
79
		ret.rgch[0] = 'e'; ret.rgch[1] = 'n'; ret.rgch[2] = 0; ret.rgch[3] = 0;
79
		ret.rgch[0] = 'e'; ret.rgch[1] = 'n'; ret.rgch[2] = 0; ret.rgch[3] = 0;
80
		return ret;
80
		return ret;
81
	}
81
	}
82
82
83
	virtual std::pair<toffset, toffset> propertyRange(toffset ich)
83
	virtual std::pair<toffset, toffset> propertyRange(toffset /*ich*/)
84
	{
84
	{
85
		std::pair<toffset, toffset> pairRet;
85
		std::pair<toffset, toffset> pairRet;
86
		pairRet.first = 0;
86
		pairRet.first = 0;
Lines 88-103 Link Here
88
		return pairRet;
88
		return pairRet;
89
	}
89
	}
90
90
91
	virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset)
91
	virtual size_t getFontFeatures(toffset /*ich*/, FeatureSetting * /*prgfset*/)
92
	{
92
	{
93
		return 0; // no features in this simple implementation
93
		return 0; // no features in this simple implementation
94
	}
94
	}
95
	virtual bool sameSegment(toffset ich1, toffset ich2)
95
	virtual bool sameSegment(toffset /*ich1*/, toffset /*ich2*/)
96
	{
96
	{
97
		return true;
97
		return true;
98
	}
98
	}
99
99
100
	virtual void getColors(toffset ich, int * pclrFore, int * pclrBack)
100
	virtual void getColors(toffset /*ich*/, int * pclrFore, int * pclrBack)
101
	{
101
	{
102
		*pclrFore = kclrBlack;
102
		*pclrFore = kclrBlack;
103
		*pclrBack = kclrTransparent;
103
		*pclrBack = kclrTransparent;
(-)misc/silgraphite-2.3.1/wrappers/win32/WinFont.cpp (-6 / +29 lines)
Lines 70-75 Link Here
70
	// But don't store m_hfont, because we don't really "own" it; the client is
72
	// But don't store m_hfont, because we don't really "own" it; the client is
71
	// responsible for releasing it.
73
	// responsible for releasing it.
72
	m_hfont = 0;
74
	m_hfont = 0;
75
    m_pGlyphMetricMap = NULL;
73
	memset(&m_fpropSet, 0, sizeof(m_fpropSet));
76
	memset(&m_fpropSet, 0, sizeof(m_fpropSet));
74
77
75
	m_pbCmapTbl = NULL;
78
	m_pbCmapTbl = NULL;
Lines 196-201 Link Here
196
	m_hdc = 0;
198
	m_hdc = 0;
197
	m_hfont = 0;
199
	m_hfont = 0;
198
	m_hfontClient = 0;
200
	m_hfontClient = 0;
201
    m_pGlyphMetricMap = NULL;
199
	memset(&m_fpropSet, 0, sizeof(FontProps));
202
	memset(&m_fpropSet, 0, sizeof(FontProps));
200
203
201
	m_pbCmapTbl = NULL;
204
	m_pbCmapTbl = NULL;
Lines 408-414 Link Here
408
					if (pPolyCurve->wType == TT_PRIM_QSPLINE &&
410
					if (pPolyCurve->wType == TT_PRIM_QSPLINE &&
409
						// test if this is the last curve
411
						// test if this is the last curve
410
						pPolyHdr->cb - (int)((byte *)(&pPolyCurve->apfx[j]) - (byte *)(pPolyHdr))
412
						pPolyHdr->cb - (int)((byte *)(&pPolyCurve->apfx[j]) - (byte *)(pPolyHdr))
411
							== sizeof POINTFX &&
413
							== sizeof (POINTFX) &&
412
						// and the two points are identical
414
						// and the two points are identical
413
						CompareFixed(pPolyCurve->apfx[j].x, pPolyHdr->pfxStart.x) &&
415
						CompareFixed(pPolyCurve->apfx[j].x, pPolyHdr->pfxStart.x) &&
414
						CompareFixed(pPolyCurve->apfx[j].y, pPolyHdr->pfxStart.y))
416
						CompareFixed(pPolyCurve->apfx[j].y, pPolyHdr->pfxStart.y))
Lines 457-462 Link Here
457
----------------------------------------------------------------------------------------------*/
459
----------------------------------------------------------------------------------------------*/
458
void WinFont::getGlyphMetrics(gid16 chw, gr::Rect & boundingBox, gr::Point & advances)
460
void WinFont::getGlyphMetrics(gid16 chw, gr::Rect & boundingBox, gr::Point & advances)
459
{
461
{
462
    if (m_pGlyphMetricMap)
463
    {
464
        GlyphMetricMap::iterator i = m_pGlyphMetricMap->find(chw);
465
        if (i != m_pGlyphMetricMap->end())
466
        {
467
            boundingBox = i->second.first;
468
            advances = i->second.second;
469
            return;
470
        }
471
    }
460
	GLYPHMETRICS gm;
472
	GLYPHMETRICS gm;
461
	const MAT2 mat2 = {{0,1}, {0,0}, {0,0}, {0,1}};
473
	const MAT2 mat2 = {{0,1}, {0,0}, {0,0}, {0,1}};
462
	if (GDI_ERROR == ::GetGlyphOutline(m_hdc, chw, GGO_GLYPH_INDEX | GGO_METRICS,
474
	if (GDI_ERROR == ::GetGlyphOutline(m_hdc, chw, GGO_GLYPH_INDEX | GGO_METRICS,
Lines 474-479 Link Here
474
	boundingBox.bottom = (float)gm.gmptGlyphOrigin.y - gm.gmBlackBoxY;
476
	boundingBox.bottom = (float)gm.gmptGlyphOrigin.y - gm.gmBlackBoxY;
475
	advances.x = gm.gmCellIncX;
477
	advances.x = gm.gmCellIncX;
476
	advances.y = gm.gmCellIncY;
478
	advances.y = gm.gmCellIncY;
479
    if (m_pGlyphMetricMap)
480
    {
481
        (*m_pGlyphMetricMap)[chw] = std::pair<gr::Rect,gr::Point>(boundingBox, advances);
482
    }
477
}
483
}
478
484
479
/*----------------------------------------------------------------------------------------------
485
/*----------------------------------------------------------------------------------------------
Lines 618-624 Link Here
618
620
619
		static int cCreateFontCalls = 0;
621
		static int cCreateFontCalls = 0;
620
		static int cCreateFontZero = 0;
622
		static int cCreateFontZero = 0;
621
		HFONT hfont = g_fhc.GetFont(lf);
623
        FontHandleCache::FontCacheValue cache = g_fhc.GetCache(lf);
624
        HFONT hfont = cache.hfont;
625
        m_pGlyphMetricMap = cache.pGlyphMetricMap;
626
		//HFONT hfont = g_fhc.GetFont(lf);
622
		//char ch1[200];
627
		//char ch1[200];
623
		//if (hfont == 0)
628
		//if (hfont == 0)
624
		//{
629
		//{
Lines 731-737 Link Here
731
	@param lf LOGFONT value that describes the desired font
733
	@param lf LOGFONT value that describes the desired font
732
	@return Font handle
734
	@return Font handle
733
----------------------------------------------------------------------------------------------*/
735
----------------------------------------------------------------------------------------------*/
734
HFONT WinFont::FontHandleCache::GetFont(LOGFONT & lf)
736
WinFont::FontHandleCache::FontCacheValue WinFont::FontHandleCache::GetCache(LOGFONT & lf)
735
{
737
{
736
	FontCacheValue fcv;
738
	FontCacheValue fcv;
737
	FontHandleHashMap::iterator itFound = m_hmlffcv.find(lf);
739
	FontHandleHashMap::iterator itFound = m_hmlffcv.find(lf);
Lines 752-762 Link Here
752
			THROW(kresFail);
754
			THROW(kresFail);
753
755
754
		fcv.nRefs = 1;
756
		fcv.nRefs = 1;
757
        fcv.pGlyphMetricMap = new GlyphMetricMap();
755
758
756
		m_hmlffcv.insert(std::pair<LOGFONT, FontCacheValue>(lf, fcv));
759
		m_hmlffcv.insert(std::pair<LOGFONT, FontCacheValue>(lf, fcv));
757
	}
760
	}
758
761
759
	return fcv.hfont;
762
	return fcv;
760
}
763
}
761
764
762
/*----------------------------------------------------------------------------------------------
765
/*----------------------------------------------------------------------------------------------
Lines 767-773 Link Here
767
----------------------------------------------------------------------------------------------*/
767
----------------------------------------------------------------------------------------------*/
768
void WinFont::FontHandleCache::DeleteFont(HFONT hfont)
768
void WinFont::FontHandleCache::DeleteFont(HFONT hfont)
769
{
769
{
770
	if (!hfont || !m_bValid)
770
	if (!hfont || !m_bValid || m_hmlffcv.size() == 0)
771
		return;
771
		return;
772
772
773
	// find the font in the hash map
773
	// find the font in the hash map
Lines 782-787 Link Here
782
			{
784
			{
783
				// delete font
785
				// delete font
784
				::DeleteObject(hfont);
786
				::DeleteObject(hfont);
787
                if (fcv.pGlyphMetricMap)
788
                    delete fcv.pGlyphMetricMap;
785
				m_hmlffcv.erase(it);
789
				m_hmlffcv.erase(it);
786
			}
790
			}
787
			else
791
			else
Lines 832-838 Link Here
832
bool WinFont::LogFontHashFuncs::operator() (const WinFont::LogFontWrapper & key1,
832
bool WinFont::LogFontHashFuncs::operator() (const WinFont::LogFontWrapper & key1,
833
	const WinFont::LogFontWrapper & key2) const
833
	const WinFont::LogFontWrapper & key2) const
834
{
834
{
835
	return (key1 == key2);
835
    // return true if key1 should be ordered before key2
836
    return (operator()(key1) < operator()(key2));
836
}
837
}
837
838
838
/*--------------------------------------------------------------------------------------
839
/*--------------------------------------------------------------------------------------
(-)misc/silgraphite-2.3.1/wrappers/win32/WinFont.h (-2 / +12 lines)
Lines 27-33 Link Here
27
#include "GrClient.h"
27
#include "GrClient.h"
28
#include "Font.h"
28
#include "Font.h"
29
#include <map>
29
30
31
#ifdef _STLPORT_VERSION
32
namespace stdext = _STLP_STD;
33
#endif
34
30
namespace gr
35
namespace gr
31
{
36
{
37
typedef std::map<gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
32
38
33
class FontFace;
39
class FontFace;
Lines 100-105 Link Here
100
	HFONT m_hfontClient;	// need to replace this HFONT into the DC when we are finished
110
	HFONT m_hfontClient;	// need to replace this HFONT into the DC when we are finished
101
							// with it
111
							// with it
102
112
113
    GlyphMetricMap * m_pGlyphMetricMap;
103
	// Debugging:
114
	// Debugging:
104
	//OLECHAR m_rgchTemp[32];
115
	//OLECHAR m_rgchTemp[32];
105
116
Lines 185-195 Link Here
185
	class FontHandleCache // hungarian: fhc
196
	class FontHandleCache // hungarian: fhc
186
	{
197
	{
187
	public:
198
	public:
188
		struct FontCacheValue
199
        struct FontCacheValue
189
		{
200
		{
190
			int nRefs;   // reference count
201
			int nRefs;   // reference count
191
			HFONT hfont; // font handle
202
			HFONT hfont; // font handle
192
203
204
            GlyphMetricMap * pGlyphMetricMap; // glyph metrics
205
193
			bool operator==(const FontCacheValue & val) const
206
			bool operator==(const FontCacheValue & val) const
194
			{
207
			{
195
				return (hfont == val.hfont);
208
				return (hfont == val.hfont);
Lines 199-205 Link Here
199
        FontHandleCache() : m_bValid(true) {};
212
        FontHandleCache() : m_bValid(true) {};
200
		~FontHandleCache();
213
		~FontHandleCache();
201
214
202
		HFONT GetFont(LOGFONT & lf);
215
		//HFONT GetFont(LOGFONT & lf);
216
        FontCacheValue GetCache(LOGFONT & lf);
203
		void DeleteFont(HFONT hfont);
217
		void DeleteFont(HFONT hfont);
204
218
205
		typedef stdext::hash_map<LogFontWrapper, FontCacheValue, LogFontHashFuncs> FontHandleHashMap;
219
		typedef stdext::hash_map<LogFontWrapper, FontCacheValue, LogFontHashFuncs> FontHandleHashMap;
(-)misc/build/silgraphite-2.3.1/engine/test/RegressionTest/RtTextSrc.h~ (-3 / +3 lines)
Lines 44-61 Link Here
44
		}
44
		}
45
	}
45
	}
46
46
47
	virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset)
47
	virtual size_t getFontFeatures(toffset /*ich*/, FeatureSetting * prgfset)
48
	{
48
	{
49
		// Note: size of prgfset buffer = gr::kMaxFeatures = 64
49
		// Note: size of prgfset buffer = gr::kMaxFeatures = 64
50
		std::copy(m_fset, m_fset + MAXFEAT, prgfset);
50
		std::copy(m_fset, m_fset + MAXFEAT, prgfset);
51
		return m_cFeats;
51
		return m_cFeats;
52
	}
52
	}
53
53
54
	virtual bool getRightToLeft(toffset ich)
54
	virtual bool getRightToLeft(toffset /*ich*/)
55
	{
55
	{
56
		return m_fRtl;
56
		return m_fRtl;
57
	}
57
	}
58
	virtual unsigned int getDirectionDepth(toffset ich)
58
	virtual unsigned int getDirectionDepth(toffset /*ich*/)
59
	{
59
	{
60
		return ((m_fRtl == 1) ? 1 : 0);
60
		return ((m_fRtl == 1) ? 1 : 0);
61
	}
61
	}
(-)misc/build/silgraphite-2.3.1/engine/test/RegressionTest/GrJustifier.cpp (-9 / +7 lines)
Lines 16-23 Link Here
16
//:>	Include files
16
//:>	Include files
17
//:>********************************************************************************************
17
//:>********************************************************************************************
18
//#include "main.h" // This is used by clients, so main.h is not available
18
//#include "main.h" // This is used by clients, so main.h is not available
19
19
#ifdef _MSC_VER
20
#pragma hdrstop
20
#pragma hdrstop
21
#endif
21
// any other headers (not precompiled)
22
// any other headers (not precompiled)
22
#include "GrClient.h"
23
#include "GrClient.h"
23
#include "ITextSource.h"
24
#include "ITextSource.h"
Lines 31-39 Link Here
31
#include <string>
32
#include <string>
32
#endif
33
#endif
33
34
34
#undef THIS_FILE
35
DEFINE_THIS_FILE
36
37
//:>********************************************************************************************
35
//:>********************************************************************************************
38
//:>	Global constants
36
//:>	Global constants
39
//:>********************************************************************************************
37
//:>********************************************************************************************
Lines 327-335 Link Here
327
					&dxStretchAchieved);
325
					&dxStretchAchieved);
328
				for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
326
				for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
329
				{
327
				{
330
					iiGlyph = viiGlyphsRem[iiiGlyph];
328
					int ivGlyph = viiGlyphsRem[iiiGlyph];
331
					vdxStretchLeft[iiGlyph] = vdxStretchRem[iiiGlyph];
329
					vdxStretchLeft[ivGlyph] = vdxStretchRem[iiiGlyph];
332
					vdxWidth[iiGlyph] = vdxWidthRem[iiiGlyph];
330
					vdxWidth[ivGlyph] = vdxWidthRem[iiiGlyph];
333
				}
331
				}
334
			}
332
			}
335
			else
333
			else
Lines 366-377 Link Here
366
	{
364
	{
367
#ifdef WIN32
365
#ifdef WIN32
368
		wchar_t rgchw[20];
366
		wchar_t rgchw[20];
369
		std::fill_n(rgchw, 20, 0);
367
		std::fill_n(rgchw, 20, L'\0');
370
		_itow(dxStretchNeeded - dxStretchAchieved, rgchw, 10);
368
		_itow(dxStretchNeeded - dxStretchAchieved, rgchw, 10);
371
		std::wstring strTmp(L"justification failed by ");
369
		std::wstring strTmp(L"justification failed by ");
372
		strTmp += rgchw;
370
		strTmp += rgchw;
373
		strTmp += L" units (width needed = ";
371
		strTmp += L" units (width needed = ";
374
		std::fill_n(rgchw, 10, 0);
372
		std::fill_n(rgchw, 10, L'\0');
375
		_itow(dxDesiredWidth, rgchw, 10);
373
		_itow(dxDesiredWidth, rgchw, 10);
376
		strTmp += rgchw;
374
		strTmp += rgchw;
377
		strTmp += L")\n";
375
		strTmp += L")\n";
(-)misc/build/silgraphite-2.3.1/engine/test/RegressionTest/GrJustifier.h (+2 lines)
Lines 11-17 Link Here
11
Description:
11
Description:
12
	A default justification agent for Graphite.
12
	A default justification agent for Graphite.
13
-------------------------------------------------------------------------------*//*:End Ignore*/
13
-------------------------------------------------------------------------------*//*:End Ignore*/
14
#ifdef _MSC_VER
14
#pragma once
15
#pragma once
16
#endif
15
#ifndef GRJUSTIFIER_INCLUDED
17
#ifndef GRJUSTIFIER_INCLUDED
16
#define GRJUSTIFIER_INCLUDED
18
#define GRJUSTIFIER_INCLUDED
17
19
(-)misc/build/silgraphite-2.3.1/engine/test/RegressionTest/SimpleTextSrc.h (+2 lines)
Lines 11-17 Link Here
11
Description:
11
Description:
12
	A simple text source that shows how to use this interface within Graphite.
12
	A simple text source that shows how to use this interface within Graphite.
13
-------------------------------------------------------------------------------*//*:End Ignore*/
13
-------------------------------------------------------------------------------*//*:End Ignore*/
14
#ifdef _MSC_VER
14
#pragma once
15
#pragma once
16
#endif
15
#ifndef GRTXTSRC_INCLUDED
17
#ifndef GRTXTSRC_INCLUDED
16
#define GRTXTSRC_INCLUDED
18
#define GRTXTSRC_INCLUDED
17
19
(-)misc/build/silgraphite-2.3.1/engine/test/RegressionTest/SimpleTextSrc.cpp (-3 / +2 lines)
Lines 15-21 Link Here
15
//:>********************************************************************************************
15
//:>********************************************************************************************
16
//:>	Include files
16
//:>	Include files
17
//:>********************************************************************************************
17
//:>********************************************************************************************
18
#ifdef _MSC_VER
18
#pragma hdrstop
19
#pragma hdrstop
20
#endif
19
// any other headers (not precompiled)
21
// any other headers (not precompiled)
20
22
21
#include "GrClient.h"
23
#include "GrClient.h"
Lines 23-31 Link Here
23
#include "ITextSource.h"
25
#include "ITextSource.h"
24
#include "SimpleTextSrc.h"
26
#include "SimpleTextSrc.h"
25
27
26
#undef THIS_FILE
27
DEFINE_THIS_FILE
28
29
//:>********************************************************************************************
28
//:>********************************************************************************************
30
//:>	Initialization and destruction
29
//:>	Initialization and destruction
31
//:>********************************************************************************************
30
//:>********************************************************************************************
(-)misc/build/silgraphite-2.3.1/engine/src/segment/MemoryUsage.cpp (-4 / +2 lines)
Lines 11-20 Link Here
11
Description:
11
Description:
12
    Calculates memory usage for the engine and segments.
12
    Calculates memory usage for the engine and segments.
13
----------------------------------------------------------------------------------------------*/
13
----------------------------------------------------------------------------------------------*/
14
14
#ifdef _MSC_VER
15
#pragma warning(disable: 4244)	// conversion from wchar_t to char
15
#pragma warning(disable: 4244)	// conversion from wchar_t to char
16
#pragma warning(disable: 4702)	// unreachable code
16
#pragma warning(disable: 4702)	// unreachable code
17
17
#endif
18
//:>********************************************************************************************
18
//:>********************************************************************************************
19
//:>	Include files
19
//:>	Include files
20
//:>********************************************************************************************
20
//:>********************************************************************************************
Lines 54-61 Link Here
54
#ifdef _MSC_VER
54
#ifdef _MSC_VER
55
#pragma hdrstop
55
#pragma hdrstop
56
#endif
56
#endif
57
#undef THIS_FILE
58
DEFINE_THIS_FILE
59
57
60
//:End Ignore
58
//:End Ignore
61
59
(-)misc/build/silgraphite-2.3.1/engine/src/segment/GrSlotState.h (-2 / +2 lines)
Lines 48-54 Link Here
48
	{
48
	{
49
	}
49
	}
50
50
51
	~GrSlotAbstract()
51
	virtual ~GrSlotAbstract()
52
	{
52
	{
53
		// the table manager is responsible for destroying the contents of m_prgnVarLenBuf
53
		// the table manager is responsible for destroying the contents of m_prgnVarLenBuf
54
	}
54
	}
Lines 231-237 Link Here
231
		ZapCompositeMetrics();
231
		ZapCompositeMetrics();
232
	}
232
	}
233
233
234
	~GrSlotState()
234
	virtual ~GrSlotState()
235
	{
235
	{
236
	}
236
	}
237
237
(-)misc/build/silgraphite-2.3.1/engine/src/segment/Segment.cpp.bak (-1 / +4 lines)
Lines 246-251 Link Here
246
246
247
	m_dxsVisibleWidth = -1;
247
	m_dxsVisibleWidth = -1;
248
	m_dxsTotalWidth = -1;
248
	m_dxsTotalWidth = -1;
249
	m_ichwAssocsMin = 0;
250
	m_ichwAssocsLim = 0;
249
251
250
//	m_psstrm = NULL;
252
//	m_psstrm = NULL;
251
	m_prgslout = NULL;
253
	m_prgslout = NULL;
Lines 2988-2996 Link Here
2988
	return kresOk;
2988
	return kresOk;
2989
}
2989
}
2990
2990
2991
2991
#ifdef __GNUC__
2992
// suppress GCC 4.3 warning for optimized min()/max() when called with (ich, ich+1) or similar
2992
// suppress GCC 4.3 warning for optimized min()/max() when called with (ich, ich+1) or similar
2993
#pragma GCC diagnostic ignored "-Wstrict-overflow"
2993
#pragma GCC diagnostic ignored "-Wstrict-overflow"
2994
#endif
2994
2995
2995
/*----------------------------------------------------------------------------------------------
2996
/*----------------------------------------------------------------------------------------------
2996
	Merge the given characters into the same Uniscribe cluster. This means merging any
2997
	Merge the given characters into the same Uniscribe cluster. This means merging any
(-)misc/build/silgraphite-2.3.1/wrappers/win32/win32_dll.cpp.bak (-1 / +1 lines)
Lines 14-20 Link Here
14
	DllMain. This is the main DLL entry point for a non-MFC DLL. For an MFC DLL, DllMain is
14
	DllMain. This is the main DLL entry point for a non-MFC DLL. For an MFC DLL, DllMain is
15
		in DllModul.cpp. Both DllMains call ModuleEntry::DllMain.
15
		in DllModul.cpp. Both DllMains call ModuleEntry::DllMain.
16
----------------------------------------------------------------------------------------------*/
16
----------------------------------------------------------------------------------------------*/
17
extern "C" BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, PVOID pvReserved)
17
extern "C" BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, PVOID /*pvReserved*/)
18
{
18
{
19
	bool fRet = true;
19
	bool fRet = true;
20
20

Return to issue 112730