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

Random /static/webfonts/l/font reference destroying the font loading. #76

Open
laurenskling opened this issue Mar 18, 2024 · 1 comment

Comments

@laurenskling
Copy link

As of a couple of days, a random:
@font-face{font-display:swap;font-family:Libre Franklin;font-style:normal;font-weight:400;src:url(/static/webfonts/l/font) format("woff"),url(/static/webfonts/l/font) format("woff"),url(/static/webfonts/l/font) format("woff")}
is added to the <style> tag, destroying the actual 400 reference to the font.

After digging in, theres an added:
https://fonts.gstatic.com/l/font?kit=blabla&skey=blabla&v=v40
font loaded. I guess Google Webfont changed stuff?
This is now destroying the lowest font weight in production sites.

@laurenskling
Copy link
Author

Okay I figured it out.
By default, woff2 and woff are loaded. Apparently, woff is starting to return the /l/font?kit... urls, which mess up the logic of this codebase. I don't understand why the formatAgent stuff is needed, but

woff: `Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; rv:11.0) like Gecko`,
makes the font return these urls. So I guess technically you could also change the formatAgent?
But I chose to now only load woff2 by setting formats: ['woff2']

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