Skip to content

Commit

Permalink
have Font.validate() return the warnings array and log console warnin…
Browse files Browse the repository at this point in the history
…gs (fixes opentypejs#607)
  • Loading branch information
Connum committed Apr 5, 2024
1 parent e00049a commit f546e3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ Font.prototype.validate = function() {

function assert(predicate, message) {
if (!predicate) {
console.warn(`[opentype.js] ${message}`);
warnings.push(message);
}
}
Expand Down Expand Up @@ -574,6 +575,8 @@ Font.prototype.validate = function() {
previousID = currentGlyphID;
}
}

return warnings;
};

/**
Expand Down

0 comments on commit f546e3d

Please sign in to comment.