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

Local Google Fonts #5313

Merged
merged 1 commit into from
Sep 16, 2023
Merged

Local Google Fonts #5313

merged 1 commit into from
Sep 16, 2023

Conversation

glewe
Copy link
Contributor

@glewe glewe commented Sep 1, 2023

This was a feature request #5296
I also ran into cases where I had to switch to local Google fonts due to European GDPR laws (loading fonts from Google transfers the user's IP address to Google without his consent).

The currently used font Source Sans Pro has been updated and is now named "Source Sans 3". I downloaded the woff2 files for weights 300, 400 and 700 (normal and italic) in cyrillic, cyrillic-ext, greek, greek-ext, latin, latin-ext and vietnamese versions (as the remote CSS from Google fonts currently provides).

I left the reference to the remote Google fonts in _head.astro in case someone wants to use those. However, in that case the user also needs to remove the references to the local font files and re-compile adminlte.css.

@danny007in
Copy link
Collaborator

is there any cdn option?

@glewe
Copy link
Contributor Author

glewe commented Sep 3, 2023

Any option with accessing resources from a remote source before the user gives his consent is legally not allowed. The reason behind this is that a remote service can read and use the requesting IP address which is part of the user's identity. In the case of Google fonts there were quite a lot of law suites last year in Europe, specifically in Germany. This lead for example to the development of the OMGF WordPress plugin that allows to host the used Google fonts locally.

@danny007in
Copy link
Collaborator

@glewe
Copy link
Contributor Author

glewe commented Sep 13, 2023

Can we use this

https://www.jsdelivr.com/package/npm/source-sans-pro

Yes, indeed. That works. I added source-sans to package.json and imported the css from node_modules.
I pushed the changes.

@danny007in
Copy link
Collaborator

After running the npm run production command, will this work? I would prefer to use only CDNs so that users can choose their own fonts.

@glewe
Copy link
Contributor Author

glewe commented Sep 14, 2023

After running the npm run production command, will this work? I would prefer to use only CDNs so that users can choose their own fonts.

Indeed, npm run production does not work with the node_modules version (npm run dev does). It cannot find the .css file so it says.
So I switched to the CDN of Source Sans Pro as you suggested. I assume that is acceptable from a GDPR perspective since I have never heard of that case being a problem.
I also see your point of making it easier for users to select a different font.

@danny007in
Copy link
Collaborator

I'm going to make some changes to the code. Please don't push anything

Rolled back package-lock.json

Switched npm source-sans

Switched to CDN source-sans-pro

Switched to CDN source-sans-3

Co-Authored-By: George Lewe <george@lewe.com>
@danny007in danny007in merged commit 02c9068 into ColorlibHQ:master Sep 16, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants