Fix NotoColorEmoji font

This commit is contained in:
Steven 2019-02-10 21:29:19 -05:00
parent d8f4faf835
commit 79135b483c
2 changed files with 10 additions and 2 deletions

View File

@ -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" },

View File

@ -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}