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

(-)makefile.mk (-2 / +2 lines)
Lines 71-79 Link Here
71
71
72
# --- Files --------------------------------------------------------
72
# --- Files --------------------------------------------------------
73
73
74
TARFILE_NAME=freetype-2.0.5
74
TARFILE_NAME=freetype-2.1.2
75
75
76
PATCH_FILE_NAME=freetype-2.0.5.patch
76
PATCH_FILE_NAME=freetype-2.1.2.patch
77
77
78
CONFIGURE_DIR=
78
CONFIGURE_DIR=
79
#relative to CONFIGURE_DIR
79
#relative to CONFIGURE_DIR
(-)source/glyphs/gcach_ftyp.cxx (-60 / +77 lines)
Lines 77-84 Link Here
77
#include <osl/file.hxx>
77
#include <osl/file.hxx>
78
#include <osl/thread.hxx>
78
#include <osl/thread.hxx>
79
79
80
#if defined(FREETYPE_MAJOR) && defined(FREETYPE_MINOR) && defined(FREETYPE_PATCH)
81
#if FREETYPE_MINOR > 9
82
#error FREETYPE_MINOR too big
83
#endif
84
#if FREETYPE_PATCH > 9
85
#error FREETYPE_PATCH too big
86
#endif
87
#define	FTVERSION (100*FREETYPE_MAJOR + 10*FREETYPE_MINOR + FREETYPE_PATCH)
88
#else
80
// VERSION_MINOR in freetype.h is too coarse, we need to fine-tune ourselves:
89
// VERSION_MINOR in freetype.h is too coarse, we need to fine-tune ourselves:
81
#define FTVERSION 205
90
#define FTVERSION 205
91
#endif
82
92
83
#include "freetype/freetype.h"
93
#include "freetype/freetype.h"
84
#include "freetype/ftglyph.h"
94
#include "freetype/ftglyph.h"
Lines 87-92 Link Here
87
#include "freetype/tttags.h"
97
#include "freetype/tttags.h"
88
#include "freetype/ttnameid.h"
98
#include "freetype/ttnameid.h"
89
99
100
#if FTVERSION < 210
101
#define	FT_NEXT_USHORT	NEXT_UShort
102
#define	FT_NEXT_SHORT	NEXT_Short
103
#define	FT_NEXT_ULONG	NEXT_ULong
104
#define	FT_NEXT_LONG	NEXT_Long
105
#endif
106
90
#include <vector>
107
#include <vector>
91
108
92
// TODO: move file mapping stuff to OSL
109
// TODO: move file mapping stuff to OSL
Lines 1200-1228 Link Here
1200
    ImplKernPairData aKernPair;
1217
    ImplKernPairData aKernPair;
1201
1218
1202
    const FT_Byte* pBuffer = pKern;
1219
    const FT_Byte* pBuffer = pKern;
1203
    USHORT nVersion = NEXT_UShort( pBuffer );
1220
    USHORT nVersion = FT_NEXT_USHORT( pBuffer );
1204
    USHORT nTableCnt = NEXT_UShort( pBuffer );
1221
    USHORT nTableCnt = FT_NEXT_USHORT( pBuffer );
1205
    if( nVersion != 0 )     // ignore Apple's versions for now
1222
    if( nVersion != 0 )     // ignore Apple's versions for now
1206
        nTableCnt = 0;
1223
        nTableCnt = 0;
1207
    for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
1224
    for( USHORT nTableIdx = 0; nTableIdx < nTableCnt; ++nTableIdx )
1208
    {
1225
    {
1209
        USHORT nSubVersion  = NEXT_UShort( pBuffer );
1226
        USHORT nSubVersion  = FT_NEXT_USHORT( pBuffer );
1210
        USHORT nSubLength   = NEXT_UShort( pBuffer );
1227
        USHORT nSubLength   = FT_NEXT_USHORT( pBuffer );
1211
        USHORT nSubCoverage = NEXT_UShort( pBuffer );
1228
        USHORT nSubCoverage = FT_NEXT_USHORT( pBuffer );
1212
        if( (nSubCoverage&0x03) != 0x01 )	// no interest in minimum info here
1229
        if( (nSubCoverage&0x03) != 0x01 )	// no interest in minimum info here
1213
            continue;
1230
            continue;
1214
        switch( nSubCoverage >> 8 )
1231
        switch( nSubCoverage >> 8 )
1215
        {
1232
        {
1216
            case 0: // version 0, kerning format 0
1233
            case 0: // version 0, kerning format 0
1217
            {
1234
            {
1218
                USHORT nPairs = NEXT_UShort( pBuffer );
1235
                USHORT nPairs = FT_NEXT_USHORT( pBuffer );
1219
                pBuffer += 6;   // skip search hints
1236
                pBuffer += 6;   // skip search hints
1220
                aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
1237
                aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
1221
                for( int i = 0; i < nPairs; ++i )
1238
                for( int i = 0; i < nPairs; ++i )
1222
                {
1239
                {
1223
                    aKernPair.mnChar1 = NEXT_UShort( pBuffer );
1240
                    aKernPair.mnChar1 = FT_NEXT_USHORT( pBuffer );
1224
                    aKernPair.mnChar2 = NEXT_UShort( pBuffer );
1241
                    aKernPair.mnChar2 = FT_NEXT_USHORT( pBuffer );
1225
                    /*long nUnscaledKern=*/ NEXT_Short( pBuffer );
1242
                    /*long nUnscaledKern=*/ FT_NEXT_SHORT( pBuffer );
1226
                    aKernGlyphVector.push_back( aKernPair );
1243
                    aKernGlyphVector.push_back( aKernPair );
1227
                }
1244
                }
1228
            }
1245
            }
Lines 1231-1248 Link Here
1231
            case 2:	// version 0, kerning format 2
1248
            case 2:	// version 0, kerning format 2
1232
            {
1249
            {
1233
                const FT_Byte* pSubTable = pBuffer;
1250
                const FT_Byte* pSubTable = pBuffer;
1234
                /*USHORT nRowWidth	=*/ NEXT_UShort( pBuffer );
1251
                /*USHORT nRowWidth	=*/ FT_NEXT_USHORT( pBuffer );
1235
                USHORT nOfsLeft     = NEXT_UShort( pBuffer );
1252
                USHORT nOfsLeft     = FT_NEXT_USHORT( pBuffer );
1236
                USHORT nOfsRight    = NEXT_UShort( pBuffer );
1253
                USHORT nOfsRight    = FT_NEXT_USHORT( pBuffer );
1237
                USHORT nOfsArray    = NEXT_UShort( pBuffer );
1254
                USHORT nOfsArray    = FT_NEXT_USHORT( pBuffer );
1238
1255
1239
                const FT_Byte* pTmp = pSubTable + nOfsLeft;
1256
                const FT_Byte* pTmp = pSubTable + nOfsLeft;
1240
                USHORT nFirstLeft   = NEXT_UShort( pTmp );
1257
                USHORT nFirstLeft   = FT_NEXT_USHORT( pTmp );
1241
                USHORT nLastLeft    = NEXT_UShort( pTmp ) + nFirstLeft - 1;
1258
                USHORT nLastLeft    = FT_NEXT_USHORT( pTmp ) + nFirstLeft - 1;
1242
1259
1243
                pTmp = pSubTable + nOfsRight;
1260
                pTmp = pSubTable + nOfsRight;
1244
                USHORT nFirstRight  = NEXT_UShort( pTmp );
1261
                USHORT nFirstRight  = FT_NEXT_USHORT( pTmp );
1245
                USHORT nLastRight   = NEXT_UShort( pTmp ) + nFirstRight - 1;
1262
                USHORT nLastRight   = FT_NEXT_USHORT( pTmp ) + nFirstRight - 1;
1246
1263
1247
                ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
1264
                ULONG nPairs = (ULONG)(nLastLeft - nFirstLeft + 1) * (nLastRight - nFirstRight + 1);
1248
                aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
1265
                aKernGlyphVector.reserve( aKernGlyphVector.size() + nPairs );
Lines 1253-1259 Link Here
1253
                    aKernPair.mnChar1 = nLeft;
1270
                    aKernPair.mnChar1 = nLeft;
1254
                    for( int nRight = 0; nRight < nLastRight; ++nRight )
1271
                    for( int nRight = 0; nRight < nLastRight; ++nRight )
1255
                    {
1272
                    {
1256
                        if( NEXT_Short( pTmp ) != 0 )
1273
                        if( FT_NEXT_SHORT( pTmp ) != 0 )
1257
                        {
1274
                        {
1258
                            aKernPair.mnChar2 = nRight;
1275
                            aKernPair.mnChar2 = nRight;
1259
                            aKernGlyphVector.push_back( aKernPair );
1276
                            aKernGlyphVector.push_back( aKernPair );
Lines 1531-1540 Link Here
1531
1548
1532
	// parse GSUB header
1549
	// parse GSUB header
1533
	const FT_Byte* pGsubHeader = pGsubBase;
1550
	const FT_Byte* pGsubHeader = pGsubBase;
1534
	const ULONG nVersion			= NEXT_Long( pGsubHeader );
1551
	const ULONG nVersion			= FT_NEXT_LONG( pGsubHeader );
1535
	const USHORT nOfsScriptList		= NEXT_UShort( pGsubHeader );
1552
	const USHORT nOfsScriptList		= FT_NEXT_USHORT( pGsubHeader );
1536
	const USHORT nOfsFeatureTable	= NEXT_UShort( pGsubHeader );
1553
	const USHORT nOfsFeatureTable	= FT_NEXT_USHORT( pGsubHeader );
1537
	const USHORT nOfsLookupList		= NEXT_UShort( pGsubHeader );
1554
	const USHORT nOfsLookupList		= FT_NEXT_USHORT( pGsubHeader );
1538
1555
1539
	typedef std::vector<USHORT> UshortList;
1556
	typedef std::vector<USHORT> UshortList;
1540
	UshortList aFeatureIndexList;
1557
	UshortList aFeatureIndexList;
Lines 1542-1563 Link Here
1542
1559
1543
	// parse Script Table
1560
	// parse Script Table
1544
	const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
1561
	const FT_Byte* pScriptHeader = pGsubBase + nOfsScriptList;
1545
	const USHORT nCntScript	= NEXT_UShort( pScriptHeader );
1562
	const USHORT nCntScript	= FT_NEXT_USHORT( pScriptHeader );
1546
	for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
1563
	for( USHORT nScriptIndex = 0; nScriptIndex < nCntScript; ++nScriptIndex )
1547
	{
1564
	{
1548
		const ULONG nTag			= NEXT_Long( pScriptHeader ); // e.g. hani/arab/kana/hang
1565
		const ULONG nTag			= FT_NEXT_LONG( pScriptHeader ); // e.g. hani/arab/kana/hang
1549
		const USHORT nOfsScriptTable= NEXT_UShort( pScriptHeader );
1566
		const USHORT nOfsScriptTable= FT_NEXT_USHORT( pScriptHeader );
1550
		if( (nTag != nRequestedScript) && (nRequestedScript != 0) )
1567
		if( (nTag != nRequestedScript) && (nRequestedScript != 0) )
1551
			continue;
1568
			continue;
1552
1569
1553
		const FT_Byte* pScriptTable		= pGsubBase + nOfsScriptList + nOfsScriptTable;
1570
		const FT_Byte* pScriptTable		= pGsubBase + nOfsScriptList + nOfsScriptTable;
1554
		const USHORT nDefaultLangsysOfs	= NEXT_UShort( pScriptTable );
1571
		const USHORT nDefaultLangsysOfs	= FT_NEXT_USHORT( pScriptTable );
1555
		const USHORT nCntLangSystem		= NEXT_UShort( pScriptTable );
1572
		const USHORT nCntLangSystem		= FT_NEXT_USHORT( pScriptTable );
1556
		USHORT nLangsysOffset = 0;
1573
		USHORT nLangsysOffset = 0;
1557
		for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
1574
		for( USHORT nLangsysIndex = 0; nLangsysIndex < nCntLangSystem; ++nLangsysIndex )
1558
		{
1575
		{
1559
			const ULONG nTag	= NEXT_Long( pScriptTable );	// e.g. KOR/ZHS/ZHT/JAN
1576
			const ULONG nTag	= FT_NEXT_LONG( pScriptTable );	// e.g. KOR/ZHS/ZHT/JAN
1560
			const USHORT nOffset= NEXT_UShort( pScriptTable );
1577
			const USHORT nOffset= FT_NEXT_USHORT( pScriptTable );
1561
			if( (nTag != nRequestedLangsys) && (nRequestedLangsys != 0) )
1578
			if( (nTag != nRequestedLangsys) && (nRequestedLangsys != 0) )
1562
				continue;
1579
				continue;
1563
			nLangsysOffset = nOffset;
1580
			nLangsysOffset = nOffset;
Lines 1567-1579 Link Here
1567
		if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
1584
		if( (nDefaultLangsysOfs != 0) && (nDefaultLangsysOfs != nLangsysOffset) )
1568
		{
1585
		{
1569
			const FT_Byte* pLangSys	= pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
1586
			const FT_Byte* pLangSys	= pGsubBase + nOfsScriptList + nOfsScriptTable + nDefaultLangsysOfs;
1570
			const USHORT nLookupOrder	= NEXT_UShort( pLangSys );
1587
			const USHORT nLookupOrder	= FT_NEXT_USHORT( pLangSys );
1571
			const USHORT nReqFeatureIdx	= NEXT_UShort( pLangSys );
1588
			const USHORT nReqFeatureIdx	= FT_NEXT_USHORT( pLangSys );
1572
			const USHORT nCntFeature	= NEXT_UShort( pLangSys );
1589
			const USHORT nCntFeature	= FT_NEXT_USHORT( pLangSys );
1573
			aFeatureIndexList.push_back( nReqFeatureIdx );
1590
			aFeatureIndexList.push_back( nReqFeatureIdx );
1574
			for( USHORT i = 0; i < nCntFeature; ++i )
1591
			for( USHORT i = 0; i < nCntFeature; ++i )
1575
			{
1592
			{
1576
				const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
1593
				const USHORT nFeatureIndex = FT_NEXT_USHORT( pLangSys );
1577
				aFeatureIndexList.push_back( nFeatureIndex );
1594
				aFeatureIndexList.push_back( nFeatureIndex );
1578
			}
1595
			}
1579
		}
1596
		}
Lines 1581-1593 Link Here
1581
		if( nLangsysOffset != 0 )
1598
		if( nLangsysOffset != 0 )
1582
		{
1599
		{
1583
			const FT_Byte* pLangSys	= pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
1600
			const FT_Byte* pLangSys	= pGsubBase + nOfsScriptList + nOfsScriptTable + nLangsysOffset;
1584
			const USHORT nLookupOrder	= NEXT_UShort( pLangSys );
1601
			const USHORT nLookupOrder	= FT_NEXT_USHORT( pLangSys );
1585
			const USHORT nReqFeatureIdx	= NEXT_UShort( pLangSys );
1602
			const USHORT nReqFeatureIdx	= FT_NEXT_USHORT( pLangSys );
1586
			const USHORT nCntFeature	= NEXT_UShort( pLangSys );
1603
			const USHORT nCntFeature	= FT_NEXT_USHORT( pLangSys );
1587
			aFeatureIndexList.push_back( nReqFeatureIdx );
1604
			aFeatureIndexList.push_back( nReqFeatureIdx );
1588
			for( USHORT i = 0; i < nCntFeature; ++i )
1605
			for( USHORT i = 0; i < nCntFeature; ++i )
1589
			{
1606
			{
1590
				const USHORT nFeatureIndex = NEXT_UShort( pLangSys );
1607
				const USHORT nFeatureIndex = FT_NEXT_USHORT( pLangSys );
1591
				aFeatureIndexList.push_back( nFeatureIndex );
1608
				aFeatureIndexList.push_back( nFeatureIndex );
1592
			}
1609
			}
1593
		}
1610
		}
Lines 1601-1611 Link Here
1601
1618
1602
	// parse Feature Table
1619
	// parse Feature Table
1603
	const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
1620
	const FT_Byte* pFeatureHeader = pGsubBase + nOfsFeatureTable;
1604
	const USHORT nCntFeature = NEXT_UShort( pFeatureHeader );
1621
	const USHORT nCntFeature = FT_NEXT_USHORT( pFeatureHeader );
1605
	for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
1622
	for( USHORT nFeatureIndex = 0; nFeatureIndex < nCntFeature; ++nFeatureIndex )
1606
	{
1623
	{
1607
		const ULONG nTag	= NEXT_Long( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
1624
		const ULONG nTag	= FT_NEXT_LONG( pFeatureHeader ); // e.g. locl/vert/trad/smpl/liga/fina/...
1608
		const USHORT nOffset= NEXT_UShort( pFeatureHeader );
1625
		const USHORT nOffset= FT_NEXT_USHORT( pFeatureHeader );
1609
1626
1610
		// feature (required && (requested || available))?
1627
		// feature (required && (requested || available))?
1611
		if( (aFeatureIndexList[0] != nFeatureIndex)
1628
		if( (aFeatureIndexList[0] != nFeatureIndex)
Lines 1614-1623 Link Here
1614
			continue;
1631
			continue;
1615
1632
1616
		const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
1633
		const FT_Byte* pFeatureTable = pGsubBase + nOfsFeatureTable + nOffset;
1617
		const USHORT nCntLookups = NEXT_UShort( pFeatureTable );
1634
		const USHORT nCntLookups = FT_NEXT_USHORT( pFeatureTable );
1618
		for( USHORT i = 0; i < nCntLookups; ++i )
1635
		for( USHORT i = 0; i < nCntLookups; ++i )
1619
		{
1636
		{
1620
			const USHORT nLookupIndex = NEXT_UShort( pFeatureTable );
1637
			const USHORT nLookupIndex = FT_NEXT_USHORT( pFeatureTable );
1621
			aLookupIndexList.push_back( nLookupIndex );
1638
			aLookupIndexList.push_back( nLookupIndex );
1622
		}
1639
		}
1623
		if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
1640
		if( nCntLookups == 0 ) //### hack needed by Mincho/Gothic/Mingliu/Simsun/...
Lines 1626-1635 Link Here
1626
1643
1627
	// parse Lookup List
1644
	// parse Lookup List
1628
	const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
1645
	const FT_Byte* pLookupHeader = pGsubBase + nOfsLookupList;
1629
	const USHORT nCntLookupTable = NEXT_UShort( pLookupHeader );
1646
	const USHORT nCntLookupTable = FT_NEXT_USHORT( pLookupHeader );
1630
	for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
1647
	for( USHORT nLookupIdx = 0; nLookupIdx < nCntLookupTable; ++nLookupIdx )
1631
	{
1648
	{
1632
		const USHORT nOffset = NEXT_UShort( pLookupHeader );
1649
		const USHORT nOffset = FT_NEXT_USHORT( pLookupHeader );
1633
		if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
1650
		if( std::count( aLookupIndexList.begin(), aLookupIndexList.end(), nLookupIdx ) )
1634
			aLookupOffsetList.push_back( nOffset );
1651
			aLookupOffsetList.push_back( nOffset );
1635
	}
1652
	}
Lines 1639-1647 Link Here
1639
	{
1656
	{
1640
		const USHORT nOfsLookupTable = *it;
1657
		const USHORT nOfsLookupTable = *it;
1641
		const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
1658
		const FT_Byte* pLookupTable = pGsubBase + nOfsLookupList + nOfsLookupTable;
1642
		const USHORT eLookupType		= NEXT_UShort( pLookupTable );
1659
		const USHORT eLookupType		= FT_NEXT_USHORT( pLookupTable );
1643
		const USHORT eLookupFlag		= NEXT_UShort( pLookupTable );
1660
		const USHORT eLookupFlag		= FT_NEXT_USHORT( pLookupTable );
1644
		const USHORT nCntLookupSubtable	= NEXT_UShort( pLookupTable );
1661
		const USHORT nCntLookupSubtable	= FT_NEXT_USHORT( pLookupTable );
1645
1662
1646
		// TODO: switch( eLookupType )
1663
		// TODO: switch( eLookupType )
1647
		if( eLookupType != 1 )	// TODO: once we go beyond SingleSubst
1664
		if( eLookupType != 1 )	// TODO: once we go beyond SingleSubst
Lines 1649-1676 Link Here
1649
1666
1650
		for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
1667
		for( USHORT nSubTableIdx = 0; nSubTableIdx < nCntLookupSubtable; ++nSubTableIdx )
1651
		{
1668
		{
1652
			const USHORT nOfsSubLookupTable	= NEXT_UShort( pLookupTable );
1669
			const USHORT nOfsSubLookupTable	= FT_NEXT_USHORT( pLookupTable );
1653
			const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
1670
			const FT_Byte* pSubLookup = pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable;
1654
1671
1655
1672
1656
			const USHORT nFmtSubstitution	= NEXT_UShort( pSubLookup );
1673
			const USHORT nFmtSubstitution	= FT_NEXT_USHORT( pSubLookup );
1657
			const USHORT nOfsCoverage		= NEXT_UShort( pSubLookup );
1674
			const USHORT nOfsCoverage		= FT_NEXT_USHORT( pSubLookup );
1658
1675
1659
			typedef std::pair<USHORT,USHORT> GlyphSubst;
1676
			typedef std::pair<USHORT,USHORT> GlyphSubst;
1660
			typedef std::vector<GlyphSubst> SubstVector;
1677
			typedef std::vector<GlyphSubst> SubstVector;
1661
			SubstVector aSubstVector;
1678
			SubstVector aSubstVector;
1662
1679
1663
			const FT_Byte* pCoverage	= pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
1680
			const FT_Byte* pCoverage	= pGsubBase + nOfsLookupList + nOfsLookupTable + nOfsSubLookupTable + nOfsCoverage;
1664
			const USHORT nFmtCoverage	= NEXT_UShort( pCoverage );
1681
			const USHORT nFmtCoverage	= FT_NEXT_USHORT( pCoverage );
1665
			switch( nFmtCoverage )
1682
			switch( nFmtCoverage )
1666
			{
1683
			{
1667
				case 1:			// Coverage Format 1
1684
				case 1:			// Coverage Format 1
1668
					{
1685
					{
1669
						const USHORT nCntGlyph = NEXT_UShort( pCoverage );
1686
						const USHORT nCntGlyph = FT_NEXT_USHORT( pCoverage );
1670
						aSubstVector.reserve( nCntGlyph );
1687
						aSubstVector.reserve( nCntGlyph );
1671
						for( USHORT i = 0; i < nCntGlyph; ++i )
1688
						for( USHORT i = 0; i < nCntGlyph; ++i )
1672
						{
1689
						{
1673
							const USHORT nGlyphId = NEXT_UShort( pCoverage );
1690
							const USHORT nGlyphId = FT_NEXT_USHORT( pCoverage );
1674
							aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
1691
							aSubstVector.push_back( GlyphSubst( nGlyphId, 0 ) );
1675
						}
1692
						}
1676
					}
1693
					}
Lines 1678-1689 Link Here
1678
1695
1679
				case 2:			// Coverage Format 2
1696
				case 2:			// Coverage Format 2
1680
					{
1697
					{
1681
						const USHORT nCntRange = NEXT_UShort( pCoverage );
1698
						const USHORT nCntRange = FT_NEXT_USHORT( pCoverage );
1682
						for( int i = nCntRange; --i >= 0; )
1699
						for( int i = nCntRange; --i >= 0; )
1683
						{
1700
						{
1684
							const USHORT nGlyph0 = NEXT_UShort( pCoverage );
1701
							const USHORT nGlyph0 = FT_NEXT_USHORT( pCoverage );
1685
							const USHORT nGlyph1 = NEXT_UShort( pCoverage );
1702
							const USHORT nGlyph1 = FT_NEXT_USHORT( pCoverage );
1686
							const USHORT nCovIdx = NEXT_UShort( pCoverage );
1703
							const USHORT nCovIdx = FT_NEXT_USHORT( pCoverage );
1687
							for( USHORT j = nGlyph0; j <= nGlyph1; ++j )
1704
							for( USHORT j = nGlyph0; j <= nGlyph1; ++j )
1688
								aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) );
1705
								aSubstVector.push_back( GlyphSubst( j + nCovIdx, 0 ) );
1689
						}
1706
						}
Lines 1697-1703 Link Here
1697
			{
1714
			{
1698
				case 1:		// Single Substitution Format 1
1715
				case 1:		// Single Substitution Format 1
1699
					{
1716
					{
1700
						const USHORT nDeltaGlyphId = NEXT_UShort( pSubLookup );
1717
						const USHORT nDeltaGlyphId = FT_NEXT_USHORT( pSubLookup );
1701
						for(; it != aSubstVector.end(); ++it )
1718
						for(; it != aSubstVector.end(); ++it )
1702
							(*it).second = (*it).first + nDeltaGlyphId;
1719
							(*it).second = (*it).first + nDeltaGlyphId;
1703
					}
1720
					}
Lines 1705-1714 Link Here
1705
1722
1706
				case 2:		// Single Substitution Format 2
1723
				case 2:		// Single Substitution Format 2
1707
					{
1724
					{
1708
						const USHORT nCntGlyph = NEXT_UShort( pSubLookup );
1725
						const USHORT nCntGlyph = FT_NEXT_USHORT( pSubLookup );
1709
						for( int i = nCntGlyph; (it != aSubstVector.end()) && (--i>=0); ++it )
1726
						for( int i = nCntGlyph; (it != aSubstVector.end()) && (--i>=0); ++it )
1710
						{
1727
						{
1711
							const USHORT nGlyphId = NEXT_UShort( pSubLookup );
1728
							const USHORT nGlyphId = FT_NEXT_USHORT( pSubLookup );
1712
							(*it).second = nGlyphId;
1729
							(*it).second = nGlyphId;
1713
						}
1730
						}
1714
					}
1731
					}

Return to issue 6562