Document Google Fonts-related things for usage in GFonts.
Find a file
2023-05-20 20:13:53 +00:00
LICENSE Initial commit 2023-05-20 10:51:25 +00:00
README.md Update 'README.md' 2023-05-20 20:13:53 +00:00

Documentation

Intro

This documents aims to document obscure things like the CSS2 URL format and other stuff for its usage in GFonts and related projects.

Self-hosting

Google Fonts Mirror

Creating a Google Fonts mirror is an easy task. You need the following:

  1. A reliable server (e.g. a VPS).
  2. git.
  3. A way to host the files (Caddy, NGINX, Apache HTTP Server, etc.)
  4. (Technically this is not a requirement, but you should use one anyway) A domain.

Then follow the following steps:

  1. Run git clone https://github.com/google/fonts --branch main --single-branch --depth 1 [folder]
    • [folder] should be replaced with the folder where you will save the mirror.
    • This is just a shallow clone of the repo. You can just git clone the repo, but it's not recommended due to disk and bandwidth usage.
  2. Serve the files somewhere.
  3. Check that the mirror works by accessing the [root]/README.md
    • [root] should be replaced with your domain + the path where it's served (for example, cdn.sofiaritz.com/fonts).
    • If everything is working, a README.md file like this one should be downloaded.
  4. (Optional) Create a index.html file.
    • You can create a index.html file with something you want to tell about the mirror at [folder].
    • For example, check cdn.sofiaritz.com/fonts.
      • I use that page to teach the users about the dangers of services like Google Fonts, how I handle personal data and my contact information.

GFonts Interface

  1. Run git clone https://git.sofiaritz.com/GFonts/gfonts-interface
  2. Run yarn build.
  3. Follow step 2 of Self-hosting § Google Fonts Mirror with the dist/ folder.

CSS2 format

The CSS2 format documentation is widely available, this helps implementors like us to create compatible APIs and libraries. Archived

Projects

There are currently 2 working projects under the GFonts umbrella:

  • GFonts Interface. A simple way to generate CSS files from your Google Fonts URLs.
  • gfonts-js-library. Everything related to metadata retrieval, CSS2 parsing, etc. for the interface is here.

Future projects

  • GFonts API. A CSS2-compatible API to improve the learning curve of GFonts when coming from Google Fonts.
  • gfonts-rust-library. Everything related to metadata retrieval, CSS2 parsing, etc. for the CSS2 Rust API is here.

Licensing

You are free to use this documentation under the CC BY 4.0 License. When attributing this work, you should use the following:

"GFonts Documentation" by Sofía Aritz and GFonts contributors is licensed under CC BY 4.0 License.

You do not need to attribute this work when you're doing things like implementing behaviour described here and things like that (though it's appreciated :p)