ex-unit-004.html (1299B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Values and Units Test: support for the ex unit</title> 4 <link rel="author" title="Jonathan Kew" href="mailto:jkew@mozilla.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-values-3/#font-relative-lengths"> 6 <link rel="help" href="https://www.w3.org/TR/css-fonts-3/#first-available-font"> 7 <link rel="match" href="reference/ex-unit-004-ref.html"> 8 <meta name="assert" content="The ex unit equals the x-height of the first available font if it has reliable metrics for the x-height."> 9 <style> 10 @font-face { 11 font-family: ExTestNoSpace; 12 src: url(resources/ExTest-NoSpace.woff); 13 unicode-range: U+0021-00FF; 14 } 15 div { 16 height: 10px; 17 background-color: blue; 18 margin-top: 10px; 19 font-size: 80px; 20 width: 10ex; 21 } 22 .test { 23 font-family: ExTestNoSpace, Arial, sans-serif; 24 } 25 .ref { 26 font-family: Arial, sans-serif; 27 } 28 </style> 29 <p>The test passes if there are two blue rectangles of equal length.</p> 30 <!-- ExTest is a font whose OS/2 table's sxHeight field is set to an 31 eighth of the font's units per em, but the space character is excluded 32 by unicode-range and therefore it is not valid as "first available font" 33 per CSS Fonts, and must NOT be used as the basis of the 'ex' unit. --> 34 <div class="test"></div> 35 <div class="ref"></div>