CSS font-style italic vs oblique: why text may not slant

PublishedToolCSS @font-face Code Generator

Contents
  1. Why this problem happens
  2. How to check without a tool
  3. Common sticking points
  4. The takeaway
  5. Frequently asked questions

In a tool like the CSS @font-face Code Generator, you can pick Italic for the font-style setting and generate the code, yet the text on screen doesn't slant at all. It just stands there upright. The code clearly says font-style: italic;, but the result looks different.

The reason is that the font-style value and the actual letterforms inside the font file are two separate things. This post covers how italic and oblique are parallel values in code but come from different font production methods, and how to check without any tool whether a real italic file is actually connected.

Summary ① italic is the value that uses a separate slanted (cursive) design drawn by the font maker, while oblique is the original upright typeface tilted mechanically. ② The font-style value in @font-face is only a declaration that says "use this file for this style." The browser doesn't open the file and check whether it's actually slanted. ③ If you don't connect an italic file separately, the browser follows the default font-synthesis behavior and shows a fake italic made by artificially slanting the upright instead.

Why this problem happens

When you download a font from a distributor, you usually get just one Regular file. Bold and Italic files often have to be bought separately, or don't exist at all. That's where the confusion about what to put in the font-style slot starts.

In an @font-face generator, you can pick Italic from the font-style dropdown, but nothing in the code itself shows what happens when the file you connected in src is actually a Regular file. The code is finished, but the screen comes out different from what you expected.

The reverse situation happens too. If you register only Normal and then use an <em> tag or font-style: italic somewhere on the page, you get a problem for a different reason. Both cases just look like "slightly slanted text," so it's hard to tell which one is the cause.

How to check without a tool

CSS defines three values for font-style: normal, italic, and oblique. The core of this problem is that italic and oblique have different definitions.

Italic and oblique start with different font production methods

italic means a slanted design the font maker drew separately from the start. In a true italic typeface, the stroke structure of letters like a, f, and g is redesigned to differ from the upright.

oblique is the original upright letters slanted mathematically, without redrawing them. The CSS spec allows you to specify an angle after oblique. If you leave the angle out, the browser applies its default slant, usually around 14 degrees.

So in code the two keywords sit side by side, but one means "use a redrawn typeface" and the other means "tilt the existing typeface." If you choose Oblique in this tool, only the plain oblique value goes into the code, with no angle. If you want an angle too, you can add it by hand in the generated code, like oblique 14deg.

The font-style value doesn't inspect the file's contents

Declaring font-style: italic in @font-face only says "use this file for italic requests." The browser never opens the file to check whether the glyphs are actually slanted.

So if you accidentally connect a Regular file in the italic slot, it registers without any error. The result is upright letters on screen even though the slot is declared as italic.

If there's no italic file at all, the browser slants it for you

Now the reverse situation. If you register only a Normal file for a font family, the browser can't find a file in that family to use as italic when the page needs an italic style.

At that point most browsers follow the default behavior of the font-synthesis property and take the upright glyphs and slant them mathematically. It's not a real italic design but a slant produced by calculation, called "synthetic oblique."

If you don't like that behavior, declare font-synthesis: none in your CSS. Then when there's no real italic file, the browser won't force a slant and will show the upright as is.

Check it with our tool. Choosing a font-style value and hand-checking which code comes out for each one is a hassle. Enter a font name, paths, and style below, and the code is generated right away in exactly the structure described above.

CSS @font-face Code Generator

Free · No sign-up · @font-face code generated right in your browser

Common sticking points

SituationWhat actually happens
font-style: italic declared + Regular file connected in srcThe browser trusts the declaration, so the upright letters show without slanting
Only Normal registered + italic requested on the pageShown as synthetic oblique, with the upright artificially slanted by the font-synthesis default
Angle specified after oblique (e.g. oblique 14deg)Shown slanted by exactly that angle, as defined in the spec
font-synthesis: none declaredTurns off synthetic slanting itself, so with no real italic file the upright shows as is

The takeaway

italic and oblique are parallel values in code, but they differ in how the typeface was made. One is a separately drawn slanted design, and the other is the existing typeface tilted.

The font-style value in @font-face is only a declaration that doesn't inspect the file, so you have to check with your own eyes whether the file you connected actually contains slanted glyphs.

When an italic style is requested and there's no italic file, the browser shows a synthetic oblique instead, an artificial slant of the upright. Declaring font-synthesis: none turns off that automatic slanting so the upright shows as is.

CSS @font-face Code Generator

Free · No sign-up · @font-face code generated right in your browser

Frequently asked questions

What happens if I don't specify an angle after font-style: oblique?

If you leave the angle out, the browser applies the default slant defined by the CSS spec. There may be slight differences between fonts and browsers, but the oblique value itself works fine even without a specified angle.

How do I check whether a font file is really italic?

On macOS you can check in Font Book. On Windows, double-click the font file and look at the preview window that opens. Compare whether the filename has a separate Italic, and whether the stroke structure of letters like a, f, and g is fundamentally different from the upright.

Does connecting the wrong font-weight cause a similar problem?

Yes, it's the same principle. The browser doesn't inspect the file contents for font-weight either; it trusts the declaration. So if you connect a Regular file in the Bold slot, the text may stay thin on screen. This post only covers font-style, meaning the italic and oblique behavior.

Are there side effects to declaring font-synthesis: none?

If you use this property on a font with no real italic or bold file, the fallback that automatically slanted or bolded the text disappears, and the upright stays as is. If your design really needs italic or bold, it's safer to get the actual italic and bold files ready before turning this property on.

This article was adapted from our Korean original. Read the Korean original

Related articles

  1. Glassmorphism CSS Not Showing: Why backdrop-filter FailsYour glassmorphism card looks unchanged? Learn why backdrop-filter needs a transparent card, something behind it to blur, and the right prefix.
  2. Glassmorphism Card CSS: Blur and Opacity Values That WorkLearn the backdrop-filter blur, tint, border, and shadow values that make a frosted-glass card, and copy the CSS without reloading your browser.
  3. CSS gradient text shows as a square? Use background-clip: textA background gradient fills the whole box, not your letters. Here's why it happens and how background-clip: text with a transparent text color fixes it.
  4. Find a Color Name From a HEX: Why You Get Several MatchesEnter a HEX value and see the closest CSS color names among the 148 standard names, how redmean distance works, and why the ranking can shift.
  5. HEX vs RGB vs HSL: Why the Same Color Has Three Codes#3B82F6, rgb(59, 130, 246), and hsl(217, 91%, 60%) are the same color. Here's what each notation means, how to convert by hand, and what HEX alpha does.
  6. Mesh gradient overlap order: which color shows on topWhen two mesh gradient color points overlap, CSS layer order decides which color you see. Here's how background-image stacking works, and how to check it.

Related tools