Add automated change file generation
This commit is contained in:
parent
78f0fb89e4
commit
799c5027e7
20 changed files with 1044 additions and 808 deletions
|
@ -1,33 +1,33 @@
|
|||
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-display: swap;
|
||||
font-weight: ${term.cssWeight};
|
||||
font-stretch: ${term.cssStretch};
|
||||
font-style: ${term.cssStyle};
|
||||
src: ${src};
|
||||
}
|
||||
`;
|
||||
if (term.cssStyle === "oblique") {
|
||||
// CHROME hates a family with both Italic and Oblique
|
||||
ans += `
|
||||
@font-face {
|
||||
font-family: '${family + " Web Oblique"}';
|
||||
font-display: swap;
|
||||
font-weight: ${term.cssWeight};
|
||||
font-stretch: ${term.cssStretch};
|
||||
src: ${src};
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(output, ans);
|
||||
};
|
||||
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-display: swap;
|
||||
font-weight: ${term.cssWeight};
|
||||
font-stretch: ${term.cssStretch};
|
||||
font-style: ${term.cssStyle};
|
||||
src: ${src};
|
||||
}
|
||||
`;
|
||||
if (term.cssStyle === "oblique") {
|
||||
// CHROME hates a family with both Italic and Oblique
|
||||
ans += `
|
||||
@font-face {
|
||||
font-family: '${family + " Web Oblique"}';
|
||||
font-display: swap;
|
||||
font-weight: ${term.cssWeight};
|
||||
font-stretch: ${term.cssStretch};
|
||||
src: ${src};
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(output, ans);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue