summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-fonts/variations/font-opentype-collections.html
blob: 1b403b32462b1b5a395da5f4cebcef8113c50d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
    <title>Testing support for OpenType collections in @font-face rules</title>
    <link rel="help" href="https://www.w3.org/TR/css-fonts-4/#src-desc" />
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <style>
      @font-face {
          font-family: OpenType;
          src: url(/fonts/Ahem.ttf);
      }

      @font-face {
          font-family: OpenType-Collection;
          src: url(./resources/ahem.ttc);
        }
    </style>
</head>
<body onload="test()">
    <div id="opentype" style="display:inline-block; font-family:OpenType,Georgia;">Test</div><br>
    <div id="collection" style="display:inline-block; font-family:OpenType-Collection,Verdana;">Test</div>
    <script>

        var opentypeElement = document.getElementById("opentype");
        var collectionElement = document.getElementById("collection");

        var loadTest = async_test("Verify that collection font is loaded");

        function test() {
            if (opentypeElement.offsetWidth == collectionElement.offsetWidth) {
                loadTest.done();
            }
            else {
                window.requestAnimationFrame(test);
            }
        }

    </script>
</body>
</html>