mirror of
https://github.com/FlipsideCrypto/og-image.git
synced 2026-02-06 10:46:43 +00:00
Fix NotoColorEmoji font
This commit is contained in:
parent
d8f4faf835
commit
79135b483c
2
now.json
2
now.json
@ -7,7 +7,7 @@
|
||||
"builds": [
|
||||
{ "src": "public/*", "use": "@now/static" },
|
||||
{ "src": "package.json", "use": "@now/static-build" },
|
||||
{ "src": "src/card.ts", "use": "@now/node@canary", "config": { "maxLambdaSize": "40mb" } }
|
||||
{ "src": "src/card.ts", "use": "@now/node@canary", "config": { "maxLambdaSize": "43mb" } }
|
||||
],
|
||||
"routes": [
|
||||
{ "src": "/", "dest": "/public/index.html" },
|
||||
|
||||
@ -6,6 +6,7 @@ import { sanitizeHtml } from './sanitizer';
|
||||
function getCss(theme: string, fontSize: string) {
|
||||
const regular = readFileSync(`${__dirname}/../.fonts/Inter-Regular.woff2`).toString('base64');
|
||||
const bold = readFileSync(`${__dirname}/../.fonts/Inter-Bold.woff2`).toString('base64');
|
||||
const noto = readFileSync(`${__dirname}/../.fonts/NotoColorEmoji.ttf`).toString('base64');
|
||||
|
||||
let background = 'white';
|
||||
let foreground = 'black';
|
||||
@ -31,6 +32,13 @@ function getCss(theme: string, fontSize: string) {
|
||||
src: url(data:font/woff2;charset=utf-8;base64,${bold}) format('woff2');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: url(data:font/ttf;charset=utf-8;base64,${noto}) format('truetype');
|
||||
}
|
||||
|
||||
body {
|
||||
background: ${background};
|
||||
background-image: radial-gradient(${radial} 5%, transparent 0);
|
||||
@ -76,7 +84,7 @@ function getCss(theme: string, fontSize: string) {
|
||||
}
|
||||
|
||||
.heading {
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-family: 'Inter', 'Noto', sans-serif;
|
||||
font-size: ${sanitizeHtml(fontSize)};
|
||||
font-style: normal;
|
||||
color: ${foreground}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user