Update the TrueType font file detection to also recognize the Mac specific header 'true'

Please refer to the TrueType specification: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html#ScalerTypeNote
This commit is contained in:
Jonas Jenwald 2018-08-05 10:33:56 +02:00
parent 444976bcd5
commit f4db38aadf

View File

@ -680,7 +680,8 @@ var Font = (function FontClosure() {
function isTrueTypeFile(file) {
var header = file.peekBytes(4);
return readUint32(header, 0) === 0x00010000;
return (readUint32(header, 0) === 0x00010000 ||
bytesToString(header) === 'true');
}
function isTrueTypeCollectionFile(file) {