Skip to content

Commit

Permalink
add font back to server
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed May 25, 2024
1 parent 52b165f commit bf005f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
remote_images = ["https://static.btcmap.org/images/.*", "https://www.openstreetmap.org/.*", "https://avatars.githubusercontent.com/.*" ]

[functions]
included_files = ["./static/fonts/*.ttf"]
included_files = [".netlify/server/_app/immutable/assets/*.ttf"]
10 changes: 5 additions & 5 deletions src/routes/og/generateImage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// import { read } from '$app/server';
import { read } from '$app/server';
import { Resvg } from '@resvg/resvg-js';
import satori from 'satori';
import { html as toReactNode } from 'satori-html';
// import Manrope from '../../../static/fonts/Manrope-Regular.ttf';
import Manrope from '../../../static/fonts/Manrope-Regular.ttf';

// const fontData = read(Manrope).arrayBuffer();
const fontData = read(Manrope).arrayBuffer();

const height = 630;
const width = 1200;
Expand All @@ -15,11 +15,11 @@ export const generateImage = async (component: any) => {

const svg = await satori(jsx, {
fonts: [
/* {
{
name: 'Manrope',
data: await fontData,
style: 'normal'
} */
}
],
height,
width
Expand Down

0 comments on commit bf005f2

Please sign in to comment.