Search code examples
cssfontsfont-facetext-rendering

Is text-rendering allowed in @font-face declaration?


I've stumbled upon a CSS file for webfont integration, in which text-rendering property was used inside of @font-face:

@font-face {
  font-family: "Font Name";
  /** ... */
  text-rendering: optimizeLegibility;
}

My IDE tells me that this is an incorrect usage, and it is according to the MDN. Is this a mistake of CSS author or is there some browser discrepancy involved?


Solution

  • It's probably a mistake on the author's part. text-rendering is a property, not an @font-face descriptor. Furthermore, it's a text property, not a font property. These are two distinct categories of properties.