mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
bashi@chromium.org | 2416da7 | 2011-08-10 19:24:26 +0000 | [diff] [blame] | 3 | <head> |
| 4 | <style> |
| 5 | @font-face { |
mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 6 | font-family: "FontFeaturesTestOTF"; |
| 7 | src: url("resources/FontWithFeatures.otf") format("opentype"); |
bashi@chromium.org | 2416da7 | 2011-08-10 19:24:26 +0000 | [diff] [blame] | 8 | } |
mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 9 | @font-face { |
| 10 | font-family: "FontFeaturesTestTTF"; |
| 11 | src: url("resources/FontWithFeatures.ttf") format("truetype"); |
bashi@chromium.org | 2416da7 | 2011-08-10 19:24:26 +0000 | [diff] [blame] | 12 | } |
| 13 | </style> |
bashi@chromium.org | 2416da7 | 2011-08-10 19:24:26 +0000 | [diff] [blame] | 14 | </head> |
mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 15 | <body> |
| 16 | This tests that font features are able to be turned on and off as desired. It uses a special font |
| 17 | designed specifically for this purpose. The test passes if you see a sequence of alternating check |
| 18 | marks and X below. |
mmaxfield@apple.com | 7b433ed | 2015-10-12 19:00:47 +0000 | [diff] [blame] | 19 | <div style="font-family: FontFeaturesTestOTF;">AB</div> |
| 20 | <div style="font-family: FontFeaturesTestTTF;">AB</div> |
mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 21 | <div id="insertionPoint"></div> |
| 22 | <div id="insertionPoint2"></div> |
| 23 | <div id="insertionPoint3"></div> |
| 24 | <div id="insertionPoint4"></div> |
| 25 | <script> |
| 26 | var insertionPoint = document.getElementById("insertionPoint"); |
| 27 | var insertionPoint2 = document.getElementById("insertionPoint2"); |
| 28 | var insertionPoint3 = document.getElementById("insertionPoint3"); |
| 29 | var insertionPoint4 = document.getElementById("insertionPoint4"); |
| 30 | function addElement(placeToInsert, familyName, feature, c) { |
| 31 | ["0", "1"].map(function(state) { |
| 32 | var element = document.createElement("span"); |
| 33 | element.textContent = c; |
| 34 | element.style.fontFamily = familyName; |
| 35 | element.style.fontFeatureSettings = '"' + feature + '" ' + state; |
| 36 | placeToInsert.appendChild(element); |
| 37 | }); |
| 38 | placeToInsert.appendChild(document.createTextNode(" ")); |
| 39 | } |
| 40 | |
| 41 | addElement(insertionPoint, "FontFeaturesTestOTF", "liga", "C"); |
| 42 | addElement(insertionPoint, "FontFeaturesTestOTF", "clig", "D"); |
| 43 | addElement(insertionPoint, "FontFeaturesTestOTF", "dlig", "E"); |
| 44 | addElement(insertionPoint, "FontFeaturesTestOTF", "hlig", "F"); |
| 45 | addElement(insertionPoint, "FontFeaturesTestOTF", "calt", "G"); |
| 46 | addElement(insertionPoint, "FontFeaturesTestOTF", "subs", "H"); |
| 47 | addElement(insertionPoint, "FontFeaturesTestOTF", "sups", "I"); |
| 48 | addElement(insertionPoint, "FontFeaturesTestOTF", "smcp", "J"); |
| 49 | addElement(insertionPoint, "FontFeaturesTestOTF", "c2sc", "K"); |
| 50 | addElement(insertionPoint, "FontFeaturesTestOTF", "pcap", "L"); |
| 51 | addElement(insertionPoint, "FontFeaturesTestOTF", "c2pc", "M"); |
| 52 | addElement(insertionPoint, "FontFeaturesTestOTF", "unic", "N"); |
| 53 | addElement(insertionPoint, "FontFeaturesTestOTF", "titl", "O"); |
| 54 | addElement(insertionPoint, "FontFeaturesTestOTF", "lnum", "P"); |
| 55 | addElement(insertionPoint, "FontFeaturesTestOTF", "onum", "Q"); |
| 56 | addElement(insertionPoint, "FontFeaturesTestOTF", "pnum", "R"); |
| 57 | addElement(insertionPoint, "FontFeaturesTestOTF", "tnum", "S"); |
| 58 | addElement(insertionPoint, "FontFeaturesTestOTF", "frac", "T"); |
| 59 | //addElement(insertionPoint, "FontFeaturesTestOTF", "afrc", "U"); |
| 60 | addElement(insertionPoint, "FontFeaturesTestOTF", "ordn", "V"); |
| 61 | addElement(insertionPoint, "FontFeaturesTestOTF", "zero", "W"); |
| 62 | addElement(insertionPoint, "FontFeaturesTestOTF", "hist", "X"); |
| 63 | addElement(insertionPoint, "FontFeaturesTestOTF", "jp78", "Y"); |
| 64 | addElement(insertionPoint, "FontFeaturesTestOTF", "jp83", "Z"); |
| 65 | addElement(insertionPoint, "FontFeaturesTestOTF", "jp90", "a"); |
| 66 | addElement(insertionPoint, "FontFeaturesTestOTF", "jp04", "b"); |
| 67 | addElement(insertionPoint, "FontFeaturesTestOTF", "smpl", "c"); |
| 68 | addElement(insertionPoint, "FontFeaturesTestOTF", "trad", "d"); |
| 69 | addElement(insertionPoint, "FontFeaturesTestOTF", "fwid", "e"); |
| 70 | addElement(insertionPoint, "FontFeaturesTestOTF", "pwid", "f"); |
| 71 | addElement(insertionPoint, "FontFeaturesTestOTF", "ruby", "g"); |
| 72 | |
| 73 | addElement(insertionPoint2, "FontFeaturesTestTTF", "liga", "C"); |
| 74 | addElement(insertionPoint2, "FontFeaturesTestTTF", "liga", "D"); |
| 75 | addElement(insertionPoint2, "FontFeaturesTestTTF", "clig", "C"); |
| 76 | addElement(insertionPoint2, "FontFeaturesTestTTF", "clig", "D"); |
| 77 | addElement(insertionPoint2, "FontFeaturesTestTTF", "dlig", "G"); |
| 78 | addElement(insertionPoint2, "FontFeaturesTestTTF", "hlig", "I"); |
| 79 | addElement(insertionPoint2, "FontFeaturesTestTTF", "calt", "L"); |
| 80 | addElement(insertionPoint2, "FontFeaturesTestTTF", "subs", "O"); |
| 81 | addElement(insertionPoint2, "FontFeaturesTestTTF", "sups", "P"); |
| 82 | addElement(insertionPoint2, "FontFeaturesTestTTF", "smcp", "S"); |
| 83 | addElement(insertionPoint2, "FontFeaturesTestTTF", "c2sc", "V"); |
| 84 | addElement(insertionPoint2, "FontFeaturesTestTTF", "pcap", "T"); |
| 85 | addElement(insertionPoint2, "FontFeaturesTestTTF", "c2pc", "W"); |
| 86 | addElement(insertionPoint2, "FontFeaturesTestTTF", "unic", "Y"); |
| 87 | addElement(insertionPoint2, "FontFeaturesTestTTF", "titl", "a"); |
| 88 | addElement(insertionPoint2, "FontFeaturesTestTTF", "lnum", "c"); |
| 89 | addElement(insertionPoint2, "FontFeaturesTestTTF", "onum", "d"); |
| 90 | addElement(insertionPoint2, "FontFeaturesTestTTF", "pnum", "f"); |
| 91 | addElement(insertionPoint2, "FontFeaturesTestTTF", "tnum", "g"); |
| 92 | addElement(insertionPoint2, "FontFeaturesTestTTF", "frac", "i"); |
| 93 | addElement(insertionPoint2, "FontFeaturesTestTTF", "afrc", "j"); |
| 94 | addElement(insertionPoint2, "FontFeaturesTestTTF", "ordn", "Q"); |
| 95 | addElement(insertionPoint2, "FontFeaturesTestTTF", "zero", "k"); |
| 96 | addElement(insertionPoint2, "FontFeaturesTestTTF", "hist", "K"); |
| 97 | addElement(insertionPoint2, "FontFeaturesTestTTF", "jp78", "m"); |
| 98 | addElement(insertionPoint2, "FontFeaturesTestTTF", "jp83", "n"); |
| 99 | addElement(insertionPoint2, "FontFeaturesTestTTF", "jp90", "o"); |
| 100 | addElement(insertionPoint2, "FontFeaturesTestTTF", "jp04", "p"); |
| 101 | addElement(insertionPoint2, "FontFeaturesTestTTF", "smpl", "q"); |
| 102 | addElement(insertionPoint2, "FontFeaturesTestTTF", "trad", "r"); |
| 103 | addElement(insertionPoint2, "FontFeaturesTestTTF", "fwid", "t"); |
| 104 | addElement(insertionPoint2, "FontFeaturesTestTTF", "pwid", "u"); |
| 105 | addElement(insertionPoint2, "FontFeaturesTestTTF", "ruby", "v"); |
| 106 | |
| 107 | addElement(insertionPoint3, "FontWithFeaturesOTF", "liga", "C"); |
| 108 | addElement(insertionPoint3, "FontWithFeaturesOTF", "clig", "D"); |
| 109 | addElement(insertionPoint3, "FontWithFeaturesOTF", "dlig", "E"); |
| 110 | addElement(insertionPoint3, "FontWithFeaturesOTF", "hlig", "F"); |
| 111 | addElement(insertionPoint3, "FontWithFeaturesOTF", "calt", "G"); |
| 112 | addElement(insertionPoint3, "FontWithFeaturesOTF", "subs", "H"); |
| 113 | addElement(insertionPoint3, "FontWithFeaturesOTF", "sups", "I"); |
| 114 | addElement(insertionPoint3, "FontWithFeaturesOTF", "smcp", "J"); |
| 115 | addElement(insertionPoint3, "FontWithFeaturesOTF", "c2sc", "K"); |
| 116 | addElement(insertionPoint3, "FontWithFeaturesOTF", "pcap", "L"); |
| 117 | addElement(insertionPoint3, "FontWithFeaturesOTF", "c2pc", "M"); |
| 118 | addElement(insertionPoint3, "FontWithFeaturesOTF", "unic", "N"); |
| 119 | addElement(insertionPoint3, "FontWithFeaturesOTF", "titl", "O"); |
| 120 | addElement(insertionPoint3, "FontWithFeaturesOTF", "lnum", "P"); |
| 121 | addElement(insertionPoint3, "FontWithFeaturesOTF", "onum", "Q"); |
| 122 | addElement(insertionPoint3, "FontWithFeaturesOTF", "pnum", "R"); |
| 123 | addElement(insertionPoint3, "FontWithFeaturesOTF", "tnum", "S"); |
| 124 | addElement(insertionPoint3, "FontWithFeaturesOTF", "frac", "T"); |
| 125 | //addElement(insertionPoint3, "FontWithFeaturesOTF", "afrc", "U"); |
| 126 | addElement(insertionPoint3, "FontWithFeaturesOTF", "ordn", "V"); |
| 127 | addElement(insertionPoint3, "FontWithFeaturesOTF", "zero", "W"); |
| 128 | addElement(insertionPoint3, "FontWithFeaturesOTF", "hist", "X"); |
| 129 | addElement(insertionPoint3, "FontWithFeaturesOTF", "jp78", "Y"); |
| 130 | addElement(insertionPoint3, "FontWithFeaturesOTF", "jp83", "Z"); |
| 131 | addElement(insertionPoint3, "FontWithFeaturesOTF", "jp90", "a"); |
| 132 | addElement(insertionPoint3, "FontWithFeaturesOTF", "jp04", "b"); |
| 133 | addElement(insertionPoint3, "FontWithFeaturesOTF", "smpl", "c"); |
| 134 | addElement(insertionPoint3, "FontWithFeaturesOTF", "trad", "d"); |
| 135 | addElement(insertionPoint3, "FontWithFeaturesOTF", "fwid", "e"); |
| 136 | addElement(insertionPoint3, "FontWithFeaturesOTF", "pwid", "f"); |
| 137 | addElement(insertionPoint3, "FontWithFeaturesOTF", "ruby", "g"); |
| 138 | |
| 139 | addElement(insertionPoint4, "FontWithFeaturesTTF", "liga", "C"); |
| 140 | addElement(insertionPoint4, "FontWithFeaturesTTF", "liga", "D"); |
| 141 | addElement(insertionPoint4, "FontWithFeaturesTTF", "clig", "C"); |
| 142 | addElement(insertionPoint4, "FontWithFeaturesTTF", "clig", "D"); |
| 143 | addElement(insertionPoint4, "FontWithFeaturesTTF", "dlig", "G"); |
| 144 | addElement(insertionPoint4, "FontWithFeaturesTTF", "hlig", "I"); |
| 145 | addElement(insertionPoint4, "FontWithFeaturesTTF", "calt", "L"); |
| 146 | addElement(insertionPoint4, "FontWithFeaturesTTF", "subs", "O"); |
| 147 | addElement(insertionPoint4, "FontWithFeaturesTTF", "sups", "P"); |
| 148 | addElement(insertionPoint4, "FontWithFeaturesTTF", "smcp", "S"); |
| 149 | addElement(insertionPoint4, "FontWithFeaturesTTF", "c2sc", "V"); |
| 150 | addElement(insertionPoint4, "FontWithFeaturesTTF", "pcap", "T"); |
| 151 | addElement(insertionPoint4, "FontWithFeaturesTTF", "c2pc", "W"); |
| 152 | addElement(insertionPoint4, "FontWithFeaturesTTF", "unic", "Y"); |
| 153 | addElement(insertionPoint4, "FontWithFeaturesTTF", "titl", "a"); |
| 154 | addElement(insertionPoint4, "FontWithFeaturesTTF", "lnum", "c"); |
| 155 | addElement(insertionPoint4, "FontWithFeaturesTTF", "onum", "d"); |
| 156 | addElement(insertionPoint4, "FontWithFeaturesTTF", "pnum", "f"); |
| 157 | addElement(insertionPoint4, "FontWithFeaturesTTF", "tnum", "g"); |
| 158 | addElement(insertionPoint4, "FontWithFeaturesTTF", "frac", "i"); |
| 159 | addElement(insertionPoint4, "FontWithFeaturesTTF", "afrc", "j"); |
| 160 | addElement(insertionPoint4, "FontWithFeaturesTTF", "ordn", "Q"); |
| 161 | addElement(insertionPoint4, "FontWithFeaturesTTF", "zero", "k"); |
| 162 | addElement(insertionPoint4, "FontWithFeaturesTTF", "hist", "K"); |
| 163 | addElement(insertionPoint4, "FontWithFeaturesTTF", "jp78", "m"); |
| 164 | addElement(insertionPoint4, "FontWithFeaturesTTF", "jp83", "n"); |
| 165 | addElement(insertionPoint4, "FontWithFeaturesTTF", "jp90", "o"); |
| 166 | addElement(insertionPoint4, "FontWithFeaturesTTF", "jp04", "p"); |
| 167 | addElement(insertionPoint4, "FontWithFeaturesTTF", "smpl", "q"); |
| 168 | addElement(insertionPoint4, "FontWithFeaturesTTF", "trad", "r"); |
| 169 | addElement(insertionPoint4, "FontWithFeaturesTTF", "fwid", "t"); |
| 170 | addElement(insertionPoint4, "FontWithFeaturesTTF", "pwid", "u"); |
| 171 | addElement(insertionPoint4, "FontWithFeaturesTTF", "ruby", "v"); |
| 172 | </script> |
bashi@chromium.org | 2416da7 | 2011-08-10 19:24:26 +0000 | [diff] [blame] | 173 | </body> |
mmaxfield@apple.com | b0a19ce | 2015-10-11 20:23:26 +0000 | [diff] [blame] | 174 | </html> |