descriptor-ranges.html (760B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 4 <style id="dynamicStyles"> 5 </style> 6 7 <div id="testContents" style="columns: 2; font-size: 10px;"> 8 </div> 9 10 <script> 11 /* Create font-family with two faces; the testcase to use the face with the 12 'expectedMatch' descriptor, and not the 'unexpectedMatch'. So any testcase 13 whose text is replaced by Ahem glyphs has failed font-matching. */ 14 function createFontFaceRules(family, descriptor, expectedMatch, unexpectedMatch) { 15 return `@font-face { font-family: ${family}; src: url(../fonts/Chunkfive.otf); ${descriptor}: ${expectedMatch}; }\n` + 16 `@font-face { font-family: ${family}; src: url(../fonts/Ahem.ttf); ${descriptor}: ${unexpectedMatch}; }\n`; 17 } 18 </script> 19 20 <script src="descriptor-ranges.js"></script>