0

validator.w3.org/nu keeps showing

Error: CSS: unicode-range: Too many values or values are not recognized.

I've tried removing upto the last 9 values (U+2014,U+2019,U+201C,U+201D,U+2020,U+2021,U+2026,U+20AC,U+2190) but it keeps showing the same error.

Until last week the same exact range did not show any error. Do you know if there is some problem with validator.w3.org/nu?

@font-face {
  font-family: 'ManropeVariable';
  src: url('/assets/css/src/fonts/Manrope-wght-subset.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  /* Minimal english subset + U+5A for letter Z */
  unicode-range: U+A,U+20,U+22,U+25-29,U+2B-3E,U+41-59,U+5A,U+61-7A,U+F3,U+3A4,U+2014,U+2019,U+201C,U+201D,U+2020,U+2021,U+2026,U+20AC,U+2190;
}

@font-face {
    font-family: 'EB GaramondVariable';
    src: url("/assets/css/src/fonts/eb-garamond-latin-variable-wghtOnly-normal-subset.woff2") format('woff2');
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    /* Minimal english subset */
    unicode-range: U+A,U+20,U+22,U+25-29,U+2B-3E,U+41-59,U+61-7A,U+F3,U+3A4,U+2014,U+2019,U+201C,U+201D,U+2020,U+2021,U+2026,U+20AC,U+2190;
}

@font-face {
    font-family: 'EB GaramondVariable';
    src: url("/assets/css/src/fonts/eb-garamond-latin-variable-wghtOnly-italic-subset.woff2") format('woff2');
    font-style: italic;
    font-weight: 400 800;
    font-display: swap;
    /* Minimal english subset */
    unicode-range: U+A,U+20,U+22,U+25-29,U+2B-3E,U+41-59,U+61-7A,U+F3,U+3A4,U+2014,U+2019,U+201C,U+201D,U+2020,U+2021,U+2026,U+20AC,U+2190;
}
TylerH
  • 20,799
  • 66
  • 75
  • 101
rocco
  • 115
  • 1
  • 7
  • Does this answer your question? [Error: CSS: unicode-range: Too many values or values are not recognized](https://stackoverflow.com/questions/69516381/error-css-unicode-range-too-many-values-or-values-are-not-recognized) – JosefZ Oct 15 '21 at 14:25
  • In that answer those values were not in the stated fonts. I think the values in my ranges are for the stated fonts. Please, do you know how can I find if I used the correct values for the stated fonts? – rocco Oct 15 '21 at 14:54
  • Check if this could help: [How to determine if a Glyph can be displayed](https://stackoverflow.com/questions/69261202/). – JosefZ Oct 15 '21 at 16:21
  • Tried, but it doesn't work - or at least I can't make it work – rocco Oct 15 '21 at 17:37
  • So, at the end I've taken the unicode-range specified for the stated fonts in Google fonts stylesheet and even with that validator.w3.org/nu keeps showing the same error. There must be something wrong with the validator, also because until last week was showing no errors with these unicode-ranges. Anyone know how to check if there is any problem with validator.w3.org/nu? – rocco Oct 16 '21 at 08:09
  • 2
    [W3docs](https://www.w3docs.com/learn-css/unicode-range.html) says Syntax `unicode-range: single codepoint | codepoint range | wildcard range | initial | inherit;`. No _multiple values_ list like in [_developer.mozilla_](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range)… – JosefZ Oct 16 '21 at 10:36
  • So, as per your suggestion, I've used just a codepoint range, and precisely U+0020-007F which is the most common basic latin for English sites, and it works! No more errors! Thank you so much. JosefZ. I am curious, however, to understand why the unicode-range of Google fonts gave error; could it be because I am using variable fonts with subsettings? – rocco Oct 16 '21 at 11:46
  • I have exactly the same problem. I didn't get it, how did you solve this? – João Pimentel Ferreira Oct 24 '21 at 13:07
  • I ended up using Basic Latin (0020—007F) which is probably the most common range for English sites. So, I've changed the unicode-range from the one above to "unicode-range: U+0020-007F;" and error disappeared. But it's specifically for sites in English language. – rocco Oct 25 '21 at 15:07
  • This CSS validator defect has now been fixed. – Alohci Oct 29 '21 at 00:13
  • I don't think so. With the unicode-range as above listed, and the one from Google Fonts too, keeps showing the same error. I have to to use unicode-range: U+0020-007F in order to validate. – rocco Oct 30 '21 at 11:40

0 Answers0