Merge pull request #13341 from Snuffleupagus/FontRendererFactory-rm-closure

Remove unnecessary closure in the `src/core/font_renderer.js` file
This commit is contained in:
Tim van der Meij 2021-05-07 20:46:08 +02:00 committed by GitHub
commit f66829e5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,6 @@ import { getGlyphsUnicode } from "./glyphlist.js";
import { StandardEncoding } from "./encodings.js";
import { Stream } from "./stream.js";
const FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) {
return (
(data[offset] << 24) |
@ -220,8 +219,7 @@ const FontRendererFactory = (function FontRendererFactoryClosure() {
scale01 = 0,
scale10 = 0;
if (flags & 0x08) {
scaleX = scaleY =
((code[i] << 24) | (code[i + 1] << 16)) / 1073741824;
scaleX = scaleY = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824;
i += 2;
} else if (flags & 0x40) {
scaleX = ((code[i] << 24) | (code[i + 1] << 16)) / 1073741824;
@ -827,8 +825,8 @@ const FontRendererFactory = (function FontRendererFactoryClosure() {
}
}
return {
create: function FontRendererFactory_create(font, seacAnalysisEnabled) {
class FontRendererFactory {
static create(font, seacAnalysisEnabled) {
const data = new Uint8Array(font.data);
let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm;
const numTables = getUshort(data, 4);
@ -867,8 +865,7 @@ const FontRendererFactory = (function FontRendererFactoryClosure() {
);
}
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
},
};
})();
}
}
export { FontRendererFactory };