diff --git a/functions/_common/fonts/Lato-Bold.ttf.bin b/functions/_common/fonts/Lato-Bold.ttf.bin deleted file mode 100644 index 1d23c7066e0..00000000000 Binary files a/functions/_common/fonts/Lato-Bold.ttf.bin and /dev/null differ diff --git a/functions/_common/fonts/Lato-Regular.ttf.bin b/functions/_common/fonts/Lato-Regular.ttf.bin deleted file mode 100644 index 0f3d0f837d2..00000000000 Binary files a/functions/_common/fonts/Lato-Regular.ttf.bin and /dev/null differ diff --git a/functions/_common/fonts/LatoLatin-Bold.ttf.bin b/functions/_common/fonts/LatoLatin-Bold.ttf.bin index a3632cdd18d..ec1db51ed5c 100644 Binary files a/functions/_common/fonts/LatoLatin-Bold.ttf.bin and b/functions/_common/fonts/LatoLatin-Bold.ttf.bin differ diff --git a/functions/_common/fonts/LatoLatin-Medium.ttf.bin b/functions/_common/fonts/LatoLatin-Medium.ttf.bin new file mode 100644 index 00000000000..46042c73d10 Binary files /dev/null and b/functions/_common/fonts/LatoLatin-Medium.ttf.bin differ diff --git a/functions/_common/fonts/LatoLatin-Regular.ttf.bin b/functions/_common/fonts/LatoLatin-Regular.ttf.bin index f811a93a478..886ba45546d 100644 Binary files a/functions/_common/fonts/LatoLatin-Regular.ttf.bin and b/functions/_common/fonts/LatoLatin-Regular.ttf.bin differ diff --git a/functions/_common/fonts/PlayfairDisplay-Regular.ttf.bin b/functions/_common/fonts/PlayfairDisplay-Regular.ttf.bin deleted file mode 100644 index bd8c8795439..00000000000 Binary files a/functions/_common/fonts/PlayfairDisplay-Regular.ttf.bin and /dev/null differ diff --git a/functions/_common/fonts/PlayfairDisplayLatin-Regular.ttf.bin b/functions/_common/fonts/PlayfairDisplayLatin-Regular.ttf.bin deleted file mode 100644 index 67326e23465..00000000000 Binary files a/functions/_common/fonts/PlayfairDisplayLatin-Regular.ttf.bin and /dev/null differ diff --git a/functions/_common/fonts/PlayfairDisplayLatin-SemiBold.ttf.bin b/functions/_common/fonts/PlayfairDisplayLatin-SemiBold.ttf.bin new file mode 100644 index 00000000000..bbe317f9240 Binary files /dev/null and b/functions/_common/fonts/PlayfairDisplayLatin-SemiBold.ttf.bin differ diff --git a/functions/_common/grapherRenderer.ts b/functions/_common/grapherRenderer.ts index 62186808c09..61d7bc57bf2 100644 --- a/functions/_common/grapherRenderer.ts +++ b/functions/_common/grapherRenderer.ts @@ -7,9 +7,10 @@ import { png } from "itty-router" import svg2png_wasm from "../../node_modules/svg2png-wasm/svg2png_wasm_bg.wasm" // these are regular .ttf files, but cloudflare needs the .bin extension to serve them correctly -import LatoRegular from "../_common/fonts/LatoLatin-Regular.ttf.bin" // https://raw.githubusercontent.com/googlefonts/LatoGFVersion/main/fonts/Lato-Regular.ttf -import LatoBold from "../_common/fonts/LatoLatin-Bold.ttf.bin" // https://raw.githubusercontent.com/googlefonts/LatoGFVersion/main/fonts/Lato-Bold.ttf -import PlayfairRegular from "../_common/fonts/PlayfairDisplayLatin-Regular.ttf.bin" // https://raw.githubusercontent.com/clauseggers/Playfair/1.202/fonts/TTF/PlayfairDisplay-Regular.ttf +import LatoRegular from "../_common/fonts/LatoLatin-Regular.ttf.bin" +import LatoMedium from "../_common/fonts/LatoLatin-Medium.ttf.bin" +import LatoBold from "../_common/fonts/LatoLatin-Bold.ttf.bin" +import PlayfairSemiBold from "../_common/fonts/PlayfairDisplayLatin-SemiBold.ttf.bin" import { Env } from "../grapher/thumbnail/[slug].js" declare global { @@ -225,7 +226,7 @@ async function renderSvgToPng(svg: string, options: ImageOptions) { // if we include details, pngHeight is only the height of the chart, but we also have an "appendix" at the bottom that we want to include height: options.details ? undefined : options.pngHeight, backgroundColor: "#fff", - fonts: [LatoRegular, LatoBold, PlayfairRegular].map( + fonts: [LatoRegular, LatoMedium, LatoBold, PlayfairSemiBold].map( (f) => new Uint8Array(f) ), }) diff --git a/site/GrapherPage.tsx b/site/GrapherPage.tsx index 143e8edc616..0f7e4dbb6e6 100644 --- a/site/GrapherPage.tsx +++ b/site/GrapherPage.tsx @@ -111,6 +111,13 @@ window.Grapher.renderSingleGrapherOnGrapherPage(jsonConfig)` )) ) )} +