Introduction

The text within a button is not always centered vertically. That is the font’s fault, not yours. You can trim the line box in CSS with text-box: trim-both cap alphabetic. That property became a cross-browser option on August 18, 2026, when Firefox adopted it. The default is still the untrimmed box, and component kits were written for that default.

Trim cuts descenders. An input, a textarea, or any box that clips overflow will cut g, p, and y once the line stops at the cap and the baseline. Turn trim off on those controls and you are back to the font’s real metrics, which may still sit high or low.

For the web, fix those metrics in CSS and leave the file alone. The same box is written as ascent-override, descent-override, and line-gap-override. Rewriting the font file is the other path, mostly for typographers who need that box everywhere the font is used, not only in one stylesheet.

How it works

Both paths use one box. The leftover above the caps equals the leftover below the baseline, so a one-word label sits in the middle of equal padding. Spare height the file already has is used first, whether that is empty room in the line or extra leading. The line only grows when real descenders would not fit after that.

GUI solution

Drop a font file to see the measurement, then download the rewritten font. That file is for typographers, and for any place that cannot take a stylesheet. You can also try three selected fonts at the bottom, and see how the tool changed them: I’ve selected fonts I admire and would like to use in my work, but their metrics are a bit off by default: Unica77 LL by Lineto, GT America by Grilli Type, and BST Ritma by British Standard Type.

Unica77 LL
Summary

Uploading and analyzing

Unica77 LL
Metrics

Uploading and analyzing

Unica77 LL
In a button

Uploading and analyzing

Unica77 LL
A paragraph

Uploading and analyzing

CLI solution

Install with npm. Then point the command at a single file, a set of files, or a folder. A folder means every .otf, .ttf, .woff, and .woff2 inside it.

npm i -g normalize-metrics

Or add it to a repo as a dev dependency:

npm i -D normalize-metrics

CSS method

For the web, leave the font files alone. --css saves style.css with ascent-override, descent-override, and line-gap-override.

normalize-metrics Inter-Regular.woff2 Inter-Regular.otf --css

Or once, without installing:

npx normalize-metrics ./fonts --css

style.css

1@font-face {
2 font-family: "Inter";
3 src: url("./Inter-Regular.woff2") format("woff2"),
4 url("./Inter-Regular.otf") format("opentype");
5 font-weight: 400;
6 font-style: normal;
7 ascent-override: 97.2%;
8 descent-override: 25%;
9 line-gap-override: 0%;
10}

File rewrite method

For typographers, and for anywhere a stylesheet cannot go. It writes a normalized copy next to the original. The letters stay the same.

normalize-metrics Inter-Regular.woff2 Inter-Regular.otf

--check reports fonts that are still off and exits without writing.