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

Running local models is good now

I’ve been working with local models since they came out, and finally, they’re surprisingly good now. I have a 2022 M2 Mac with 64 GB RAM and 1TB storage and I’ve used Mistral 7B Gemma 3 OpenAI OSS-20B Qwen 3 MOE, as well as a number of other Qwen variants…

via ✰Vicki Boykis✰ June 15, 2026

Quoting Julia Evans

[...] Instead, I picture a specific person and I just write for them. Often this person is "me, but 3 years ago" or a good friend. — Julia Evans, write for 1 person Tags: writing, julia-evans

via Simon Willison's Weblog June 15, 2026

A backdoor in a LinkedIn job offer

Last week, I got a LinkedIn message from a recruiter at a small crypto startup. We exchanged a few messages over a couple of days, she described a broken proof-of-concept they needed a lead engineer for, and then sent me a public GitHub repo to review. Spe…

via Roman Imankulov June 15, 2026

Generated by openring-rs from my blogroll.