Host fonts locally?

I was thinking about using some Google fonts, but I don’t want to link to Google Fonts in my CSS. That can allow Google to potentially track certain behaviors of a user and so necessitate a GDPR notice, which I’d rather avoid. Is it possible to add fonts to my blog’s files somehow?

I’m assuming it would have to be via a plugin in order to access a folder hierarchy that I can’t from within Micro.blog’s design page, but that goes way beyond my know-how. That might mean my request is crazy, but I’m grateful for any suggestions about possible starting points.

You could definitely provide the fonts via a plug-in, but I’d say the easiest way is to upload them in the uploads section.

It’s that easy? Wow! I’ll give that a try.

You’ll need the relevant stylesheets too, but as for hosting the font files, yeah, it should be that easy.

2 Likes

Yes, I uploaded my font and my CSS has this:

@font-face {
  font-family: "Berkeley Mono";
  src: url("https://json.blog/uploads/2024/berkeleymono-regular.woff2")
    format("woff2");
}
1 Like

Very cool!

Nice.

How long does it take for Micro.blog to actually use the fonts that i have uploaded? I did a full rebuild and I cleared out my browser cache, but the change didn’t yet happen. I’m asking because I don’t want to troubleshoot yet, if the delay is a Micro.blog thing.

No different than any other CSS change for me. Do you see the CSS change if you use the browser inspector?

No. I’ll try troubleshooting tomorrow. Just knowing your experience didn’t differ is helpful.