Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable fonts support #13

Closed
warflash opened this issue Feb 23, 2024 · 1 comment
Closed

variable fonts support #13

warflash opened this issue Feb 23, 2024 · 1 comment

Comments

@warflash
Copy link
Member

This might be more of a question type issue due to missing knowledge on my end.

I tried setting up the module to replace our current google font dependency:
@import url("https://fonts.googleapis.com/css2?family=Encode+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap")

However when comparing the font output I noticed that google downloads a single 27kb woff2 file while nuxt/fonts creates 5 distinct woff files, ~40kb each -> 200kb.
After a bit of searching I learned about variable fonts and Encode Sans seems to be one of them.

So the question would be whether there is some sort of special config needed to make variable font's work properly? That is assuming the cause for the discrepancy is variable fonts of course.

Thanks!

This is the config used:

fonts: {
	families: [{ name: "Encode Sans", provider: "google" }],
	defaults: {
		weights: [100, 200, 300, 400, 500, 600, 700, 800, 900],
		styles: ["normal"],
		subsets: ["cyrillic-ext", "cyrillic", "greek-ext", "greek", "vietnamese", "latin-ext", "latin"],
	},

	assets: {
		prefix: "/_fonts",
	},
},
@warflash
Copy link
Member Author

Oh no, as always I find the issue covering mine right afterwards 😭
Closing in favor of #10

@warflash warflash closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant