SAMPLE-IMAGES: Use SVG instead of PNG
This commit is contained in:
parent
f3497f31a7
commit
55714d5340
3707 changed files with 3459 additions and 1983 deletions
36
utility/generate-samples/templates/character-variant.js
Normal file
36
utility/generate-samples/templates/character-variant.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
const themes = require("../themes/index");
|
||||
|
||||
module.exports = function (args) {
|
||||
const theme = themes[args.theme];
|
||||
const unitWidth = 128;
|
||||
|
||||
let frames = [];
|
||||
|
||||
for (const ch of args.hotChars) {
|
||||
const slopeClasses = args.slopeDependent ? ["normal", "italic"] : ["normal"];
|
||||
for (const slope of slopeClasses) {
|
||||
frames.push({
|
||||
left: unitWidth * frames.length,
|
||||
right: unitWidth * (1 + frames.length),
|
||||
"horizontal-align": "center",
|
||||
"vertical-align": "center",
|
||||
"line-height": 128 / 96,
|
||||
"baseline-offset": 0.85,
|
||||
contents: [
|
||||
{ "font-family": "Iosevka" },
|
||||
{ "font-size": 96 },
|
||||
{ "font-style": slope },
|
||||
{ "font-feature-settings": { ...args.fontFeatures, calt: 1 } },
|
||||
{ color: theme.body },
|
||||
ch
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: unitWidth * frames.length,
|
||||
height: 160,
|
||||
frames
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue