Skip to content

Commit c0d016b

Browse files
committed
✨ Update build script to copy font files and enhance font-face declaration in CardRenderer
1 parent 5789835 commit c0d016b

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "dist/index.js",
66
"type": "module",
77
"scripts": {
8-
"build": "tsc",
8+
"build": "tsc && node -e \"require('fs').cpSync('src/fonts', 'dist/fonts', {recursive: true})\"",
99
"dev": "node --watch --no-warnings=ExperimentalWarning --loader ts-node/esm ./src/index.ts",
1010
"start": "node dist/index.js",
1111
"test": "jest"

src/card-renderer.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,15 @@ export class CardRenderer {
147147
<style>
148148
@font-face {
149149
font-family: 'Orbitron';
150-
src: url(data:font/woff2;base64,${fontBase64.join('')}) format('woff2');
150+
font-style: normal;
151+
font-weight: 400 900;
152+
font-display: swap;
153+
src: url(fonts/orbitron.woff2) format('woff2');
154+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
151155
}
152156
153157
text {
154-
font-family: 'Orbitron', sans-serif;
158+
font-family: 'Orbitron', 'Ubuntu', 'sans-serif';
155159
font-weight: 700;
156160
}
157161

src/fonts/orbitron.woff2

11.5 KB
Binary file not shown.

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if (!GITHUB_TOKEN) {
1616
console.warn('⚠️ Get a token at: https://github.com/settings/tokens');
1717
}
1818

19+
app.use(express.static('dist'));
20+
1921
const githubClient = new GitHubClient(GITHUB_TOKEN);
2022

2123
// Cache to reduce API calls

0 commit comments

Comments
 (0)