mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-09 04:54:33 +00:00
further endianness work for font tags
This commit is contained in:
parent
b00504df70
commit
a1a49b119a
@ -219,9 +219,11 @@ struct writeBuf
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __ppc__
|
#ifdef __ppc__
|
||||||
#define TAG_CFF 0x43464620
|
#define TAG_CFF 0x43464620
|
||||||
|
#define TAG_HEAD 0x68656164
|
||||||
#else
|
#else
|
||||||
#define TAG_CFF 0x20464643
|
#define TAG_CFF 0x20464643
|
||||||
|
#define TAG_HEAD 0x64616568
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -246,7 +248,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
|
|||||||
records[i].offset = offset;
|
records[i].offset = offset;
|
||||||
records[i].data = data;
|
records[i].data = data;
|
||||||
records[i].length = CFDataGetLength(data);
|
records[i].length = CFDataGetLength(data);
|
||||||
bool skipChecksumAdjust = (tag == 0x68656164); // 'head'
|
bool skipChecksumAdjust = (tag == TAG_HEAD); // 'head'
|
||||||
records[i].checkSum = CalcTableChecksum(reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
|
records[i].checkSum = CalcTableChecksum(reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
|
||||||
records[i].length, skipChecksumAdjust);
|
records[i].length, skipChecksumAdjust);
|
||||||
offset += records[i].length;
|
offset += records[i].length;
|
||||||
@ -309,7 +311,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
|
|||||||
}
|
}
|
||||||
records[i].data = data;
|
records[i].data = data;
|
||||||
records[i].length = (uint32_t)dataLength;
|
records[i].length = (uint32_t)dataLength;
|
||||||
bool skipChecksumAdjust = (tag == 0x68656164); // 'head'
|
bool skipChecksumAdjust = (tag == TAG_HEAD); // 'head'
|
||||||
records[i].checkSum = CalcTableChecksum(
|
records[i].checkSum = CalcTableChecksum(
|
||||||
reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
|
reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
|
||||||
records[i].length, skipChecksumAdjust);
|
records[i].length, skipChecksumAdjust);
|
||||||
@ -342,7 +344,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
|
|||||||
// write tables
|
// write tables
|
||||||
int checkSumAdjustmentOffset = 0;
|
int checkSumAdjustmentOffset = 0;
|
||||||
for (CFIndex i = 0; i<count; i++) {
|
for (CFIndex i = 0; i<count; i++) {
|
||||||
if (records[i].tag == 0x68656164) {
|
if (records[i].tag == TAG_HEAD) {
|
||||||
checkSumAdjustmentOffset = buf.offset + 2*4;
|
checkSumAdjustmentOffset = buf.offset + 2*4;
|
||||||
}
|
}
|
||||||
buf.writeMem(CFDataGetBytePtr(records[i].data), CFDataGetLength(records[i].data));
|
buf.writeMem(CFDataGetBytePtr(records[i].data), CFDataGetLength(records[i].data));
|
||||||
|
Loading…
Reference in New Issue
Block a user