Ensure that CompiledFont.compileGlyph
always returns an Array (PR 6141 follow-up)
PR 6141 changed `CompiledFont.compileGlyph` to, in the general case, return an Array. However, that PR apparenly forgot to update the no-glyph, empty-glyph, and endchar-glyph code-path and a String was still being (incorrectly) returned. Given the way that `FontFaceObject.getPathGenerator` (on the API side) is implemented, this shouldn't have caused any bugs despite the Worker possible returning unexpected data.
This commit is contained in:
parent
646d81cd09
commit
775763a091
@ -616,7 +616,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
|
||||
parse(code);
|
||||
}
|
||||
|
||||
var noop = '';
|
||||
const NOOP = [];
|
||||
|
||||
function CompiledFont(fontMatrix) {
|
||||
this.compiledGlyphs = Object.create(null);
|
||||
@ -639,7 +639,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
|
||||
|
||||
compileGlyph(code, glyphId) {
|
||||
if (!code || code.length === 0 || code[0] === 14) {
|
||||
return noop;
|
||||
return NOOP;
|
||||
}
|
||||
|
||||
let fontMatrix = this.fontMatrix;
|
||||
|
Loading…
x
Reference in New Issue
Block a user