export const fonts = [ { family: "Rapha Sans Condensed", src: "RaphaSansCondensed-Semibold", weight: 600, style: "normal", display: "auto" }, { family: "Rapha Sans Condensed", src: "RaphaSansCondensed-Bold", weight: 700, style: "normal", display: "auto" }, { family: "Rapha Sans Numerals", src: "RaphaSansNumerals-Regular", weight: 500, style: "normal", display: "auto" }, { family: "Rapha Sans Numerals", src: "RaphaSansNumerals-Semibold", weight: 500, style: "normal", display: "auto" }, { family: "Rapha Serif Head", src: "RaphaSerifHead-Roman", weight: 400, style: "normal", display: "auto" }, { family: "Rapha Serif Head", src: "RaphaSerifHead-Italic", weight: 400, style: "normal", display: "auto" }, { family: "Rapha Serif Text", src: "RaphaSerifText-Roman", weight: 400, style: "normal", display: "auto" }, { family: "Rapha Serif Text", src: "RaphaSerifText-Italic", weight: 400, style: "normal", display: "auto" }, { family: "Rapha Serif Text", src: "RaphaSerifText-Semibold", weight: 600, style: "normal", display: "auto" } ]; const fontPath = "../../public/fonts/"; const fontFamilies = fonts.reduce((acc, curr) => { if (!curr) return acc; const font = ` @font-face { font-family: '${curr.family}'; src: url('${fontPath + curr.src}.woff2') format('woff2'), url ('${fontPath + curr.src}.woff') format('woff'); font-weight: ${curr.weight}; font-display: ${curr.display}; font-style: ${curr.style}; } `; return acc + font; }, ``); export default fontFamilies;