Variable fonts and italics across browsers

I’m a big fan of Atkinson Hyperlegible Next and Berkeley Mono (TX-02). It is my opinion that they both look great, unique, and provide valuable legibility features.

I recently refactored this site to use the variable, web versions of these fonts. I was happy that I now had only a single @font-face definition, not a handful, and went on my way. (I had haphazardly picked up these parameters on the Internet somewhere.)

@font-face {
    font-family: 'Berkeley Mono';
    src: url('../fonts/Berkeley Mono Variable.woff2') format('woff2');
    font-stretch: 60 100;
    font-weight: 100 900;
    font-style: oblique -16deg 0deg;
    font-feature-settings: calt;
    font-variant-ligatures: contextual;
}

@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    src: url('../fonts/AtkinsonHyperlegibleNextVF-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: oblique -16deg 0deg;
}

Then, just recently, I realized that my italics were broken on this site for weeks! They worked on Chrome as I had it configured. They did not work on Firefox.

I tried a few things.

First, I tried duplicating the @font-face definition, but with font-style: italic. This made it work on Firefox, but broke Chrome.

I then found there is a new way to specify italics for variable web fonts, specifically (assuming it is supported by the font): font-variation-settings. In the case of Atkinson Hyperlegible Next, I could get my italics looking right on both Firefox and Chrome by adding the following CSS.

em {
  font-variation-settings: "ital" 1;
  font-synthesis: none;
}

But, this didn’t work for Berkeley Mono.

I also tried things like using woff2-variations in my @font-face definitions and other little tweaks to no avail.

Finally, after more experimentation, I was pleasantly surprised that I could get everything working just by simplifying.

@font-face {
    font-family: 'Berkeley Mono';
    src: url('../fonts/Berkeley Mono Variable.woff2') format('woff2');
    font-stretch: 60 100;
    font-weight: 100 900;
    font-feature-settings: calt;
    font-variant-ligatures: contextual;
}

@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    src: url('../fonts/AtkinsonHyperlegibleNextVF-Variable.woff2') format('woff2');
    font-weight: 100 900;
}

I dropped the (likely incorrect) font-style attribute. No need for the em class override, now, either.

With that, I have italics, both for my normal font, and for my monospace font that work on both Firefox and Chrome. All I needed to do was delete the right two lines.

Posts from blogs I follow

Kaizen #4: Overhauled homelab

I started this “blog-series” to force myself to write more about my set up, and my continuous iterations. But it didn’t happen… until today! This post has been a long time coming, and I have kept the ideas in my head and notes. I will walk through everythi…

via Tim Hårek July 05, 2026

Better Models: Worse Tools

Better Models: Worse Tools Armin reports on a weird problem he ran into while hacking on Pi: The short version is that newer Claude models sometimes call Pi’s edit tool with extra, invented fields in the nested edits[] array. And not Haiku or some small m…

via Simon Willison's Weblog July 04, 2026

Verizon is About to Break our Watches

Two years ago I bought a pair of Gizmo watches for my kids ( review). There's a companion app for texting and configuration ("Gizmohub"), and Verizon is moving everyone over to a new one ("Verizon Family"). But the new app doesn't work for watch-only acco…

via Jeff Kaufman's Writing July 04, 2026

Generated by openring-rs from my blogroll.