Fix review comments from #424
This commit is contained in:
parent
5e37bf7aeb
commit
0e062668e9
7
fonts.js
7
fonts.js
@ -858,6 +858,11 @@ var Font = (function Font() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that table are sorted by platformID then encodingID,
|
// Check that table are sorted by platformID then encodingID,
|
||||||
|
records.sort(function(a, b) {
|
||||||
|
return ((a.platformID << 16) + a.encodingID) -
|
||||||
|
((b.platformID << 16) + b.encodingID)
|
||||||
|
});
|
||||||
|
|
||||||
var tables = [records[0]];
|
var tables = [records[0]];
|
||||||
for (var i = 1; i < numRecords; i++) {
|
for (var i = 1; i < numRecords; i++) {
|
||||||
// The sanitizer will drop the font if 2 tables have the same
|
// The sanitizer will drop the font if 2 tables have the same
|
||||||
@ -875,7 +880,7 @@ var Font = (function Font() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var missing = numRecords - tables.length;
|
var missing = numRecords - tables.length;
|
||||||
if (numRecords - tables.length) {
|
if (missing) {
|
||||||
numRecords = tables.length;
|
numRecords = tables.length;
|
||||||
var data = string16(version) + string16(numRecords);
|
var data = string16(version) + string16(numRecords);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user