[subset_test] added NotoSansCJKjp subset to test east-asian-width feature are kept by defailt
This commit is contained in:
parent
5d6e1c750c
commit
7ca97d6d7f
417
Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx
Normal file
417
Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx
Normal file
@ -0,0 +1,417 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont sfntVersion="OTTO" ttLibVersion="4.43">
|
||||
|
||||
<GlyphOrder>
|
||||
<!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
|
||||
<GlyphID id="0" name=".notdef"/>
|
||||
<GlyphID id="1" name="cid01404"/>
|
||||
<GlyphID id="2" name="cid59004"/>
|
||||
</GlyphOrder>
|
||||
|
||||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="2.004"/>
|
||||
<checkSumAdjustment value="0x6e6d05f3"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00000011"/>
|
||||
<unitsPerEm value="1000"/>
|
||||
<created value="Thu Apr 29 16:22:51 2021"/>
|
||||
<modified value="Thu Oct 19 10:07:59 2023"/>
|
||||
<xMin value="34"/>
|
||||
<yMin value="-86"/>
|
||||
<xMax value="966"/>
|
||||
<yMax value="846"/>
|
||||
<macStyle value="00000000 00000000"/>
|
||||
<lowestRecPPEM value="3"/>
|
||||
<fontDirectionHint value="2"/>
|
||||
<indexToLocFormat value="0"/>
|
||||
<glyphDataFormat value="0"/>
|
||||
</head>
|
||||
|
||||
<hhea>
|
||||
<tableVersion value="0x00010000"/>
|
||||
<ascent value="1160"/>
|
||||
<descent value="-288"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceWidthMax value="1000"/>
|
||||
<minLeftSideBearing value="34"/>
|
||||
<minRightSideBearing value="34"/>
|
||||
<xMaxExtent value="966"/>
|
||||
<caretSlopeRise value="1"/>
|
||||
<caretSlopeRun value="0"/>
|
||||
<caretOffset value="0"/>
|
||||
<reserved0 value="0"/>
|
||||
<reserved1 value="0"/>
|
||||
<reserved2 value="0"/>
|
||||
<reserved3 value="0"/>
|
||||
<metricDataFormat value="0"/>
|
||||
<numberOfHMetrics value="1"/>
|
||||
</hhea>
|
||||
|
||||
<maxp>
|
||||
<tableVersion value="0x5000"/>
|
||||
<numGlyphs value="3"/>
|
||||
</maxp>
|
||||
|
||||
<OS_2>
|
||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||
will be recalculated by the compiler -->
|
||||
<version value="3"/>
|
||||
<xAvgCharWidth value="979"/>
|
||||
<usWeightClass value="400"/>
|
||||
<usWidthClass value="5"/>
|
||||
<fsType value="00000000 00000000"/>
|
||||
<ySubscriptXSize value="650"/>
|
||||
<ySubscriptYSize value="600"/>
|
||||
<ySubscriptXOffset value="0"/>
|
||||
<ySubscriptYOffset value="75"/>
|
||||
<ySuperscriptXSize value="650"/>
|
||||
<ySuperscriptYSize value="600"/>
|
||||
<ySuperscriptXOffset value="0"/>
|
||||
<ySuperscriptYOffset value="350"/>
|
||||
<yStrikeoutSize value="50"/>
|
||||
<yStrikeoutPosition value="325"/>
|
||||
<sFamilyClass value="0"/>
|
||||
<panose>
|
||||
<bFamilyType value="2"/>
|
||||
<bSerifStyle value="11"/>
|
||||
<bWeight value="5"/>
|
||||
<bProportion value="0"/>
|
||||
<bContrast value="0"/>
|
||||
<bStrokeVariation value="0"/>
|
||||
<bArmStyle value="0"/>
|
||||
<bLetterForm value="0"/>
|
||||
<bMidline value="0"/>
|
||||
<bXHeight value="0"/>
|
||||
</panose>
|
||||
<ulUnicodeRange1 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange2 value="00000000 00000001 00000000 00000000"/>
|
||||
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
|
||||
<achVendID value="GOOG"/>
|
||||
<fsSelection value="00000000 01000000"/>
|
||||
<usFirstCharIndex value="9001"/>
|
||||
<usLastCharIndex value="12296"/>
|
||||
<sTypoAscender value="880"/>
|
||||
<sTypoDescender value="-120"/>
|
||||
<sTypoLineGap value="0"/>
|
||||
<usWinAscent value="1160"/>
|
||||
<usWinDescent value="288"/>
|
||||
<ulCodePageRange1 value="01100000 00101110 00000001 00000111"/>
|
||||
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<sxHeight value="543"/>
|
||||
<sCapHeight value="733"/>
|
||||
<usDefaultChar value="0"/>
|
||||
<usBreakChar value="32"/>
|
||||
<usMaxContext value="6"/>
|
||||
</OS_2>
|
||||
|
||||
<name>
|
||||
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
|
||||
© 2014-2021 Adobe (http://www.adobe.com/).
|
||||
</namerecord>
|
||||
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
|
||||
Noto Sans CJK JP
|
||||
</namerecord>
|
||||
<namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
|
||||
Regular
|
||||
</namerecord>
|
||||
<namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
|
||||
2.004;GOOG;NotoSansCJKjp-Regular;ADOBE
|
||||
</namerecord>
|
||||
<namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
|
||||
Noto Sans CJK JP
|
||||
</namerecord>
|
||||
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
|
||||
Version 2.004;hotconv 1.0.118;makeotfexe 2.5.65603
|
||||
</namerecord>
|
||||
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
|
||||
NotoSansCJKjp-Regular
|
||||
</namerecord>
|
||||
</name>
|
||||
|
||||
<cmap>
|
||||
<tableVersion version="0"/>
|
||||
<cmap_format_4 platformID="0" platEncID="3" language="0">
|
||||
<map code="0x2329" name="cid01404"/><!-- LEFT-POINTING ANGLE BRACKET -->
|
||||
<map code="0x3008" name="cid01404"/><!-- LEFT ANGLE BRACKET -->
|
||||
</cmap_format_4>
|
||||
<cmap_format_4 platformID="3" platEncID="1" language="0">
|
||||
<map code="0x2329" name="cid01404"/><!-- LEFT-POINTING ANGLE BRACKET -->
|
||||
<map code="0x3008" name="cid01404"/><!-- LEFT ANGLE BRACKET -->
|
||||
</cmap_format_4>
|
||||
</cmap>
|
||||
|
||||
<post>
|
||||
<formatType value="3.0"/>
|
||||
<italicAngle value="0.0"/>
|
||||
<underlinePosition value="-125"/>
|
||||
<underlineThickness value="50"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<minMemType42 value="0"/>
|
||||
<maxMemType42 value="0"/>
|
||||
<minMemType1 value="0"/>
|
||||
<maxMemType1 value="0"/>
|
||||
</post>
|
||||
|
||||
<CFF>
|
||||
<major value="1"/>
|
||||
<minor value="0"/>
|
||||
<CFFFont name="NotoSansCJKjp-Regular">
|
||||
<ROS Registry="Adobe" Order="Identity" Supplement="0"/>
|
||||
<Notice value="Copyright 2014-2021 Adobe (http://www.adobe.com/). Noto is a trademark of Google Inc."/>
|
||||
<FullName value="Noto Sans CJK JP Regular"/>
|
||||
<FamilyName value="Noto Sans CJK JP"/>
|
||||
<Weight value="Regular"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<ItalicAngle value="0"/>
|
||||
<UnderlinePosition value="-150"/>
|
||||
<UnderlineThickness value="50"/>
|
||||
<PaintType value="0"/>
|
||||
<CharstringType value="2"/>
|
||||
<FontMatrix value="0.001 0 0 0.001 0 0"/>
|
||||
<FontBBox value="34 -86 966 846"/>
|
||||
<StrokeWidth value="0"/>
|
||||
<CIDFontVersion value="2.0039999"/>
|
||||
<CIDFontRevision value="0"/>
|
||||
<CIDFontType value="0"/>
|
||||
<CIDCount value="65535"/>
|
||||
<!-- charset is dumped separately as the 'GlyphOrder' element -->
|
||||
<FDSelect format="0"/>
|
||||
<FDArray>
|
||||
<FontDict index="0">
|
||||
<FontName value="NotoSansCJKjp-Regular-Dingbats"/>
|
||||
<Private>
|
||||
<BlueValues value="-1100 -1100 1900 1900"/>
|
||||
<BlueScale value="0.039625"/>
|
||||
<BlueShift value="7"/>
|
||||
<BlueFuzz value="1"/>
|
||||
<StdHW value="66"/>
|
||||
<StdVW value="69"/>
|
||||
<StemSnapH value="32 40 66"/>
|
||||
<StemSnapV value="32 43 69"/>
|
||||
<ForceBold value="0"/>
|
||||
<LanguageGroup value="1"/>
|
||||
<ExpansionFactor value="0.06"/>
|
||||
<initialRandomSeed value="0"/>
|
||||
<defaultWidthX value="1000"/>
|
||||
<nominalWidthX value="107"/>
|
||||
</Private>
|
||||
</FontDict>
|
||||
<FontDict index="1">
|
||||
<FontName value="NotoSansCJKjp-Regular-Generic"/>
|
||||
<Private>
|
||||
<BlueValues value="-250 -250 1100 1100"/>
|
||||
<BlueScale value="0.039625"/>
|
||||
<BlueShift value="7"/>
|
||||
<BlueFuzz value="1"/>
|
||||
<StdHW value="40"/>
|
||||
<StdVW value="40"/>
|
||||
<StemSnapH value="40 120"/>
|
||||
<StemSnapV value="40 120"/>
|
||||
<ForceBold value="0"/>
|
||||
<LanguageGroup value="1"/>
|
||||
<ExpansionFactor value="0.06"/>
|
||||
<initialRandomSeed value="0"/>
|
||||
<defaultWidthX value="1000"/>
|
||||
<nominalWidthX value="107"/>
|
||||
</Private>
|
||||
</FontDict>
|
||||
</FDArray>
|
||||
<CharStrings>
|
||||
<CharString name=".notdef" fdSelectIndex="1">
|
||||
endchar
|
||||
</CharString>
|
||||
<CharString name="cid01404" fdSelectIndex="0">
|
||||
-86 932 hstem
|
||||
588 360 vstem
|
||||
948 -57 rmoveto
|
||||
-280 437 280 437 -63 29 -297 -466 297 -466 rlineto
|
||||
endchar
|
||||
</CharString>
|
||||
<CharString name="cid59004" fdSelectIndex="0">
|
||||
-68 360 hstem
|
||||
34 932 vstem
|
||||
63 -68 rmoveto
|
||||
437 280 437 -280 29 63 -466 297 -466 -297 rlineto
|
||||
endchar
|
||||
</CharString>
|
||||
</CharStrings>
|
||||
</CFFFont>
|
||||
|
||||
<GlobalSubrs>
|
||||
<!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
|
||||
</GlobalSubrs>
|
||||
</CFF>
|
||||
|
||||
<GPOS>
|
||||
<Version value="0x00010000"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=1 -->
|
||||
<ScriptRecord index="0">
|
||||
<ScriptTag value="DFLT"/>
|
||||
<Script>
|
||||
<DefaultLangSys>
|
||||
<ReqFeatureIndex value="65535"/>
|
||||
<!-- FeatureCount=3 -->
|
||||
<FeatureIndex index="0" value="0"/>
|
||||
<FeatureIndex index="1" value="1"/>
|
||||
<FeatureIndex index="2" value="2"/>
|
||||
</DefaultLangSys>
|
||||
<!-- LangSysCount=0 -->
|
||||
</Script>
|
||||
</ScriptRecord>
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=3 -->
|
||||
<FeatureRecord index="0">
|
||||
<FeatureTag value="halt"/>
|
||||
<Feature>
|
||||
<!-- LookupCount=1 -->
|
||||
<LookupListIndex index="0" value="0"/>
|
||||
</Feature>
|
||||
</FeatureRecord>
|
||||
<FeatureRecord index="1">
|
||||
<FeatureTag value="vhal"/>
|
||||
<Feature>
|
||||
<!-- LookupCount=1 -->
|
||||
<LookupListIndex index="0" value="1"/>
|
||||
</Feature>
|
||||
</FeatureRecord>
|
||||
<FeatureRecord index="2">
|
||||
<FeatureTag value="vpal"/>
|
||||
<Feature>
|
||||
<!-- LookupCount=1 -->
|
||||
<LookupListIndex index="0" value="2"/>
|
||||
</Feature>
|
||||
</FeatureRecord>
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=3 -->
|
||||
<Lookup index="0">
|
||||
<LookupType value="1"/>
|
||||
<LookupFlag value="0"/>
|
||||
<!-- SubTableCount=1 -->
|
||||
<SinglePos index="0" Format="1">
|
||||
<Coverage>
|
||||
<Glyph value="cid01404"/>
|
||||
</Coverage>
|
||||
<ValueFormat value="5"/>
|
||||
<Value XPlacement="-500" XAdvance="-500"/>
|
||||
</SinglePos>
|
||||
</Lookup>
|
||||
<Lookup index="1">
|
||||
<LookupType value="1"/>
|
||||
<LookupFlag value="0"/>
|
||||
<!-- SubTableCount=1 -->
|
||||
<SinglePos index="0" Format="1">
|
||||
<Coverage>
|
||||
<Glyph value="cid59004"/>
|
||||
</Coverage>
|
||||
<ValueFormat value="10"/>
|
||||
<Value YPlacement="500" YAdvance="-500"/>
|
||||
</SinglePos>
|
||||
</Lookup>
|
||||
<Lookup index="2">
|
||||
<LookupType value="1"/>
|
||||
<LookupFlag value="0"/>
|
||||
<!-- SubTableCount=1 -->
|
||||
<SinglePos index="0" Format="1">
|
||||
<Coverage>
|
||||
<Glyph value="cid59004"/>
|
||||
</Coverage>
|
||||
<ValueFormat value="10"/>
|
||||
<Value YPlacement="475" YAdvance="-500"/>
|
||||
</SinglePos>
|
||||
</Lookup>
|
||||
</LookupList>
|
||||
</GPOS>
|
||||
|
||||
<GSUB>
|
||||
<Version value="0x00010000"/>
|
||||
<ScriptList>
|
||||
<!-- ScriptCount=1 -->
|
||||
<ScriptRecord index="0">
|
||||
<ScriptTag value="DFLT"/>
|
||||
<Script>
|
||||
<DefaultLangSys>
|
||||
<ReqFeatureIndex value="65535"/>
|
||||
<!-- FeatureCount=2 -->
|
||||
<FeatureIndex index="0" value="0"/>
|
||||
<FeatureIndex index="1" value="1"/>
|
||||
</DefaultLangSys>
|
||||
<!-- LangSysCount=0 -->
|
||||
</Script>
|
||||
</ScriptRecord>
|
||||
</ScriptList>
|
||||
<FeatureList>
|
||||
<!-- FeatureCount=2 -->
|
||||
<FeatureRecord index="0">
|
||||
<FeatureTag value="vert"/>
|
||||
<Feature>
|
||||
<!-- LookupCount=1 -->
|
||||
<LookupListIndex index="0" value="0"/>
|
||||
</Feature>
|
||||
</FeatureRecord>
|
||||
<FeatureRecord index="1">
|
||||
<FeatureTag value="vrt2"/>
|
||||
<Feature>
|
||||
<!-- LookupCount=1 -->
|
||||
<LookupListIndex index="0" value="0"/>
|
||||
</Feature>
|
||||
</FeatureRecord>
|
||||
</FeatureList>
|
||||
<LookupList>
|
||||
<!-- LookupCount=1 -->
|
||||
<Lookup index="0">
|
||||
<LookupType value="1"/>
|
||||
<LookupFlag value="0"/>
|
||||
<!-- SubTableCount=1 -->
|
||||
<SingleSubst index="0">
|
||||
<Substitution in="cid01404" out="cid59004"/>
|
||||
</SingleSubst>
|
||||
</Lookup>
|
||||
</LookupList>
|
||||
</GSUB>
|
||||
|
||||
<VORG>
|
||||
<majorVersion value="1"/>
|
||||
<minorVersion value="0"/>
|
||||
<defaultVertOriginY value="880"/>
|
||||
<numVertOriginYMetrics value="0"/>
|
||||
</VORG>
|
||||
|
||||
<hmtx>
|
||||
<mtx name=".notdef" width="1000" lsb="100"/>
|
||||
<mtx name="cid01404" width="1000" lsb="588"/>
|
||||
<mtx name="cid59004" width="1000" lsb="34"/>
|
||||
</hmtx>
|
||||
|
||||
<vhea>
|
||||
<tableVersion value="0x00011000"/>
|
||||
<ascent value="500"/>
|
||||
<descent value="-500"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceHeightMax value="1000"/>
|
||||
<minTopSideBearing value="34"/>
|
||||
<minBottomSideBearing value="34"/>
|
||||
<yMaxExtent value="966"/>
|
||||
<caretSlopeRise value="0"/>
|
||||
<caretSlopeRun value="1"/>
|
||||
<caretOffset value="0"/>
|
||||
<reserved1 value="0"/>
|
||||
<reserved2 value="0"/>
|
||||
<reserved3 value="0"/>
|
||||
<reserved4 value="0"/>
|
||||
<metricDataFormat value="0"/>
|
||||
<numberOfVMetrics value="1"/>
|
||||
</vhea>
|
||||
|
||||
<vmtx>
|
||||
<mtx name=".notdef" height="1000" tsb="0"/>
|
||||
<mtx name="cid01404" height="1000" tsb="34"/>
|
||||
<mtx name="cid59004" height="1000" tsb="588"/>
|
||||
</vmtx>
|
||||
|
||||
</ttFont>
|
@ -1074,6 +1074,26 @@ class SubsetTest:
|
||||
in caplog.text
|
||||
) ^ ok
|
||||
|
||||
def test_retain_east_asian_spacing_features(self):
|
||||
# This test font contains halt and vhal features, check that
|
||||
# they are retained by default after subsetting.
|
||||
ttx_path = self.getpath("NotoSansCJKjp-Regular.subset.ttx")
|
||||
ttx = pathlib.Path(ttx_path).read_text()
|
||||
assert 'FeatureTag value="halt"' in ttx
|
||||
assert 'FeatureTag value="vhal"' in ttx
|
||||
|
||||
fontpath = self.compile_font(ttx_path, ".otf")
|
||||
subsetpath = self.temp_path(".otf")
|
||||
subset.main(
|
||||
[
|
||||
fontpath,
|
||||
"--unicodes=*",
|
||||
"--output-file=%s" % subsetpath,
|
||||
]
|
||||
)
|
||||
# subset output is the same as the input
|
||||
self.expect_ttx(TTFont(subsetpath), ttx_path)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def featureVarsTestFont():
|
||||
|
Loading…
x
Reference in New Issue
Block a user