unplugin-fonts
unplugin-fonts copied to clipboard
Feature request: woff/woff2 support
If I get it right it's only possible to import .ttf.
Would be great to support other formats as well.
Nah, woff/woff2 works, at least on local files. The issue I'm running into is that the rules generated are backwards:
TTF -> WOFF -> WOFF2 -> Local
When it really should be the other way around.
Nah, woff/woff2 works, at least on local files. The issue I'm running into is that the rules generated are backwards:
TTF -> WOFF -> WOFF2 -> Local
When it really should be the other way around.
I am not sure if this is the right way to do it, but src can also be an array. So it is possible to set the order. But I can't figure out how to put the local as first.
ViteFonts({
custom: {
display: 'swap',
families: [
{
name: 'Roboto',
src: ['./src/fonts/roboto*woff2', './src/fonts/roboto*woff', './src/fonts/roboto*ttf'],
local: 'Roboto',
}
],
},
})