Skip to content

Load different custom fonts to different products

Is there a way to load different fonts for different products in Magento2.4 ? The fonts will be self hosted in /web/fonts, but I want them to load only to specific products. Could be done in a block inside a product, something like
<style>font-face {font-family: 'custom';src: url('fonts/custom.woff2');</style> ?