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