Break down large glyph source files into smaller pieces
This commit is contained in:
parent
c4871864de
commit
7192dd65d1
105 changed files with 10915 additions and 10159 deletions
31
font-src/support/glyph-block.js
Normal file
31
font-src/support/glyph-block.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
class GlyphBlock {
|
||||
constructor(capture, blockName, body) {
|
||||
this.capture = capture;
|
||||
this.blockName = blockName;
|
||||
this.body = body;
|
||||
|
||||
this.resolved = false;
|
||||
this.exports = {};
|
||||
}
|
||||
resolve() {
|
||||
if (this.resolved) return this.exports;
|
||||
this.resolved = true;
|
||||
|
||||
const pendingApplications = [];
|
||||
const ExportCapture = fnObj => {
|
||||
pendingApplications.push(() => {
|
||||
for (const [k, v] of Object.entries(fnObj())) {
|
||||
this.exports[k] = v;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.body(this.capture, ExportCapture);
|
||||
for (const f of pendingApplications) f();
|
||||
return this.exports;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = GlyphBlock;
|
Loading…
Add table
Add a link
Reference in a new issue