Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 19324 → Rev 19325

/trunk/Scribus/scribus/fonts/scface_ttf.cpp
65,50 → 65,46
 
double KernFeature::getPairValue ( unsigned int glyph1, unsigned int glyph2 ) const
{
if ( m_valid )
if (!m_valid)
return 0.0;
 
if (pairs.contains(glyph1) &&
pairs[glyph1].contains(glyph2))
{
return pairs[glyph1][glyph2];
}
 
if ( pairs.contains( glyph1 )
&& pairs[glyph1].contains(glyph2))
//qDebug()<<"Search in classes";
foreach (const quint16& coverageId, coverages.keys())
{
// for each pairpos table, coverage lists covered _first_ (left) glyph
if (!coverages[coverageId].contains(glyph1))
continue;
 
foreach(const quint16& classDefOffset, classGlyphFirst[coverageId].keys())
{
return pairs[glyph1][glyph2];
}
else
{
//qDebug()<<"Search in classes";
foreach (const quint16& coverageId, coverages.keys())
const ClassDefTable& cdt(classGlyphFirst[coverageId][classDefOffset]);
foreach(const quint16& classIndex, cdt.keys())
{
// for each pairpos table, coverage lists covered _first_ (left) glyph
if(coverages[coverageId].contains(glyph1))
const QList<quint16>& gl(cdt[classIndex]);
if (!gl.contains(glyph1))
continue;
//qDebug()<<"Found G1"<<glyph1<<"in Class"<<classIndex<<"at pos"<<gl.indexOf(glyph1);
// Now we got the index of the first glyph class, see if glyph2 is in one of the left glyphs classes attached to this subtable.
foreach(const quint16& classDefOffset2, classGlyphSecond[coverageId].keys())
{
foreach(const quint16& classDefOffset, classGlyphFirst[coverageId].keys())
const ClassDefTable& cdt2(classGlyphSecond[coverageId][classDefOffset2]);
foreach(const quint16& classIndex2, cdt2.keys())
{
const ClassDefTable& cdt(classGlyphFirst[coverageId][classDefOffset]);
foreach(const quint16& classIndex, cdt.keys())
const QList<quint16>& gl2(cdt2[classIndex2]);
if (gl2.contains(glyph2))
{
const QList<quint16>& gl(cdt[classIndex]);
if(gl.contains(glyph1))
{
//qDebug()<<"Found G1"<<glyph1<<"in Class"<<classIndex<<"at pos"<<gl.indexOf(glyph1);
// Now we got the index of the first glyph class, see if glyph2 is in one of the left glyphs classes attached to this subtable.
foreach(const quint16& classDefOffset2, classGlyphSecond[coverageId].keys())
{
const ClassDefTable& cdt2(classGlyphSecond[coverageId][classDefOffset2]);
foreach(const quint16& classIndex2, cdt2.keys())
{
const QList<quint16>& gl2(cdt2[classIndex2]);
if(gl2.contains(glyph2))
{
//qDebug()<<"Found G2"<<glyph2<<"in Class"<<classIndex2<<"at pos"<<gl2.indexOf(glyph2);
//qDebug()<<"Found G2"<<glyph2<<"in Class"<<classIndex2<<"at pos"<<gl2.indexOf(glyph2);
 
double v(classValue[coverageId][classIndex][classIndex2]);
// Cache this pair into "pairs" map.
pairs[glyph1][glyph2] = v;
return v;
}
}
}
}
double v(classValue[coverageId][classIndex][classIndex2]);
// Cache this pair into "pairs" map.
pairs[glyph1][glyph2] = v;
return v;
}
}
}
249,7 → 245,7
quint16 PairSetOffset ( toUint16 ( subtableOffset +10 + ( 2 * psIdx ) ) + subtableOffset );
quint16 PairValueCount ( toUint16 ( PairSetOffset ) );
quint16 PairValueRecord ( PairSetOffset + 2 );
for ( int pvIdx ( 0 );pvIdx < PairValueCount; ++pvIdx )
for ( int pvIdx ( 0 ); pvIdx < PairValueCount; ++pvIdx )
{
quint16 recordBase ( PairValueRecord + ( ( 2 + 2 + 2 ) * pvIdx ) );
quint16 SecondGlyph ( toUint16 ( recordBase ) );
256,7 → 252,6
qint16 Value1 ( toInt16 ( recordBase + 2 ) );
pairs[FirstGlyph][SecondGlyph] = double ( Value1 );
}
 
}
}
else if ( ValueFormat1 && ( !ValueFormat2 ) )
267,7 → 262,7
quint16 PairSetOffset ( toUint16 ( subtableOffset +10 + ( 2 * psIdx ) ) + subtableOffset );
quint16 PairValueCount ( toUint16 ( PairSetOffset ) );
quint16 PairValueRecord ( PairSetOffset + 2 );
for ( int pvIdx ( 0 );pvIdx < PairValueCount; ++pvIdx )
for ( int pvIdx ( 0 ); pvIdx < PairValueCount; ++pvIdx )
{
quint16 recordBase ( PairValueRecord + ( ( 2 + 2 ) * pvIdx ) );
quint16 SecondGlyph ( toUint16 ( recordBase ) );
303,7 → 298,7
for ( quint16 C2 ( 0 );C2 < Class2Count; ++C2 )
{
qint16 Value1 ( toInt16 ( Class2Record + ( C2 * ( 2 * 2 ) ) ) );
if(Value1 != 0)
if (Value1 != 0)
{
classValue[subtableOffset][C1][C2] = double ( Value1 );
}
318,7 → 313,7
for ( quint16 C2 ( 1 );C2 < Class2Count; ++C2 )
{
qint16 Value1 ( toInt16 ( Class2Record + ( C2 * 2 ) ) );
if(Value1 != 0)
if (Value1 != 0)
{
classValue[subtableOffset][C1][C2] = double ( Value1 );
}
337,14 → 332,14
 
KernFeature::ClassDefTable KernFeature::getClass ( bool leftGlyph, quint16 classDefOffset, quint16 coverageId )
{
if(leftGlyph)
if (leftGlyph)
{
if(classGlyphFirst.contains(coverageId) && classGlyphFirst[coverageId].contains(classDefOffset))
if (classGlyphFirst.contains(coverageId) && classGlyphFirst[coverageId].contains(classDefOffset))
return classGlyphFirst[coverageId][classDefOffset];
}
else
{
if(classGlyphSecond.contains(coverageId) && classGlyphSecond[coverageId].contains(classDefOffset))
if (classGlyphSecond.contains(coverageId) && classGlyphSecond[coverageId].contains(classDefOffset))
return classGlyphSecond[coverageId][classDefOffset];
}
 
396,15 → 391,15
qDebug() <<"Unknown Class Table type";
 
// if possible (all glyphs are "classed"), avoid to pass through this slow piece of code.
if(excludeList.count() != coverages[coverageId].count())
if (excludeList.count() != coverages[coverageId].count())
{
foreach(const quint16& gidx, coverages[coverageId])
{
if(!excludeList.contains(gidx))
if (!excludeList.contains(gidx))
ret[0] << gidx;
}
}
if(leftGlyph)
if (leftGlyph)
classGlyphFirst[coverageId][classDefOffset] = ret;
else
classGlyphSecond[coverageId][classDefOffset] = ret;
626,10 → 621,10
{
unsigned char u=tmp[posi];
linebuf[poso]=((u >> 4) & 15) + '0';
if(u>0x9f) linebuf[poso]+='a'-':';
if (u>0x9f) linebuf[poso]+='a'-':';
++poso;
u&=15; linebuf[poso]=u + '0';
if(u>0x9) linebuf[poso]+='a'-':';
if (u>0x9) linebuf[poso]+='a'-':';
++posi;
++poso;
if (poso > 70)