From cff51a24a23b8b583873289487a1176ebc60a2f3 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 10 Feb 2025 09:48:14 -0600 Subject: [PATCH] Refactor getFontData --- src/site/font.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/site/font.ts b/src/site/font.ts index 81348fef..9f0f3b78 100644 --- a/src/site/font.ts +++ b/src/site/font.ts @@ -2,19 +2,17 @@ import fs from 'fs'; import path from 'path'; import { cwd } from 'process'; -const FONT_FAMILY_IBM_PLEX_MONO = 'IBMPlexMono'; +const FONT_IBM_PLEX_MONO_FAMILY = 'IBMPlexMono'; +const FONT_IBM_PLEX_MONO_PATH = '/public/fonts/IBMPlexMono-Medium.ttf'; const getFontData = async () => - fs.readFileSync(path.join( - cwd(), - '/public/fonts/IBMPlexMono-Medium.ttf', - )); + fs.readFileSync(path.join(cwd(), FONT_IBM_PLEX_MONO_PATH)); export const getIBMPlexMonoMedium = () => getFontData() .then(data => ({ - fontFamily: FONT_FAMILY_IBM_PLEX_MONO, + fontFamily: FONT_IBM_PLEX_MONO_FAMILY, fonts: [{ - name: FONT_FAMILY_IBM_PLEX_MONO, + name: FONT_IBM_PLEX_MONO_FAMILY, data, weight: 500, style: 'normal',