Comment by trnglina

Comment by trnglina 16 hours ago

4 replies

What made you give up? As the article describes, self hosting fonts is as easy as making the static font files available and then adding a few lines of CSS. What solution would you want Google to offer?

rs186 15 hours ago

I needed to figure out exactly which files need to be there, and I needed to understand what's happening in that CSS file. I vaguely remember seeing different content for the CSS file in different browsers.

At that time it would take me more than a few minutes (which was what I had), and seemed a rabbit hole. I decided not to pursue that.

  • rs186 12 hours ago

    LOL downvoted. The sentence "self hosting fonts is as easy as making the static font files available and then adding a few lines of CSS" is a complete lie and you could tell they have never gone through the process themselves and were just making things up.

    If you don't believe me, you are welcome to try it out yourself FROM SCRATCH without any references whatsoever, and see how long it takes you to come up a solution that works on all 5 or 6 platforms, desktop or mobile.

    • trnglina 10 hours ago

      Please educate me if I'm missing something!

      From memory, what I would do is simply download the original ttfs or otfs, run them through woff2 (https://github.com/google/woff2), and then write the @font-face declarations for each weight/style variation. Variable fonts make this even easier, since you can get by with just the one declaration.

      One could further optimise them for size with fonttools, to do stuff like subsetting by unicode ranges (https://github.com/fonttools/fonttools), but that's quite optional. Unless your font includes CJK, it's probably not that big to begin with.

    • alwillis 6 hours ago

      > The sentence "self hosting fonts is as easy as making the static font files available and then adding a few lines of CSS" is a complete lie and you could tell they have never gone through the process themselves and were just making things up.

      It's not a lie—I've been doing exactly that as long as Google fonts has been a thing.

      I think people are confusing what was required in the back in the day when browsers were buggy and supported different font formats--15+ years ago.

      The technique was called the "bullet proof" @font-face syntax because it "solved" getting web fonts to work across operating systems and devices in the 2010's [1]:

          @font-face {
            font-family: 'Graublau Web';
            src: url('GraublauWeb.eot');
            src: local(''),
              url("GraublauWeb.woff") format("woff"),
              url("GraublauWeb.otf") format("opentype"),
              url("GraublauWeb.svg#grablau") format("svg");
          }
      
      If you weren't doing web development back then, you don't understand what a revelation this syntax was for supporting cross-browser web fonts. There were even websites that would generate the syntax for you. BTW, woff2 didn't exist then.

      It seems that some developers, like the Japanese soldiers who didn't stop fighting WWII until the 1970's because they didn't know the war ended in 1945 [2], still believe dealing with fonts in 2025 is like it was 15 years ago.

      It's never been easier to self-host fonts… why make an additional HTTPS request if you don't have to?

      There are plenty of utilities to compress TrueType or OpenType fonts to WOFF2.

      [1]: https://www.paulirish.com/2009/bulletproof-font-face-impleme...

      [2]: https://en.wikipedia.org/wiki/Hiroo_Onoda