mirror of
https://github.com/servo/servo.git
synced 2025-06-14 11:24:33 +00:00
Unfortunately, this required quite a bit of changes to the non-test code. That's because FontContext depends on a FontCacheThread, which in turn depends on a CoreResourceThread and therefore lots of other data structures. It seemed like it would be very difficult to instantiate a FontContext as it was, and even if we could it seems like overkill to have all these data structures present for a relatively focused test. Therefore, I created a FontSource trait which represents the interface which FontContext uses to talk to FontCacheThread. FontCacheThread then implements FontSource. Then, in the test, we can create a dummy implementation of FontSource rather than using FontCacheThread. This actually has the advantage that we can make our dummy implementation behave in certain specific way which are useful for testing, for example it can count the number of times find_font_template() is called, which helps us verify that caching/lazy-loading is working as intended. |
||
---|---|---|
.. | ||
csstest-ascii.ttf | ||
csstest-basic-bold.ttf | ||
csstest-basic-bolditalic.ttf | ||
csstest-basic-italic.ttf | ||
csstest-basic-regular.ttf | ||
csstest-fallback.ttf | ||
csstest-familyname-bold.ttf | ||
csstest-familyname-funkyA.ttf | ||
csstest-familyname-funkyB.ttf | ||
csstest-familyname-funkyC.ttf | ||
csstest-familyname.ttf | ||
csstest-verify.ttf | ||
csstest-weights-15-w1.ttf | ||
csstest-weights-15-w5.ttf | ||
csstest-weights-24-w2.ttf | ||
csstest-weights-24-w4.ttf | ||
csstest-weights-47-w4.ttf | ||
csstest-weights-47-w7.ttf | ||
csstest-weights-100.ttf | ||
csstest-weights-200.ttf | ||
csstest-weights-258-w2.ttf | ||
csstest-weights-258-w5.ttf | ||
csstest-weights-258-w8.ttf | ||
csstest-weights-300.ttf | ||
csstest-weights-400.ttf | ||
csstest-weights-500.ttf | ||
csstest-weights-600.ttf | ||
csstest-weights-700.ttf | ||
csstest-weights-800.ttf | ||
csstest-weights-900.ttf | ||
csstest-weights-1479-w1.ttf | ||
csstest-weights-1479-w4.ttf | ||
csstest-weights-1479-w7.ttf | ||
csstest-weights-1479-w9.ttf | ||
csstest-weights-2569-w2.ttf | ||
csstest-weights-2569-w5.ttf | ||
csstest-weights-2569-w6.ttf | ||
csstest-weights-2569-w9.ttf | ||
csstest-weights-3589-w3.ttf | ||
csstest-weights-3589-w5.ttf | ||
csstest-weights-3589-w8.ttf | ||
csstest-weights-3589-w9.ttf | ||
csstest-weights-full-w1.ttf | ||
csstest-weights-full-w2.ttf | ||
csstest-weights-full-w3.ttf | ||
csstest-weights-full-w4.ttf | ||
csstest-weights-full-w5.ttf | ||
csstest-weights-full-w6.ttf | ||
csstest-weights-full-w7.ttf | ||
csstest-weights-full-w8.ttf | ||
csstest-weights-full-w9.ttf | ||
csstest-weights.ttf | ||
LICENSE | ||
README |
These fonts are a copy of the CSSTest fonts in web-platform-tests, so that we can use them for unit-testing our font code. Here is the README from web-platform-tests: ----- These fonts were created to support the testing of the font features in CSS, and are required to run some of the tests for those features. The fonts are modified versions of Gentium Basic, licensed by SIL under the Open Font License which allows modifications as long as the terms of the license are met. The original fonts were used to create the family 'CSSTest Basic'. This family has four faces and can be used for testing bold / italics. A subsetted version of this font with only glyphs for basic ASCII characters is 'CSSTest ASCII'. This was used to make the other variations. Most of the modications are to the name table and character maps, for the most part glyphs were not modified. The fonts are available for download both individually and as a ZIP package below. The files test.html and test.xhtml test that the fonts have been correctly installed.