beyonk-group / google-fonts-webpack-plugin

47 stars 24 forks source link

Is there a way to remove local in the fonts.css file? #10

Closed rationalthinker1 closed 3 years ago

rationalthinker1 commented 3 years ago

I'm having issues where the fonts won't up properly if it is using fonts? Is it possible to remove them?

antony commented 3 years ago

I'm afraid that I don't understand what you're saying here. Please consider writing a clearer issue description along with a reproducible example, if possible.

dakur commented 3 years ago

@rationalthinker1

local: false config option is not a way for you?

Aha, sorry, that makes something different.

dakur commented 3 years ago

@antony I've ran into this issue as well. The problem is that the local() expression in CSS searches for a font in user's OS and if found, it uses it instead.

I installed Open Sans on my computer (for completely different reasons than web development). It is named Open Sans for regular weight, Open Sans Bold for bold weight etc. Now I'm coding a website which uses Open Sans and I see that all texts are rendering in regular weight – even those which should render in bold.
I've spent quite a lot time resolving that the root case is this local() expression. As it is generated from font family name automatically, it is Open Sans all the time – no matter what weight it is. Which – in system – resolves to regular everytime as other weights have its weights as suffixes in the font name.

So we probably need an option to allow developer to download fonts to local, but not to adding this expression to CSS.

dakur commented 3 years ago

I've made PR #18