mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

380K
active users

Rysiekúr (old account)

I accidentally a Font Degooglifier:
git.occrp.org/libre/fonts-dego

I was sick and tired of having to manually degooglify fonts, so I made this. Seems to work. Handles both local files and URLs.

Perhaps somebody finds it useful.

GitLablibre / fonts-degooglifierA DeGooglifier for webfonts. Because privacy matters.

Humm... Currently Fonts Degooglifier works by creating a copy of the CSS file and working on that copy.

I am starting to think it should instead create a backup and work on the original.

I wanted to go slow and not break things, but it does seem more intuitive.

Phew! Fonts in 3 @OCCRP projects ungooglified! Easy, since now I have the right tool for the job. ;)

1. Sandcastle property map:
cdn.occrp.org/projects/sandcas
Related investigation:
occrp.org/en/goldensands/

2. Libre code if anyone wants to make a similar map (also ungooglified now):
git.occrp.org/libre/property-m

3. Putin's Circle:
cdn.occrp.org/projects/putinan
Related investigation:
occrp.org/en/putinandtheproxie

(this one does not have a libre code thingy... sorry)

cdn.occrp.orgSandcastle property map

@rysiek Yes, when I put together a privacy-friendly website recently I made sure to embed all the (very nice!) google fonts rather than expose the end-users to google directly ...

@rysiek Something that could be useful:

use hueristics upon the filenames to fix the @font-face rules so they declare the same font family but different font weights, styles, etc.

It always annoys me that Google fonts doesn't declare their @font-face rules properly, in the way that works best for designers and browsers. That they confuse the concepts of font files and font families.

Looks excellent and useful! It's such a pain to do this manually, so - I admit - one defaults to just leaving the calls to Google fonts there

@giocomai yeah, same here. Happy you find it useful. Suggestions and patches welcome!

Will give it a try soon and will see how it goes! thanks!

@rysiek Very nice! if I understand correctly, I could use it by only passing google's font URLs directly (e.g. If I don't have CSS files because I use some form of CSS preprocessor). Is that right?

@lastfuture well, not really. Currently it only supports CSS files. I am not sure if I get the point of providing the font URL directly -- as in, if it's a *.ttf or *.woff or whatever, then just wget/curl it?

What would be the use-case here?

@rysiek I'm sorry, I worded my question poorly. Will I be able to pass Google's CDN URLs of their CSS directly? e.g. fonts.googleapis.com/css?famil

@rysiek I would test this myself but on macOS 10.14.2 for now it aborts with

./degooglify.sh: line 258: ${SOURCE_OF_CSS,,}: bad substitution

with GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)

@rysiek I checked what -r would do, it seems sed that ships with macOS uses a different syntax. From the man page:

-E Interpret regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's). The re_format(7) manual page fully describes both formats.

@rysiek after a quick test I can confirm that if I replace all occurrences of the sed parameter -r with -E in the script, it seems to complete correctly. Does this output look plausible?

pastebin.com/dzapyZd9

pastebin.combash /Users/peter/Downloads/degooglify.sh 'https://fonts.googleapis.com/css?fami - Pastebin.com

@rysiek it did name the CSS file `Major-Mono-Display__subset-latin-ext\n.css` for some reason but other than that the result looks good.

@rysiek works like a charm now. Thank you for making this helpful tool

@rysiek beautiful. It still adds the newline to the file name but that's easy to fix by hand

@rysiek Excuse my ignorance on this but what do you mean by "degooglify fonts" and why is it a good idea to do it?

@fox

A pretty popular thing these days is to:
1. go to fonts.google.com
2. select fonts
3. include the generated CSS in a site's CSS (the fonts are then served from Google's servers)

This script makes it easy to automagically download the font files locally onto your server, and modify the CSS files to refer to them, instead of to Google's infrastructure.

@rysiek @fox Ah: That answers a question for me which was "how does this differ from Decentraleyes". Your tool is for actually modifying the server's code to remove Google (Yes x 1000!), Decentraleyes is for Clients to dynamically reroute requests away from Google's CDNs.
I'm glad to see Google's "side channel attacks" getting more attention. Next we need to kill their goddamned DNS..

@cathal @fox exactly. It's a tool for webdevelopers to *easily* move from embedding Google Fonts from Google's infrastructure to self-hosting them.

@rysiek I love to GitHub star, I'll have to find my selfhosted bookmark solution and use it :) thanks for sharing!

@PifyZ yup. But a lot of webdevs will just grab the CSS from fonts.googleapis.com, because it's easier to see and test different scripts etc.

My script is there to simplify moving to self-hosting of fonts that are already being used.

Obviously I would recommend everyone to instead just not embed the fonts from Google Fonts in the first place. So that my script would be useless. 😏

@PifyZ whoa cool! Happy to inspire people!

I think I need to look into supporting multiple url() stanzas.