Home > Net >  What are the CSS @font-face ascent-override/descent-override percentages relative to?
What are the CSS @font-face ascent-override/descent-override percentages relative to?

Time:06-06

The CSS @font-face rule has two properties called ascent-override and descent-override. These properties can be either normal or a percentage. But if you set a percentage, what are they relative to?

  1. Are they a multiplier of the font's built in ascent and descent metrics? So use 100% to replicate the font's ascent metric?
  2. Are they a percentage of 1em, or of the font's em-square, so for example, to replicate an ascender of 680 units you'd use 68%?
  3. Something else?

CodePudding user response:

Option 2. A percentage of the used font-size. If the value of the em square was 1000 units then 68% would equate to 680 units. See Example 39 from the spec.

  • Related