CSS guides

Compare CSS font weights using a typeface’s own range

·

A CSS weight requests a particular thickness from the available typeface. Compare the same words at several weights and sizes while keeping the family fixed, then bring the chosen numbers into your project.

Font Weight Previewer

Compare Newsreader at 200, 400 and 800

Select Newsreader in Font for preview, set Preview size to 32, and choose Use font weight range. The resulting rows are 200, 400 and 800. They correspond to this font’s minimum, default and maximum.

Enter a phrase containing the letterforms you want to compare. Add 537.5 to Weights to compare for a value between the default and the heaviest row. The q and g in the Latin example are useful for checking small shapes.

Compare Newsreader at 200, 400 and 800
Newsreader settingCSS weight
Minimum200
Axis default400
Maximum800

W3C CSS Fonts Level 4, font-weight propertyMicrosoft OpenType specification, font variations table

Read the available weights of a local font

Open one TTF, OTF, WOFF or WOFF2 file. A variable font can store its minimum, default and maximum in the wght axis of the fvar table. A static font usually has a single weight value in its OS/2 table.

Leave Available weights only enabled to compare values inside the detected range. If you turn it off, a row requested outside the range is marked explicitly. The browser matches that number to the available faces. Weight synthesis is disabled for the sample.

W3C CSS Fonts Level 4, font-weight propertyMicrosoft OpenType specification, font variations tableMicrosoft OpenType specification, OS/2 weight classW3C WOFF File Format 2.0

Apply a CSS weight in your project

Copy 400 CSS to get one declaration, or download font-weights.css. The file has a separate class for each displayed weight. Apply a class such as weight-800 to an element in your project.

Load or select your project font separately. If you need to compare another writing system, choose a font that covers it and use representative sample text. The Noto Sans Arabic preset includes an Arabic example.

The CSS class for Newsreader’s maximum preview weight
.weight-800 {
  font-weight: 800;
}

W3C CSS Fonts Level 4, font-weight property

Common questions

Can I preview a weight other than a multiple of 100?

Yes. Enter values such as 350 or 537.5. CSS accepts numeric weights from 1 through 1000 and uses a variable family’s available weight axis when selecting the face.

What can I do if WOFF2 metadata cannot be read?

Choose a browser with Brotli decompression support or use the font’s TTF, OTF or WOFF version.

Sources

Put it into practice.

Related guides