font-size-adjust-012.html (3254B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Test: font-size-adjust property</title> 6 <link rel="match" href="font-size-adjust-012-ref.html"> 7 <link rel="help" href="https://www.w3.org/TR/css-fonts-4/#font-size-adjust-prop"> 8 <meta name="fuzzy" content="maxDifference=0-130;totalPixels=0-350"> 9 <style> 10 @font-face { 11 font-family: 'ahem-ex-500'; 12 src: url('./resources/ahem-ex-500.otf') format('opentype'); 13 } 14 @font-face { 15 font-family: 'ahem-ex-250'; 16 src: url('./resources/ahem-ex-250.otf') format('opentype'); 17 } 18 .wrapper { 19 --primary-font: 'ahem-ex-500'; 20 --secondary-font: 'ahem-ex-250'; 21 } 22 .adjusted { 23 font-size-adjust: 0.5; 24 } 25 .test { 26 font-family: var(--primary-font), var(--secondary-font); 27 font-size: 100px; 28 line-height: 1; 29 color: peru; 30 height: 100px; 31 } 32 .primary-font { 33 font-family: var(--primary-font); 34 } 35 .secondary-font { 36 font-family: var(--secondary-font); 37 } 38 .tall-inline-block { 39 display: inline-block; 40 height: 100px; 41 } 42 .description { 43 font-family: 'Times New Roman'; 44 font-size: 14px; 45 } 46 .main { 47 font-size: 16px; 48 margin-bottom: 8px; 49 } 50 </style> 51 </head> 52 <body> 53 <div class="description main">For this test we are using two fonts. AhemEx500 has a aspect value (xHeight/size) of 0.5 and AhemEx250 an aspect value of 0.25. On both fonts all glyphs used in the tests look like a square but AhemEx500 doesn't contain 'A' (U+0041).</div> 54 <div class="wrapper"> 55 <div class="description">1. Same glyph x in different spans with different fonts. The second one is adjusted with font-size-adjust. They should have the same size for test to pass.</div> 56 <div class="test"> 57 <span class="primary-font">x</span><span class="primary-font adjusted">x</span> 58 </div> 59 </div> 60 <div class="wrapper"> 61 <div class="description"> 62 2. Different glyphs 'x' and 'A' in the same span, with 2 fonts in font-family fallback and <em>without</em> font-size-adjust. The second glyph can't be rendered by primary font so it will individually fallback to the secondary font. Note it is smaller than the first glyph. 63 </div> 64 <div class="test"><span>xA</span></div> 65 </div> 66 <div class="wrapper"> 67 <div class="description"> 68 3. Different glyphs 'x' and 'A' in the same span, with 2 fonts in font-family fallback and <em>with</em> font-size-adjust. The second glyph can't be rendered by primary font so it will individually fallback to the secondary font. Note that now they have the same size. 69 </div> 70 <div class="test"> 71 <!-- We are inserting a tall inline-block here to make the position of the baseline independent of the adjusted glyph since on the ref test we don't use font-size-adjust but font-size --> 72 <span class="adjusted">xA<span class="tall-inline-block"></span></span> 73 </div> 74 </div> 75 </html>