[subset] Add tests for UVS + cmap14 subsetting.
This commit is contained in:
parent
4a38610072
commit
edaab1fa2f
11
Tests/subset/data/cmap14_font1.no_uvs.ttx
Normal file
11
Tests/subset/data/cmap14_font1.no_uvs.ttx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ttFont>
|
||||||
|
|
||||||
|
<cmap>
|
||||||
|
<tableVersion version="0"/>
|
||||||
|
<cmap_format_4 platformID="3" platEncID="1" language="0">
|
||||||
|
<map code="0x4e05" name="g15"/><!-- CJK UNIFIED IDEOGRAPH-4E05 -->
|
||||||
|
</cmap_format_4>
|
||||||
|
</cmap>
|
||||||
|
|
||||||
|
</ttFont>
|
11
Tests/subset/data/cmap14_font1.no_uvs_non_default.ttx
Normal file
11
Tests/subset/data/cmap14_font1.no_uvs_non_default.ttx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ttFont>
|
||||||
|
|
||||||
|
<cmap>
|
||||||
|
<tableVersion version="0"/>
|
||||||
|
<cmap_format_4 platformID="3" platEncID="1" language="0">
|
||||||
|
<map code="0x4e10" name="g20"/><!-- CJK UNIFIED IDEOGRAPH-4E10 -->
|
||||||
|
</cmap_format_4>
|
||||||
|
</cmap>
|
||||||
|
|
||||||
|
</ttFont>
|
1101
Tests/subset/data/cmap14_font1.ttx
Normal file
1101
Tests/subset/data/cmap14_font1.ttx
Normal file
File diff suppressed because it is too large
Load Diff
14
Tests/subset/data/cmap14_font1.uvs.ttx
Normal file
14
Tests/subset/data/cmap14_font1.uvs.ttx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ttFont>
|
||||||
|
|
||||||
|
<cmap>
|
||||||
|
<tableVersion version="0"/>
|
||||||
|
<cmap_format_14 platformID="0" platEncID="5">
|
||||||
|
<map uv="0x4e05" uvs="0xe0100"/>
|
||||||
|
</cmap_format_14>
|
||||||
|
<cmap_format_4 platformID="3" platEncID="1" language="0">
|
||||||
|
<map code="0x4e05" name="g15"/><!-- CJK UNIFIED IDEOGRAPH-4E05 -->
|
||||||
|
</cmap_format_4>
|
||||||
|
</cmap>
|
||||||
|
|
||||||
|
</ttFont>
|
14
Tests/subset/data/cmap14_font1.uvs_non_default.ttx
Normal file
14
Tests/subset/data/cmap14_font1.uvs_non_default.ttx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ttFont>
|
||||||
|
|
||||||
|
<cmap>
|
||||||
|
<tableVersion version="0"/>
|
||||||
|
<cmap_format_14 platformID="0" platEncID="5">
|
||||||
|
<map uv="0x4e10" uvs="0xe0100" name="g25"/>
|
||||||
|
</cmap_format_14>
|
||||||
|
<cmap_format_4 platformID="3" platEncID="1" language="0">
|
||||||
|
<map code="0x4e10" name="g20"/><!-- CJK UNIFIED IDEOGRAPH-4E10 -->
|
||||||
|
</cmap_format_4>
|
||||||
|
</cmap>
|
||||||
|
|
||||||
|
</ttFont>
|
@ -938,6 +938,27 @@ class SubsetTest:
|
|||||||
subsetfont = TTFont(subsetpath)
|
subsetfont = TTFont(subsetpath)
|
||||||
self.expect_ttx(subsetfont, self.getpath("CmapSubsetTest.subset.ttx"), ["cmap"])
|
self.expect_ttx(subsetfont, self.getpath("CmapSubsetTest.subset.ttx"), ["cmap"])
|
||||||
|
|
||||||
|
|
||||||
|
def test_cmap_format14(self):
|
||||||
|
fontpath = self.compile_font(self.getpath("cmap14_font1.ttx"), ".otf")
|
||||||
|
subsetpath = self.temp_path(".otf")
|
||||||
|
|
||||||
|
subset.main([fontpath, "--unicodes=4e05", "--output-file=%s" % subsetpath])
|
||||||
|
subsetfont = TTFont(subsetpath)
|
||||||
|
self.expect_ttx(subsetfont, self.getpath("cmap14_font1.no_uvs.ttx"), ["cmap"])
|
||||||
|
|
||||||
|
subset.main([fontpath, "--unicodes=4e05,e0100", "--output-file=%s" % subsetpath])
|
||||||
|
subsetfont = TTFont(subsetpath)
|
||||||
|
self.expect_ttx(subsetfont, self.getpath("cmap14_font1.uvs.ttx"), ["cmap"])
|
||||||
|
|
||||||
|
subset.main([fontpath, "--unicodes=4e10", "--output-file=%s" % subsetpath])
|
||||||
|
subsetfont = TTFont(subsetpath)
|
||||||
|
self.expect_ttx(subsetfont, self.getpath("cmap14_font1.no_uvs_non_default.ttx"), ["cmap"])
|
||||||
|
|
||||||
|
subset.main([fontpath, "--unicodes=4e10,e0100", "--output-file=%s" % subsetpath])
|
||||||
|
subsetfont = TTFont(subsetpath)
|
||||||
|
self.expect_ttx(subsetfont, self.getpath("cmap14_font1.uvs_non_default.ttx"), ["cmap"])
|
||||||
|
|
||||||
@pytest.mark.parametrize("text, n", [("!", 1), ("#", 2)])
|
@pytest.mark.parametrize("text, n", [("!", 1), ("#", 2)])
|
||||||
def test_GPOS_PairPos_Format2_useClass0(self, text, n):
|
def test_GPOS_PairPos_Format2_useClass0(self, text, n):
|
||||||
# Check two things related to class 0 ('every other glyph'):
|
# Check two things related to class 0 ('every other glyph'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user