VERSION II.

This commit is contained in:
belleve 2018-07-18 21:34:27 +08:00
parent 2389d422e9
commit a08eb1600c
39 changed files with 879 additions and 2503 deletions

View file

@ -0,0 +1,19 @@
const fs = require("fs");
module.exports = function(output, family, hs, formats) {
let ans = ``;
for (const term of hs) {
let src = formats
.map(([ext, format]) => `url('${ext}/${term.name}.${ext}') format('${format}')`)
.join(", ");
ans += `
@font-face {
font-family: '${family + " Web"}';
font-weight: ${term.cssWeight};
font-style: ${term.cssStyle};
src: ${src};
}
`;
}
fs.writeFileSync(output, ans);
};