[AAT] Implement subsetting of baseline table
This commit is contained in:
parent
16a4001901
commit
307d0d4c57
@ -1675,6 +1675,30 @@ def subset_glyphs(self, s):
|
||||
self.hdmx = {sz:_dict_subset(l, s.glyphs) for sz,l in self.hdmx.items()}
|
||||
return bool(self.hdmx)
|
||||
|
||||
@_add_method(ttLib.getTableClass('bsln'))
|
||||
def closure_glyphs(self, s):
|
||||
table = self.table.Baseline
|
||||
if table.Format in (2, 3):
|
||||
s.glyphs.add(table.StandardGlyph)
|
||||
|
||||
@_add_method(ttLib.getTableClass('bsln'))
|
||||
def subset_glyphs(self, s):
|
||||
table = self.table.Baseline
|
||||
if table.Format in (1, 3):
|
||||
baselines = {glyph: table.BaselineValues.get(glyph, table.DefaultBaseline)
|
||||
for glyph in s.glyphs}
|
||||
if len(baselines) > 0:
|
||||
mostCommon, _cnt = Counter(baselines.values()).most_common(1)[0]
|
||||
table.DefaultBaseline = mostCommon
|
||||
baselines = {glyph: b for glyph, b in baselines.items()
|
||||
if b != mostCommon}
|
||||
if len(baselines) > 0:
|
||||
table.BaselineValues = baselines
|
||||
else:
|
||||
table.Format = {1: 0, 3: 2}[table.Format]
|
||||
del table.BaselineValues
|
||||
return True
|
||||
|
||||
@_add_method(ttLib.getTableClass('lcar'))
|
||||
def subset_glyphs(self, s):
|
||||
table = self.table.LigatureCarets
|
||||
@ -2797,17 +2821,17 @@ class Subsetter(object):
|
||||
log.glyphs(self.glyphs, font=font)
|
||||
self.glyphs_mathed = frozenset(self.glyphs)
|
||||
|
||||
if 'COLR' in font:
|
||||
with timer("close glyph list over 'COLR'"):
|
||||
log.info("Closing glyph list over 'COLR': %d glyphs before",
|
||||
len(self.glyphs))
|
||||
log.glyphs(self.glyphs, font=font)
|
||||
font['COLR'].closure_glyphs(self)
|
||||
self.glyphs.intersection_update(realGlyphs)
|
||||
log.info("Closed glyph list over 'COLR': %d glyphs after",
|
||||
len(self.glyphs))
|
||||
log.glyphs(self.glyphs, font=font)
|
||||
self.glyphs_colred = frozenset(self.glyphs)
|
||||
for table in ('COLR', 'bsln'):
|
||||
if table in font:
|
||||
with timer("close glyph list over '%s'" % table):
|
||||
log.info("Closing glyph list over '%s': %d glyphs before",
|
||||
table, len(self.glyphs))
|
||||
log.glyphs(self.glyphs, font=font)
|
||||
font[table].closure_glyphs(self)
|
||||
self.glyphs.intersection_update(realGlyphs)
|
||||
log.info("Closed glyph list over '%s': %d glyphs after",
|
||||
table, len(self.glyphs))
|
||||
log.glyphs(self.glyphs, font=font)
|
||||
|
||||
if 'glyf' in font:
|
||||
with timer("close glyph list over 'glyf'"):
|
||||
|
342
Tests/subset/data/TestBSLN-0.ttx
Normal file
342
Tests/subset/data/TestBSLN-0.ttx
Normal file
@ -0,0 +1,342 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.0">
|
||||
|
||||
<GlyphOrder>
|
||||
<GlyphID id="0" name=".notdef"/>
|
||||
<GlyphID id="1" name="space"/>
|
||||
<GlyphID id="2" name="zero"/>
|
||||
<GlyphID id="3" name="one"/>
|
||||
<GlyphID id="4" name="two"/>
|
||||
<GlyphID id="5" name="three"/>
|
||||
</GlyphOrder>
|
||||
|
||||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="1.0"/>
|
||||
<checkSumAdjustment value="0xf1c8c54f"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00000011"/>
|
||||
<unitsPerEm value="1000"/>
|
||||
<created value="Thu Mar 31 07:56:22 2016"/>
|
||||
<modified value="Thu Mar 31 11:16:24 2016"/>
|
||||
<xMin value="40"/>
|
||||
<yMin value="-10"/>
|
||||
<xMax value="620"/>
|
||||
<yMax value="710"/>
|
||||
<macStyle value="00000000 00000000"/>
|
||||
<lowestRecPPEM value="7"/>
|
||||
<fontDirectionHint value="2"/>
|
||||
<indexToLocFormat value="0"/>
|
||||
<glyphDataFormat value="0"/>
|
||||
</head>
|
||||
|
||||
<hhea>
|
||||
<tableVersion value="0x00010000"/>
|
||||
<ascent value="1000"/>
|
||||
<descent value="-200"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceWidthMax value="700"/>
|
||||
<minLeftSideBearing value="40"/>
|
||||
<minRightSideBearing value="40"/>
|
||||
<xMaxExtent value="620"/>
|
||||
<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="4"/>
|
||||
</hhea>
|
||||
|
||||
<maxp>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="0x10000"/>
|
||||
<numGlyphs value="6"/>
|
||||
<maxPoints value="32"/>
|
||||
<maxContours value="2"/>
|
||||
<maxCompositePoints value="0"/>
|
||||
<maxCompositeContours value="0"/>
|
||||
<maxZones value="1"/>
|
||||
<maxTwilightPoints value="0"/>
|
||||
<maxStorage value="0"/>
|
||||
<maxFunctionDefs value="1"/>
|
||||
<maxInstructionDefs value="0"/>
|
||||
<maxStackElements value="0"/>
|
||||
<maxSizeOfInstructions value="0"/>
|
||||
<maxComponentElements value="0"/>
|
||||
<maxComponentDepth value="0"/>
|
||||
</maxp>
|
||||
|
||||
<OS_2>
|
||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||
will be recalculated by the compiler -->
|
||||
<version value="3"/>
|
||||
<xAvgCharWidth value="606"/>
|
||||
<usWeightClass value="400"/>
|
||||
<usWidthClass value="5"/>
|
||||
<fsType value="00000000 00001000"/>
|
||||
<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="300"/>
|
||||
<sFamilyClass value="0"/>
|
||||
<panose>
|
||||
<bFamilyType value="0"/>
|
||||
<bSerifStyle value="0"/>
|
||||
<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 00000001"/>
|
||||
<ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
|
||||
<achVendID value="UKWN"/>
|
||||
<fsSelection value="00000000 01000000"/>
|
||||
<usFirstCharIndex value="32"/>
|
||||
<usLastCharIndex value="8722"/>
|
||||
<sTypoAscender value="800"/>
|
||||
<sTypoDescender value="-200"/>
|
||||
<sTypoLineGap value="200"/>
|
||||
<usWinAscent value="1000"/>
|
||||
<usWinDescent value="200"/>
|
||||
<ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
|
||||
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<sxHeight value="500"/>
|
||||
<sCapHeight value="700"/>
|
||||
<usDefaultChar value="0"/>
|
||||
<usBreakChar value="32"/>
|
||||
<usMaxContext value="0"/>
|
||||
</OS_2>
|
||||
|
||||
<hmtx>
|
||||
<mtx name=".notdef" width="700" lsb="80"/>
|
||||
<mtx name="space" width="700" lsb="0"/>
|
||||
<mtx name="zero" width="625" lsb="40"/>
|
||||
<mtx name="one" width="660" lsb="80"/>
|
||||
<mtx name="two" width="660" lsb="80"/>
|
||||
<mtx name="three" width="660" lsb="80"/>
|
||||
</hmtx>
|
||||
|
||||
<cmap>
|
||||
<tableVersion version="0"/>
|
||||
<cmap_format_4 platformID="0" platEncID="3" language="0">
|
||||
<map code="0x20" name="space"/>
|
||||
<map code="0x30" name="zero"/>
|
||||
<map code="0x31" name="one"/>
|
||||
<map code="0x32" name="two"/>
|
||||
<map code="0x33" name="three"/>
|
||||
</cmap_format_4>
|
||||
</cmap>
|
||||
|
||||
<loca>
|
||||
<!-- The 'loca' table will be calculated by the compiler -->
|
||||
</loca>
|
||||
|
||||
<glyf>
|
||||
|
||||
<!-- The xMin, yMin, xMax and yMax values
|
||||
will be recalculated by the compiler. -->
|
||||
|
||||
<TTGlyph name=".notdef" xMin="80" yMin="0" xMax="620" yMax="700">
|
||||
<contour>
|
||||
<pt x="620" y="700" on="1"/>
|
||||
<pt x="620" y="0" on="1"/>
|
||||
<pt x="80" y="0" on="1"/>
|
||||
<pt x="80" y="700" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="160" y="80" on="1"/>
|
||||
<pt x="540" y="80" on="1"/>
|
||||
<pt x="540" y="620" on="1"/>
|
||||
<pt x="160" y="620" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="one" xMin="80" yMin="230" xMax="580" yMax="490">
|
||||
<contour>
|
||||
<pt x="580" y="490" on="1"/>
|
||||
<pt x="580" y="410" on="1"/>
|
||||
<pt x="80" y="410" on="1"/>
|
||||
<pt x="80" y="490" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="580" y="230" on="1"/>
|
||||
<pt x="80" y="230" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="two" xMin="80" yMin="310" xMax="580" yMax="390">
|
||||
<contour>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="three" xMin="80" yMin="100" xMax="580" yMax="600">
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="370" y="310" on="1"/>
|
||||
<pt x="370" y="100" on="1"/>
|
||||
<pt x="290" y="100" on="1"/>
|
||||
<pt x="290" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
<pt x="290" y="390" on="1"/>
|
||||
<pt x="290" y="600" on="1"/>
|
||||
<pt x="370" y="600" on="1"/>
|
||||
<pt x="370" y="390" on="1"/>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="space"/><!-- contains no outline data -->
|
||||
|
||||
<TTGlyph name="zero" xMin="40" yMin="-10" xMax="585" yMax="710">
|
||||
<contour>
|
||||
<pt x="237" y="-10" on="0"/>
|
||||
<pt x="113" y="78" on="0"/>
|
||||
<pt x="40" y="241" on="0"/>
|
||||
<pt x="40" y="350" on="1"/>
|
||||
<pt x="40" y="459" on="0"/>
|
||||
<pt x="113" y="622" on="0"/>
|
||||
<pt x="237" y="710" on="0"/>
|
||||
<pt x="313" y="710" on="1"/>
|
||||
<pt x="388" y="710" on="0"/>
|
||||
<pt x="513" y="622" on="0"/>
|
||||
<pt x="585" y="459" on="0"/>
|
||||
<pt x="585" y="350" on="1"/>
|
||||
<pt x="585" y="241" on="0"/>
|
||||
<pt x="513" y="78" on="0"/>
|
||||
<pt x="388" y="-10" on="0"/>
|
||||
<pt x="313" y="-10" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="366" y="74" on="0"/>
|
||||
<pt x="454" y="144" on="0"/>
|
||||
<pt x="505" y="270" on="0"/>
|
||||
<pt x="505" y="350" on="1"/>
|
||||
<pt x="505" y="430" on="0"/>
|
||||
<pt x="454" y="556" on="0"/>
|
||||
<pt x="366" y="626" on="0"/>
|
||||
<pt x="313" y="626" on="1"/>
|
||||
<pt x="260" y="626" on="0"/>
|
||||
<pt x="171" y="556" on="0"/>
|
||||
<pt x="120" y="430" on="0"/>
|
||||
<pt x="120" y="350" on="1"/>
|
||||
<pt x="120" y="270" on="0"/>
|
||||
<pt x="171" y="144" on="0"/>
|
||||
<pt x="260" y="74" on="0"/>
|
||||
<pt x="313" y="74" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
</glyf>
|
||||
|
||||
<name>
|
||||
<namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
TestBSLN-0
|
||||
</namerecord>
|
||||
<namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
Regular
|
||||
</namerecord>
|
||||
</name>
|
||||
|
||||
<gasp>
|
||||
<gaspRange rangeMaxPPEM="7" rangeGaspBehavior="10"/>
|
||||
<gaspRange rangeMaxPPEM="19" rangeGaspBehavior="7"/>
|
||||
<gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
|
||||
</gasp>
|
||||
|
||||
<post>
|
||||
<formatType value="2.0"/>
|
||||
<italicAngle value="0.0"/>
|
||||
<underlinePosition value="-75"/>
|
||||
<underlineThickness value="50"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<minMemType42 value="0"/>
|
||||
<maxMemType42 value="0"/>
|
||||
<minMemType1 value="0"/>
|
||||
<maxMemType1 value="0"/>
|
||||
<psNames>
|
||||
<!-- This file uses unique glyph names based on the information
|
||||
found in the 'post' table. Since these names might not be unique,
|
||||
we have to invent artificial names in case of clashes. In order to
|
||||
be able to retain the original information, we need a name to
|
||||
ps name mapping for those cases where they differ. That's what
|
||||
you see below.
|
||||
-->
|
||||
</psNames>
|
||||
<extraNames>
|
||||
<!-- following are the name that are not taken from the standard Mac glyph order -->
|
||||
</extraNames>
|
||||
</post>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="0">
|
||||
<DefaultBaseline value="0"/>
|
||||
<Delta index="0" value="0"/>
|
||||
<Delta index="1" value="465"/>
|
||||
<Delta index="2" value="0"/>
|
||||
<Delta index="3" value="1345"/>
|
||||
<Delta index="4" value="507"/>
|
||||
<Delta index="5" value="0"/>
|
||||
<Delta index="6" value="0"/>
|
||||
<Delta index="7" value="0"/>
|
||||
<Delta index="8" value="0"/>
|
||||
<Delta index="9" value="0"/>
|
||||
<Delta index="10" value="0"/>
|
||||
<Delta index="11" value="0"/>
|
||||
<Delta index="12" value="0"/>
|
||||
<Delta index="13" value="0"/>
|
||||
<Delta index="14" value="0"/>
|
||||
<Delta index="15" value="0"/>
|
||||
<Delta index="16" value="0"/>
|
||||
<Delta index="17" value="0"/>
|
||||
<Delta index="18" value="0"/>
|
||||
<Delta index="19" value="0"/>
|
||||
<Delta index="20" value="0"/>
|
||||
<Delta index="21" value="0"/>
|
||||
<Delta index="22" value="0"/>
|
||||
<Delta index="23" value="0"/>
|
||||
<Delta index="24" value="0"/>
|
||||
<Delta index="25" value="0"/>
|
||||
<Delta index="26" value="0"/>
|
||||
<Delta index="27" value="0"/>
|
||||
<Delta index="28" value="0"/>
|
||||
<Delta index="29" value="0"/>
|
||||
<Delta index="30" value="0"/>
|
||||
<Delta index="31" value="0"/>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
348
Tests/subset/data/TestBSLN-1.ttx
Normal file
348
Tests/subset/data/TestBSLN-1.ttx
Normal file
@ -0,0 +1,348 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.0">
|
||||
|
||||
<GlyphOrder>
|
||||
<GlyphID id="0" name=".notdef"/>
|
||||
<GlyphID id="1" name="space"/>
|
||||
<GlyphID id="2" name="zero"/>
|
||||
<GlyphID id="3" name="one"/>
|
||||
<GlyphID id="4" name="two"/>
|
||||
<GlyphID id="5" name="uni2EA2"/>
|
||||
</GlyphOrder>
|
||||
|
||||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="1.0"/>
|
||||
<checkSumAdjustment value="0xf1c8c54f"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00000011"/>
|
||||
<unitsPerEm value="1000"/>
|
||||
<created value="Thu Mar 31 07:56:22 2016"/>
|
||||
<modified value="Thu Mar 31 11:16:24 2016"/>
|
||||
<xMin value="40"/>
|
||||
<yMin value="-10"/>
|
||||
<xMax value="620"/>
|
||||
<yMax value="710"/>
|
||||
<macStyle value="00000000 00000000"/>
|
||||
<lowestRecPPEM value="7"/>
|
||||
<fontDirectionHint value="2"/>
|
||||
<indexToLocFormat value="0"/>
|
||||
<glyphDataFormat value="0"/>
|
||||
</head>
|
||||
|
||||
<hhea>
|
||||
<tableVersion value="0x00010000"/>
|
||||
<ascent value="1000"/>
|
||||
<descent value="-200"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceWidthMax value="700"/>
|
||||
<minLeftSideBearing value="40"/>
|
||||
<minRightSideBearing value="40"/>
|
||||
<xMaxExtent value="620"/>
|
||||
<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="4"/>
|
||||
</hhea>
|
||||
|
||||
<maxp>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="0x10000"/>
|
||||
<numGlyphs value="6"/>
|
||||
<maxPoints value="32"/>
|
||||
<maxContours value="2"/>
|
||||
<maxCompositePoints value="0"/>
|
||||
<maxCompositeContours value="0"/>
|
||||
<maxZones value="1"/>
|
||||
<maxTwilightPoints value="0"/>
|
||||
<maxStorage value="0"/>
|
||||
<maxFunctionDefs value="1"/>
|
||||
<maxInstructionDefs value="0"/>
|
||||
<maxStackElements value="0"/>
|
||||
<maxSizeOfInstructions value="0"/>
|
||||
<maxComponentElements value="0"/>
|
||||
<maxComponentDepth value="0"/>
|
||||
</maxp>
|
||||
|
||||
<OS_2>
|
||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||
will be recalculated by the compiler -->
|
||||
<version value="3"/>
|
||||
<xAvgCharWidth value="606"/>
|
||||
<usWeightClass value="400"/>
|
||||
<usWidthClass value="5"/>
|
||||
<fsType value="00000000 00001000"/>
|
||||
<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="300"/>
|
||||
<sFamilyClass value="0"/>
|
||||
<panose>
|
||||
<bFamilyType value="0"/>
|
||||
<bSerifStyle value="0"/>
|
||||
<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 00000001"/>
|
||||
<ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
|
||||
<achVendID value="UKWN"/>
|
||||
<fsSelection value="00000000 01000000"/>
|
||||
<usFirstCharIndex value="32"/>
|
||||
<usLastCharIndex value="8722"/>
|
||||
<sTypoAscender value="800"/>
|
||||
<sTypoDescender value="-200"/>
|
||||
<sTypoLineGap value="200"/>
|
||||
<usWinAscent value="1000"/>
|
||||
<usWinDescent value="200"/>
|
||||
<ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
|
||||
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<sxHeight value="500"/>
|
||||
<sCapHeight value="700"/>
|
||||
<usDefaultChar value="0"/>
|
||||
<usBreakChar value="32"/>
|
||||
<usMaxContext value="0"/>
|
||||
</OS_2>
|
||||
|
||||
<hmtx>
|
||||
<mtx name=".notdef" width="700" lsb="80"/>
|
||||
<mtx name="space" width="700" lsb="0"/>
|
||||
<mtx name="zero" width="625" lsb="40"/>
|
||||
<mtx name="one" width="660" lsb="80"/>
|
||||
<mtx name="two" width="660" lsb="80"/>
|
||||
<mtx name="uni2EA2" width="660" lsb="80"/>
|
||||
</hmtx>
|
||||
|
||||
<cmap>
|
||||
<tableVersion version="0"/>
|
||||
<cmap_format_4 platformID="0" platEncID="3" language="0">
|
||||
<map code="0x20" name="space"/>
|
||||
<map code="0x30" name="zero"/>
|
||||
<map code="0x31" name="one"/>
|
||||
<map code="0x32" name="two"/>
|
||||
<map code="0x2EA2" name="uni2EA2"/>
|
||||
</cmap_format_4>
|
||||
</cmap>
|
||||
|
||||
<loca>
|
||||
<!-- The 'loca' table will be calculated by the compiler -->
|
||||
</loca>
|
||||
|
||||
<glyf>
|
||||
|
||||
<!-- The xMin, yMin, xMax and yMax values
|
||||
will be recalculated by the compiler. -->
|
||||
|
||||
<TTGlyph name=".notdef" xMin="80" yMin="0" xMax="620" yMax="700">
|
||||
<contour>
|
||||
<pt x="620" y="700" on="1"/>
|
||||
<pt x="620" y="0" on="1"/>
|
||||
<pt x="80" y="0" on="1"/>
|
||||
<pt x="80" y="700" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="160" y="80" on="1"/>
|
||||
<pt x="540" y="80" on="1"/>
|
||||
<pt x="540" y="620" on="1"/>
|
||||
<pt x="160" y="620" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="one" xMin="80" yMin="230" xMax="580" yMax="490">
|
||||
<contour>
|
||||
<pt x="580" y="490" on="1"/>
|
||||
<pt x="580" y="410" on="1"/>
|
||||
<pt x="80" y="410" on="1"/>
|
||||
<pt x="80" y="490" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="580" y="230" on="1"/>
|
||||
<pt x="80" y="230" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="two" xMin="80" yMin="310" xMax="580" yMax="390">
|
||||
<contour>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="uni2EA2" xMin="80" yMin="100" xMax="580" yMax="600">
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="370" y="310" on="1"/>
|
||||
<pt x="370" y="100" on="1"/>
|
||||
<pt x="290" y="100" on="1"/>
|
||||
<pt x="290" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
<pt x="290" y="390" on="1"/>
|
||||
<pt x="290" y="600" on="1"/>
|
||||
<pt x="370" y="600" on="1"/>
|
||||
<pt x="370" y="390" on="1"/>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="space"/><!-- contains no outline data -->
|
||||
|
||||
<TTGlyph name="zero" xMin="40" yMin="-10" xMax="585" yMax="710">
|
||||
<contour>
|
||||
<pt x="237" y="-10" on="0"/>
|
||||
<pt x="113" y="78" on="0"/>
|
||||
<pt x="40" y="241" on="0"/>
|
||||
<pt x="40" y="350" on="1"/>
|
||||
<pt x="40" y="459" on="0"/>
|
||||
<pt x="113" y="622" on="0"/>
|
||||
<pt x="237" y="710" on="0"/>
|
||||
<pt x="313" y="710" on="1"/>
|
||||
<pt x="388" y="710" on="0"/>
|
||||
<pt x="513" y="622" on="0"/>
|
||||
<pt x="585" y="459" on="0"/>
|
||||
<pt x="585" y="350" on="1"/>
|
||||
<pt x="585" y="241" on="0"/>
|
||||
<pt x="513" y="78" on="0"/>
|
||||
<pt x="388" y="-10" on="0"/>
|
||||
<pt x="313" y="-10" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="366" y="74" on="0"/>
|
||||
<pt x="454" y="144" on="0"/>
|
||||
<pt x="505" y="270" on="0"/>
|
||||
<pt x="505" y="350" on="1"/>
|
||||
<pt x="505" y="430" on="0"/>
|
||||
<pt x="454" y="556" on="0"/>
|
||||
<pt x="366" y="626" on="0"/>
|
||||
<pt x="313" y="626" on="1"/>
|
||||
<pt x="260" y="626" on="0"/>
|
||||
<pt x="171" y="556" on="0"/>
|
||||
<pt x="120" y="430" on="0"/>
|
||||
<pt x="120" y="350" on="1"/>
|
||||
<pt x="120" y="270" on="0"/>
|
||||
<pt x="171" y="144" on="0"/>
|
||||
<pt x="260" y="74" on="0"/>
|
||||
<pt x="313" y="74" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
</glyf>
|
||||
|
||||
<name>
|
||||
<namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
TestBSLN-1
|
||||
</namerecord>
|
||||
<namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
Regular
|
||||
</namerecord>
|
||||
</name>
|
||||
|
||||
<gasp>
|
||||
<gaspRange rangeMaxPPEM="7" rangeGaspBehavior="10"/>
|
||||
<gaspRange rangeMaxPPEM="19" rangeGaspBehavior="7"/>
|
||||
<gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
|
||||
</gasp>
|
||||
|
||||
<post>
|
||||
<formatType value="2.0"/>
|
||||
<italicAngle value="0.0"/>
|
||||
<underlinePosition value="-75"/>
|
||||
<underlineThickness value="50"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<minMemType42 value="0"/>
|
||||
<maxMemType42 value="0"/>
|
||||
<minMemType1 value="0"/>
|
||||
<maxMemType1 value="0"/>
|
||||
<psNames>
|
||||
<!-- This file uses unique glyph names based on the information
|
||||
found in the 'post' table. Since these names might not be unique,
|
||||
we have to invent artificial names in case of clashes. In order to
|
||||
be able to retain the original information, we need a name to
|
||||
ps name mapping for those cases where they differ. That's what
|
||||
you see below.
|
||||
-->
|
||||
</psNames>
|
||||
<extraNames>
|
||||
<!-- following are the name that are not taken from the standard Mac glyph order -->
|
||||
</extraNames>
|
||||
</post>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="1">
|
||||
<DefaultBaseline value="1"/>
|
||||
<Delta index="0" value="0"/>
|
||||
<Delta index="1" value="465"/>
|
||||
<Delta index="2" value="0"/>
|
||||
<Delta index="3" value="1345"/>
|
||||
<Delta index="4" value="507"/>
|
||||
<Delta index="5" value="0"/>
|
||||
<Delta index="6" value="0"/>
|
||||
<Delta index="7" value="0"/>
|
||||
<Delta index="8" value="0"/>
|
||||
<Delta index="9" value="0"/>
|
||||
<Delta index="10" value="0"/>
|
||||
<Delta index="11" value="0"/>
|
||||
<Delta index="12" value="0"/>
|
||||
<Delta index="13" value="0"/>
|
||||
<Delta index="14" value="0"/>
|
||||
<Delta index="15" value="0"/>
|
||||
<Delta index="16" value="0"/>
|
||||
<Delta index="17" value="0"/>
|
||||
<Delta index="18" value="0"/>
|
||||
<Delta index="19" value="0"/>
|
||||
<Delta index="20" value="0"/>
|
||||
<Delta index="21" value="0"/>
|
||||
<Delta index="22" value="0"/>
|
||||
<Delta index="23" value="0"/>
|
||||
<Delta index="24" value="0"/>
|
||||
<Delta index="25" value="0"/>
|
||||
<Delta index="26" value="0"/>
|
||||
<Delta index="27" value="0"/>
|
||||
<Delta index="28" value="0"/>
|
||||
<Delta index="29" value="0"/>
|
||||
<Delta index="30" value="0"/>
|
||||
<Delta index="31" value="0"/>
|
||||
<BaselineValues>
|
||||
<Lookup glyph=".notdef" value="0"/>
|
||||
<Lookup glyph="zero" value="0"/>
|
||||
<Lookup glyph="one" value="0"/>
|
||||
<Lookup glyph="two" value="0"/>
|
||||
</BaselineValues>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
342
Tests/subset/data/TestBSLN-2.ttx
Normal file
342
Tests/subset/data/TestBSLN-2.ttx
Normal file
@ -0,0 +1,342 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.0">
|
||||
|
||||
<GlyphOrder>
|
||||
<GlyphID id="0" name=".notdef"/>
|
||||
<GlyphID id="1" name="space"/>
|
||||
<GlyphID id="2" name="zero"/>
|
||||
<GlyphID id="3" name="one"/>
|
||||
<GlyphID id="4" name="two"/>
|
||||
<GlyphID id="5" name="P"/>
|
||||
</GlyphOrder>
|
||||
|
||||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="1.0"/>
|
||||
<checkSumAdjustment value="0xf1c8c54f"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00000011"/>
|
||||
<unitsPerEm value="1000"/>
|
||||
<created value="Thu Mar 31 07:56:22 2016"/>
|
||||
<modified value="Thu Mar 31 11:16:24 2016"/>
|
||||
<xMin value="40"/>
|
||||
<yMin value="-10"/>
|
||||
<xMax value="620"/>
|
||||
<yMax value="710"/>
|
||||
<macStyle value="00000000 00000000"/>
|
||||
<lowestRecPPEM value="7"/>
|
||||
<fontDirectionHint value="2"/>
|
||||
<indexToLocFormat value="0"/>
|
||||
<glyphDataFormat value="0"/>
|
||||
</head>
|
||||
|
||||
<hhea>
|
||||
<tableVersion value="0x00010000"/>
|
||||
<ascent value="1000"/>
|
||||
<descent value="-200"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceWidthMax value="700"/>
|
||||
<minLeftSideBearing value="40"/>
|
||||
<minRightSideBearing value="40"/>
|
||||
<xMaxExtent value="620"/>
|
||||
<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="4"/>
|
||||
</hhea>
|
||||
|
||||
<maxp>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="0x10000"/>
|
||||
<numGlyphs value="6"/>
|
||||
<maxPoints value="32"/>
|
||||
<maxContours value="2"/>
|
||||
<maxCompositePoints value="0"/>
|
||||
<maxCompositeContours value="0"/>
|
||||
<maxZones value="1"/>
|
||||
<maxTwilightPoints value="0"/>
|
||||
<maxStorage value="0"/>
|
||||
<maxFunctionDefs value="1"/>
|
||||
<maxInstructionDefs value="0"/>
|
||||
<maxStackElements value="0"/>
|
||||
<maxSizeOfInstructions value="0"/>
|
||||
<maxComponentElements value="0"/>
|
||||
<maxComponentDepth value="0"/>
|
||||
</maxp>
|
||||
|
||||
<OS_2>
|
||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||
will be recalculated by the compiler -->
|
||||
<version value="3"/>
|
||||
<xAvgCharWidth value="606"/>
|
||||
<usWeightClass value="400"/>
|
||||
<usWidthClass value="5"/>
|
||||
<fsType value="00000000 00001000"/>
|
||||
<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="300"/>
|
||||
<sFamilyClass value="0"/>
|
||||
<panose>
|
||||
<bFamilyType value="0"/>
|
||||
<bSerifStyle value="0"/>
|
||||
<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 00000001"/>
|
||||
<ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
|
||||
<achVendID value="UKWN"/>
|
||||
<fsSelection value="00000000 01000000"/>
|
||||
<usFirstCharIndex value="32"/>
|
||||
<usLastCharIndex value="8722"/>
|
||||
<sTypoAscender value="800"/>
|
||||
<sTypoDescender value="-200"/>
|
||||
<sTypoLineGap value="200"/>
|
||||
<usWinAscent value="1000"/>
|
||||
<usWinDescent value="200"/>
|
||||
<ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
|
||||
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<sxHeight value="500"/>
|
||||
<sCapHeight value="700"/>
|
||||
<usDefaultChar value="0"/>
|
||||
<usBreakChar value="32"/>
|
||||
<usMaxContext value="0"/>
|
||||
</OS_2>
|
||||
|
||||
<hmtx>
|
||||
<mtx name=".notdef" width="700" lsb="80"/>
|
||||
<mtx name="space" width="700" lsb="0"/>
|
||||
<mtx name="zero" width="625" lsb="40"/>
|
||||
<mtx name="one" width="660" lsb="80"/>
|
||||
<mtx name="two" width="660" lsb="80"/>
|
||||
<mtx name="P" width="660" lsb="80"/>
|
||||
</hmtx>
|
||||
|
||||
<cmap>
|
||||
<tableVersion version="0"/>
|
||||
<cmap_format_4 platformID="0" platEncID="3" language="0">
|
||||
<map code="0x20" name="space"/>
|
||||
<map code="0x30" name="zero"/>
|
||||
<map code="0x31" name="one"/>
|
||||
<map code="0x32" name="two"/>
|
||||
</cmap_format_4>
|
||||
</cmap>
|
||||
|
||||
<loca>
|
||||
<!-- The 'loca' table will be calculated by the compiler -->
|
||||
</loca>
|
||||
|
||||
<glyf>
|
||||
|
||||
<!-- The xMin, yMin, xMax and yMax values
|
||||
will be recalculated by the compiler. -->
|
||||
|
||||
<TTGlyph name=".notdef" xMin="80" yMin="0" xMax="620" yMax="700">
|
||||
<contour>
|
||||
<pt x="620" y="700" on="1"/>
|
||||
<pt x="620" y="0" on="1"/>
|
||||
<pt x="80" y="0" on="1"/>
|
||||
<pt x="80" y="700" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="160" y="80" on="1"/>
|
||||
<pt x="540" y="80" on="1"/>
|
||||
<pt x="540" y="620" on="1"/>
|
||||
<pt x="160" y="620" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="one" xMin="80" yMin="230" xMax="580" yMax="490">
|
||||
<contour>
|
||||
<pt x="580" y="490" on="1"/>
|
||||
<pt x="580" y="410" on="1"/>
|
||||
<pt x="80" y="410" on="1"/>
|
||||
<pt x="80" y="490" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="580" y="230" on="1"/>
|
||||
<pt x="80" y="230" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="two" xMin="80" yMin="310" xMax="580" yMax="390">
|
||||
<contour>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="P" xMin="80" yMin="100" xMax="580" yMax="600">
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="370" y="310" on="1"/>
|
||||
<pt x="370" y="100" on="1"/>
|
||||
<pt x="290" y="100" on="1"/>
|
||||
<pt x="290" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
<pt x="290" y="390" on="1"/>
|
||||
<pt x="290" y="600" on="1"/>
|
||||
<pt x="370" y="600" on="1"/>
|
||||
<pt x="370" y="390" on="1"/>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="space"/><!-- contains no outline data -->
|
||||
|
||||
<TTGlyph name="zero" xMin="40" yMin="-10" xMax="585" yMax="710">
|
||||
<contour>
|
||||
<pt x="237" y="-10" on="0"/>
|
||||
<pt x="113" y="78" on="0"/>
|
||||
<pt x="40" y="241" on="0"/>
|
||||
<pt x="40" y="350" on="1"/>
|
||||
<pt x="40" y="459" on="0"/>
|
||||
<pt x="113" y="622" on="0"/>
|
||||
<pt x="237" y="710" on="0"/>
|
||||
<pt x="313" y="710" on="1"/>
|
||||
<pt x="388" y="710" on="0"/>
|
||||
<pt x="513" y="622" on="0"/>
|
||||
<pt x="585" y="459" on="0"/>
|
||||
<pt x="585" y="350" on="1"/>
|
||||
<pt x="585" y="241" on="0"/>
|
||||
<pt x="513" y="78" on="0"/>
|
||||
<pt x="388" y="-10" on="0"/>
|
||||
<pt x="313" y="-10" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="366" y="74" on="0"/>
|
||||
<pt x="454" y="144" on="0"/>
|
||||
<pt x="505" y="270" on="0"/>
|
||||
<pt x="505" y="350" on="1"/>
|
||||
<pt x="505" y="430" on="0"/>
|
||||
<pt x="454" y="556" on="0"/>
|
||||
<pt x="366" y="626" on="0"/>
|
||||
<pt x="313" y="626" on="1"/>
|
||||
<pt x="260" y="626" on="0"/>
|
||||
<pt x="171" y="556" on="0"/>
|
||||
<pt x="120" y="430" on="0"/>
|
||||
<pt x="120" y="350" on="1"/>
|
||||
<pt x="120" y="270" on="0"/>
|
||||
<pt x="171" y="144" on="0"/>
|
||||
<pt x="260" y="74" on="0"/>
|
||||
<pt x="313" y="74" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
</glyf>
|
||||
|
||||
<name>
|
||||
<namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
TestBSLN-2
|
||||
</namerecord>
|
||||
<namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
Regular
|
||||
</namerecord>
|
||||
</name>
|
||||
|
||||
<gasp>
|
||||
<gaspRange rangeMaxPPEM="7" rangeGaspBehavior="10"/>
|
||||
<gaspRange rangeMaxPPEM="19" rangeGaspBehavior="7"/>
|
||||
<gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
|
||||
</gasp>
|
||||
|
||||
<post>
|
||||
<formatType value="2.0"/>
|
||||
<italicAngle value="0.0"/>
|
||||
<underlinePosition value="-75"/>
|
||||
<underlineThickness value="50"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<minMemType42 value="0"/>
|
||||
<maxMemType42 value="0"/>
|
||||
<minMemType1 value="0"/>
|
||||
<maxMemType1 value="0"/>
|
||||
<psNames>
|
||||
<!-- This file uses unique glyph names based on the information
|
||||
found in the 'post' table. Since these names might not be unique,
|
||||
we have to invent artificial names in case of clashes. In order to
|
||||
be able to retain the original information, we need a name to
|
||||
ps name mapping for those cases where they differ. That's what
|
||||
you see below.
|
||||
-->
|
||||
</psNames>
|
||||
<extraNames>
|
||||
<!-- following are the name that are not taken from the standard Mac glyph order -->
|
||||
</extraNames>
|
||||
</post>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="2">
|
||||
<DefaultBaseline value="0"/>
|
||||
<StandardGlyph value="P"/>
|
||||
<ControlPoint index="0" value="7"/>
|
||||
<ControlPoint index="1" value="8"/>
|
||||
<ControlPoint index="2" value="9"/>
|
||||
<ControlPoint index="3" value="10"/>
|
||||
<ControlPoint index="4" value="11"/>
|
||||
<ControlPoint index="5" value="65535"/>
|
||||
<ControlPoint index="6" value="65535"/>
|
||||
<ControlPoint index="7" value="65535"/>
|
||||
<ControlPoint index="8" value="65535"/>
|
||||
<ControlPoint index="9" value="65535"/>
|
||||
<ControlPoint index="10" value="65535"/>
|
||||
<ControlPoint index="11" value="65535"/>
|
||||
<ControlPoint index="12" value="65535"/>
|
||||
<ControlPoint index="13" value="65535"/>
|
||||
<ControlPoint index="14" value="65535"/>
|
||||
<ControlPoint index="15" value="65535"/>
|
||||
<ControlPoint index="16" value="65535"/>
|
||||
<ControlPoint index="17" value="65535"/>
|
||||
<ControlPoint index="18" value="65535"/>
|
||||
<ControlPoint index="19" value="65535"/>
|
||||
<ControlPoint index="20" value="65535"/>
|
||||
<ControlPoint index="21" value="65535"/>
|
||||
<ControlPoint index="22" value="65535"/>
|
||||
<ControlPoint index="23" value="65535"/>
|
||||
<ControlPoint index="24" value="65535"/>
|
||||
<ControlPoint index="25" value="65535"/>
|
||||
<ControlPoint index="26" value="65535"/>
|
||||
<ControlPoint index="27" value="65535"/>
|
||||
<ControlPoint index="28" value="65535"/>
|
||||
<ControlPoint index="29" value="65535"/>
|
||||
<ControlPoint index="30" value="65535"/>
|
||||
<ControlPoint index="31" value="65535"/>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
363
Tests/subset/data/TestBSLN-3.ttx
Normal file
363
Tests/subset/data/TestBSLN-3.ttx
Normal file
@ -0,0 +1,363 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.0">
|
||||
|
||||
<GlyphOrder>
|
||||
<GlyphID id="0" name=".notdef"/>
|
||||
<GlyphID id="1" name="space"/>
|
||||
<GlyphID id="2" name="zero"/>
|
||||
<GlyphID id="3" name="one"/>
|
||||
<GlyphID id="4" name="two"/>
|
||||
<GlyphID id="5" name="P"/>
|
||||
<GlyphID id="6" name="uni2EA2"/>
|
||||
</GlyphOrder>
|
||||
|
||||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="1.0"/>
|
||||
<checkSumAdjustment value="0xf1c8c54f"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00000011"/>
|
||||
<unitsPerEm value="1000"/>
|
||||
<created value="Thu Mar 31 07:56:22 2016"/>
|
||||
<modified value="Thu Mar 31 11:16:24 2016"/>
|
||||
<xMin value="40"/>
|
||||
<yMin value="-10"/>
|
||||
<xMax value="620"/>
|
||||
<yMax value="710"/>
|
||||
<macStyle value="00000000 00000000"/>
|
||||
<lowestRecPPEM value="7"/>
|
||||
<fontDirectionHint value="2"/>
|
||||
<indexToLocFormat value="0"/>
|
||||
<glyphDataFormat value="0"/>
|
||||
</head>
|
||||
|
||||
<hhea>
|
||||
<tableVersion value="0x00010000"/>
|
||||
<ascent value="1000"/>
|
||||
<descent value="-200"/>
|
||||
<lineGap value="0"/>
|
||||
<advanceWidthMax value="700"/>
|
||||
<minLeftSideBearing value="40"/>
|
||||
<minRightSideBearing value="40"/>
|
||||
<xMaxExtent value="620"/>
|
||||
<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="4"/>
|
||||
</hhea>
|
||||
|
||||
<maxp>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="0x10000"/>
|
||||
<numGlyphs value="6"/>
|
||||
<maxPoints value="32"/>
|
||||
<maxContours value="2"/>
|
||||
<maxCompositePoints value="0"/>
|
||||
<maxCompositeContours value="0"/>
|
||||
<maxZones value="1"/>
|
||||
<maxTwilightPoints value="0"/>
|
||||
<maxStorage value="0"/>
|
||||
<maxFunctionDefs value="1"/>
|
||||
<maxInstructionDefs value="0"/>
|
||||
<maxStackElements value="0"/>
|
||||
<maxSizeOfInstructions value="0"/>
|
||||
<maxComponentElements value="0"/>
|
||||
<maxComponentDepth value="0"/>
|
||||
</maxp>
|
||||
|
||||
<OS_2>
|
||||
<!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
|
||||
will be recalculated by the compiler -->
|
||||
<version value="3"/>
|
||||
<xAvgCharWidth value="606"/>
|
||||
<usWeightClass value="400"/>
|
||||
<usWidthClass value="5"/>
|
||||
<fsType value="00000000 00001000"/>
|
||||
<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="300"/>
|
||||
<sFamilyClass value="0"/>
|
||||
<panose>
|
||||
<bFamilyType value="0"/>
|
||||
<bSerifStyle value="0"/>
|
||||
<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 00000001"/>
|
||||
<ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
|
||||
<ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
|
||||
<achVendID value="UKWN"/>
|
||||
<fsSelection value="00000000 01000000"/>
|
||||
<usFirstCharIndex value="32"/>
|
||||
<usLastCharIndex value="8722"/>
|
||||
<sTypoAscender value="800"/>
|
||||
<sTypoDescender value="-200"/>
|
||||
<sTypoLineGap value="200"/>
|
||||
<usWinAscent value="1000"/>
|
||||
<usWinDescent value="200"/>
|
||||
<ulCodePageRange1 value="00000000 00000000 00000000 00000001"/>
|
||||
<ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
|
||||
<sxHeight value="500"/>
|
||||
<sCapHeight value="700"/>
|
||||
<usDefaultChar value="0"/>
|
||||
<usBreakChar value="32"/>
|
||||
<usMaxContext value="0"/>
|
||||
</OS_2>
|
||||
|
||||
<hmtx>
|
||||
<mtx name=".notdef" width="700" lsb="80"/>
|
||||
<mtx name="space" width="700" lsb="0"/>
|
||||
<mtx name="zero" width="625" lsb="40"/>
|
||||
<mtx name="one" width="660" lsb="80"/>
|
||||
<mtx name="two" width="660" lsb="80"/>
|
||||
<mtx name="P" width="660" lsb="80"/>
|
||||
<mtx name="uni2EA2" width="660" lsb="80"/>
|
||||
</hmtx>
|
||||
|
||||
<cmap>
|
||||
<tableVersion version="0"/>
|
||||
<cmap_format_4 platformID="0" platEncID="3" language="0">
|
||||
<map code="0x20" name="space"/>
|
||||
<map code="0x30" name="zero"/>
|
||||
<map code="0x31" name="one"/>
|
||||
<map code="0x32" name="two"/>
|
||||
<map code="0x2EA2" name="uni2EA2"/>
|
||||
</cmap_format_4>
|
||||
</cmap>
|
||||
|
||||
<loca>
|
||||
<!-- The 'loca' table will be calculated by the compiler -->
|
||||
</loca>
|
||||
|
||||
<glyf>
|
||||
|
||||
<!-- The xMin, yMin, xMax and yMax values
|
||||
will be recalculated by the compiler. -->
|
||||
|
||||
<TTGlyph name=".notdef" xMin="80" yMin="0" xMax="620" yMax="700">
|
||||
<contour>
|
||||
<pt x="620" y="700" on="1"/>
|
||||
<pt x="620" y="0" on="1"/>
|
||||
<pt x="80" y="0" on="1"/>
|
||||
<pt x="80" y="700" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="160" y="80" on="1"/>
|
||||
<pt x="540" y="80" on="1"/>
|
||||
<pt x="540" y="620" on="1"/>
|
||||
<pt x="160" y="620" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="one" xMin="80" yMin="230" xMax="580" yMax="490">
|
||||
<contour>
|
||||
<pt x="580" y="490" on="1"/>
|
||||
<pt x="580" y="410" on="1"/>
|
||||
<pt x="80" y="410" on="1"/>
|
||||
<pt x="80" y="490" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="580" y="230" on="1"/>
|
||||
<pt x="80" y="230" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="two" xMin="80" yMin="310" xMax="580" yMax="390">
|
||||
<contour>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="P" xMin="80" yMin="100" xMax="580" yMax="600">
|
||||
<contour>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="370" y="310" on="1"/>
|
||||
<pt x="370" y="100" on="1"/>
|
||||
<pt x="290" y="100" on="1"/>
|
||||
<pt x="290" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
<pt x="290" y="390" on="1"/>
|
||||
<pt x="290" y="600" on="1"/>
|
||||
<pt x="370" y="600" on="1"/>
|
||||
<pt x="370" y="390" on="1"/>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="space"/><!-- contains no outline data -->
|
||||
|
||||
<TTGlyph name="uni2EA2" xMin="80" yMin="310" xMax="580" yMax="390">
|
||||
<contour>
|
||||
<pt x="580" y="390" on="1"/>
|
||||
<pt x="580" y="310" on="1"/>
|
||||
<pt x="80" y="310" on="1"/>
|
||||
<pt x="80" y="390" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
<TTGlyph name="zero" xMin="40" yMin="-10" xMax="585" yMax="710">
|
||||
<contour>
|
||||
<pt x="237" y="-10" on="0"/>
|
||||
<pt x="113" y="78" on="0"/>
|
||||
<pt x="40" y="241" on="0"/>
|
||||
<pt x="40" y="350" on="1"/>
|
||||
<pt x="40" y="459" on="0"/>
|
||||
<pt x="113" y="622" on="0"/>
|
||||
<pt x="237" y="710" on="0"/>
|
||||
<pt x="313" y="710" on="1"/>
|
||||
<pt x="388" y="710" on="0"/>
|
||||
<pt x="513" y="622" on="0"/>
|
||||
<pt x="585" y="459" on="0"/>
|
||||
<pt x="585" y="350" on="1"/>
|
||||
<pt x="585" y="241" on="0"/>
|
||||
<pt x="513" y="78" on="0"/>
|
||||
<pt x="388" y="-10" on="0"/>
|
||||
<pt x="313" y="-10" on="1"/>
|
||||
</contour>
|
||||
<contour>
|
||||
<pt x="366" y="74" on="0"/>
|
||||
<pt x="454" y="144" on="0"/>
|
||||
<pt x="505" y="270" on="0"/>
|
||||
<pt x="505" y="350" on="1"/>
|
||||
<pt x="505" y="430" on="0"/>
|
||||
<pt x="454" y="556" on="0"/>
|
||||
<pt x="366" y="626" on="0"/>
|
||||
<pt x="313" y="626" on="1"/>
|
||||
<pt x="260" y="626" on="0"/>
|
||||
<pt x="171" y="556" on="0"/>
|
||||
<pt x="120" y="430" on="0"/>
|
||||
<pt x="120" y="350" on="1"/>
|
||||
<pt x="120" y="270" on="0"/>
|
||||
<pt x="171" y="144" on="0"/>
|
||||
<pt x="260" y="74" on="0"/>
|
||||
<pt x="313" y="74" on="1"/>
|
||||
</contour>
|
||||
<instructions><assembly>
|
||||
</assembly></instructions>
|
||||
</TTGlyph>
|
||||
|
||||
</glyf>
|
||||
|
||||
<name>
|
||||
<namerecord nameID="1" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
TestBSLN-3
|
||||
</namerecord>
|
||||
<namerecord nameID="2" platformID="1" platEncID="0" langID="0x0" unicode="True">
|
||||
Regular
|
||||
</namerecord>
|
||||
</name>
|
||||
|
||||
<gasp>
|
||||
<gaspRange rangeMaxPPEM="7" rangeGaspBehavior="10"/>
|
||||
<gaspRange rangeMaxPPEM="19" rangeGaspBehavior="7"/>
|
||||
<gaspRange rangeMaxPPEM="65535" rangeGaspBehavior="15"/>
|
||||
</gasp>
|
||||
|
||||
<post>
|
||||
<formatType value="2.0"/>
|
||||
<italicAngle value="0.0"/>
|
||||
<underlinePosition value="-75"/>
|
||||
<underlineThickness value="50"/>
|
||||
<isFixedPitch value="0"/>
|
||||
<minMemType42 value="0"/>
|
||||
<maxMemType42 value="0"/>
|
||||
<minMemType1 value="0"/>
|
||||
<maxMemType1 value="0"/>
|
||||
<psNames>
|
||||
<!-- This file uses unique glyph names based on the information
|
||||
found in the 'post' table. Since these names might not be unique,
|
||||
we have to invent artificial names in case of clashes. In order to
|
||||
be able to retain the original information, we need a name to
|
||||
ps name mapping for those cases where they differ. That's what
|
||||
you see below.
|
||||
-->
|
||||
</psNames>
|
||||
<extraNames>
|
||||
<!-- following are the name that are not taken from the standard Mac glyph order -->
|
||||
</extraNames>
|
||||
</post>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="3">
|
||||
<DefaultBaseline value="1"/>
|
||||
<StandardGlyph value="P"/>
|
||||
<ControlPoint index="0" value="7"/>
|
||||
<ControlPoint index="1" value="8"/>
|
||||
<ControlPoint index="2" value="9"/>
|
||||
<ControlPoint index="3" value="10"/>
|
||||
<ControlPoint index="4" value="11"/>
|
||||
<ControlPoint index="5" value="65535"/>
|
||||
<ControlPoint index="6" value="65535"/>
|
||||
<ControlPoint index="7" value="65535"/>
|
||||
<ControlPoint index="8" value="65535"/>
|
||||
<ControlPoint index="9" value="65535"/>
|
||||
<ControlPoint index="10" value="65535"/>
|
||||
<ControlPoint index="11" value="65535"/>
|
||||
<ControlPoint index="12" value="65535"/>
|
||||
<ControlPoint index="13" value="65535"/>
|
||||
<ControlPoint index="14" value="65535"/>
|
||||
<ControlPoint index="15" value="65535"/>
|
||||
<ControlPoint index="16" value="65535"/>
|
||||
<ControlPoint index="17" value="65535"/>
|
||||
<ControlPoint index="18" value="65535"/>
|
||||
<ControlPoint index="19" value="65535"/>
|
||||
<ControlPoint index="20" value="65535"/>
|
||||
<ControlPoint index="21" value="65535"/>
|
||||
<ControlPoint index="22" value="65535"/>
|
||||
<ControlPoint index="23" value="65535"/>
|
||||
<ControlPoint index="24" value="65535"/>
|
||||
<ControlPoint index="25" value="65535"/>
|
||||
<ControlPoint index="26" value="65535"/>
|
||||
<ControlPoint index="27" value="65535"/>
|
||||
<ControlPoint index="28" value="65535"/>
|
||||
<ControlPoint index="29" value="65535"/>
|
||||
<ControlPoint index="30" value="65535"/>
|
||||
<ControlPoint index="31" value="65535"/>
|
||||
<BaselineValues>
|
||||
<Lookup glyph=".notdef" value="0"/>
|
||||
<Lookup glyph="zero" value="0"/>
|
||||
<Lookup glyph="one" value="0"/>
|
||||
<Lookup glyph="two" value="0"/>
|
||||
<Lookup glyph="P" value="0"/>
|
||||
</BaselineValues>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
43
Tests/subset/data/expect_bsln_0.ttx
Normal file
43
Tests/subset/data/expect_bsln_0.ttx
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="0">
|
||||
<DefaultBaseline value="0"/>
|
||||
<Delta index="0" value="0"/>
|
||||
<Delta index="1" value="465"/>
|
||||
<Delta index="2" value="0"/>
|
||||
<Delta index="3" value="1345"/>
|
||||
<Delta index="4" value="507"/>
|
||||
<Delta index="5" value="0"/>
|
||||
<Delta index="6" value="0"/>
|
||||
<Delta index="7" value="0"/>
|
||||
<Delta index="8" value="0"/>
|
||||
<Delta index="9" value="0"/>
|
||||
<Delta index="10" value="0"/>
|
||||
<Delta index="11" value="0"/>
|
||||
<Delta index="12" value="0"/>
|
||||
<Delta index="13" value="0"/>
|
||||
<Delta index="14" value="0"/>
|
||||
<Delta index="15" value="0"/>
|
||||
<Delta index="16" value="0"/>
|
||||
<Delta index="17" value="0"/>
|
||||
<Delta index="18" value="0"/>
|
||||
<Delta index="19" value="0"/>
|
||||
<Delta index="20" value="0"/>
|
||||
<Delta index="21" value="0"/>
|
||||
<Delta index="22" value="0"/>
|
||||
<Delta index="23" value="0"/>
|
||||
<Delta index="24" value="0"/>
|
||||
<Delta index="25" value="0"/>
|
||||
<Delta index="26" value="0"/>
|
||||
<Delta index="27" value="0"/>
|
||||
<Delta index="28" value="0"/>
|
||||
<Delta index="29" value="0"/>
|
||||
<Delta index="30" value="0"/>
|
||||
<Delta index="31" value="0"/>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
46
Tests/subset/data/expect_bsln_1.ttx
Normal file
46
Tests/subset/data/expect_bsln_1.ttx
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="1">
|
||||
<DefaultBaseline value="0"/>
|
||||
<Delta index="0" value="0"/>
|
||||
<Delta index="1" value="465"/>
|
||||
<Delta index="2" value="0"/>
|
||||
<Delta index="3" value="1345"/>
|
||||
<Delta index="4" value="507"/>
|
||||
<Delta index="5" value="0"/>
|
||||
<Delta index="6" value="0"/>
|
||||
<Delta index="7" value="0"/>
|
||||
<Delta index="8" value="0"/>
|
||||
<Delta index="9" value="0"/>
|
||||
<Delta index="10" value="0"/>
|
||||
<Delta index="11" value="0"/>
|
||||
<Delta index="12" value="0"/>
|
||||
<Delta index="13" value="0"/>
|
||||
<Delta index="14" value="0"/>
|
||||
<Delta index="15" value="0"/>
|
||||
<Delta index="16" value="0"/>
|
||||
<Delta index="17" value="0"/>
|
||||
<Delta index="18" value="0"/>
|
||||
<Delta index="19" value="0"/>
|
||||
<Delta index="20" value="0"/>
|
||||
<Delta index="21" value="0"/>
|
||||
<Delta index="22" value="0"/>
|
||||
<Delta index="23" value="0"/>
|
||||
<Delta index="24" value="0"/>
|
||||
<Delta index="25" value="0"/>
|
||||
<Delta index="26" value="0"/>
|
||||
<Delta index="27" value="0"/>
|
||||
<Delta index="28" value="0"/>
|
||||
<Delta index="29" value="0"/>
|
||||
<Delta index="30" value="0"/>
|
||||
<Delta index="31" value="0"/>
|
||||
<BaselineValues>
|
||||
<Lookup glyph="uni2EA2" value="1"/>
|
||||
</BaselineValues>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
44
Tests/subset/data/expect_bsln_2.ttx
Normal file
44
Tests/subset/data/expect_bsln_2.ttx
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="2">
|
||||
<DefaultBaseline value="0"/>
|
||||
<StandardGlyph value="glyph00002"/>
|
||||
<ControlPoint index="0" value="7"/>
|
||||
<ControlPoint index="1" value="8"/>
|
||||
<ControlPoint index="2" value="9"/>
|
||||
<ControlPoint index="3" value="10"/>
|
||||
<ControlPoint index="4" value="11"/>
|
||||
<ControlPoint index="5" value="65535"/>
|
||||
<ControlPoint index="6" value="65535"/>
|
||||
<ControlPoint index="7" value="65535"/>
|
||||
<ControlPoint index="8" value="65535"/>
|
||||
<ControlPoint index="9" value="65535"/>
|
||||
<ControlPoint index="10" value="65535"/>
|
||||
<ControlPoint index="11" value="65535"/>
|
||||
<ControlPoint index="12" value="65535"/>
|
||||
<ControlPoint index="13" value="65535"/>
|
||||
<ControlPoint index="14" value="65535"/>
|
||||
<ControlPoint index="15" value="65535"/>
|
||||
<ControlPoint index="16" value="65535"/>
|
||||
<ControlPoint index="17" value="65535"/>
|
||||
<ControlPoint index="18" value="65535"/>
|
||||
<ControlPoint index="19" value="65535"/>
|
||||
<ControlPoint index="20" value="65535"/>
|
||||
<ControlPoint index="21" value="65535"/>
|
||||
<ControlPoint index="22" value="65535"/>
|
||||
<ControlPoint index="23" value="65535"/>
|
||||
<ControlPoint index="24" value="65535"/>
|
||||
<ControlPoint index="25" value="65535"/>
|
||||
<ControlPoint index="26" value="65535"/>
|
||||
<ControlPoint index="27" value="65535"/>
|
||||
<ControlPoint index="28" value="65535"/>
|
||||
<ControlPoint index="29" value="65535"/>
|
||||
<ControlPoint index="30" value="65535"/>
|
||||
<ControlPoint index="31" value="65535"/>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
47
Tests/subset/data/expect_bsln_3.ttx
Normal file
47
Tests/subset/data/expect_bsln_3.ttx
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ttFont>
|
||||
|
||||
<bsln>
|
||||
<Version value="0x00010000"/>
|
||||
<Baseline Format="3">
|
||||
<DefaultBaseline value="0"/>
|
||||
<StandardGlyph value="glyph00003"/>
|
||||
<ControlPoint index="0" value="7"/>
|
||||
<ControlPoint index="1" value="8"/>
|
||||
<ControlPoint index="2" value="9"/>
|
||||
<ControlPoint index="3" value="10"/>
|
||||
<ControlPoint index="4" value="11"/>
|
||||
<ControlPoint index="5" value="65535"/>
|
||||
<ControlPoint index="6" value="65535"/>
|
||||
<ControlPoint index="7" value="65535"/>
|
||||
<ControlPoint index="8" value="65535"/>
|
||||
<ControlPoint index="9" value="65535"/>
|
||||
<ControlPoint index="10" value="65535"/>
|
||||
<ControlPoint index="11" value="65535"/>
|
||||
<ControlPoint index="12" value="65535"/>
|
||||
<ControlPoint index="13" value="65535"/>
|
||||
<ControlPoint index="14" value="65535"/>
|
||||
<ControlPoint index="15" value="65535"/>
|
||||
<ControlPoint index="16" value="65535"/>
|
||||
<ControlPoint index="17" value="65535"/>
|
||||
<ControlPoint index="18" value="65535"/>
|
||||
<ControlPoint index="19" value="65535"/>
|
||||
<ControlPoint index="20" value="65535"/>
|
||||
<ControlPoint index="21" value="65535"/>
|
||||
<ControlPoint index="22" value="65535"/>
|
||||
<ControlPoint index="23" value="65535"/>
|
||||
<ControlPoint index="24" value="65535"/>
|
||||
<ControlPoint index="25" value="65535"/>
|
||||
<ControlPoint index="26" value="65535"/>
|
||||
<ControlPoint index="27" value="65535"/>
|
||||
<ControlPoint index="28" value="65535"/>
|
||||
<ControlPoint index="29" value="65535"/>
|
||||
<ControlPoint index="30" value="65535"/>
|
||||
<ControlPoint index="31" value="65535"/>
|
||||
<BaselineValues>
|
||||
<Lookup glyph="uni2EA2" value="1"/>
|
||||
</BaselineValues>
|
||||
</Baseline>
|
||||
</bsln>
|
||||
|
||||
</ttFont>
|
@ -95,6 +95,84 @@ class SubsetTest(unittest.TestCase):
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_no_notdef_outline_ttf.ttx"), ["glyf", "hmtx"])
|
||||
|
||||
def test_subset_bsln_format_0(self):
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-0.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--glyphs=one", "--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_0.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_bsln_format_0_from_format_1(self):
|
||||
# TestBSLN-1 defines the ideographic baseline to be the font's default,
|
||||
# and specifies that glyphs {.notdef, zero, one, two} use the roman
|
||||
# baseline instead of the default ideographic baseline. As we request
|
||||
# a subsetted font with {zero, one} and the implicit .notdef, all
|
||||
# glyphs in the resulting font use the Roman baseline. In this case,
|
||||
# we expect a format 0 'bsln' table because it is the most compact.
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-1.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--unicodes=U+0030-0031",
|
||||
"--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_0.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_bsln_format_1(self):
|
||||
# TestBSLN-1 defines the ideographic baseline to be the font's default,
|
||||
# and specifies that glyphs {.notdef, zero, one, two} use the roman
|
||||
# baseline instead of the default ideographic baseline. We request
|
||||
# a subset where the majority of glyphs use the roman baseline,
|
||||
# but one single glyph (uni2EA2) is ideographic. In the resulting
|
||||
# subsetted font, we expect a format 1 'bsln' table whose default
|
||||
# is Roman, but with an override that uses the ideographic baseline
|
||||
# for uni2EA2.
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-1.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--unicodes=U+0030-0031,U+2EA2",
|
||||
"--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_1.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_bsln_format_2(self):
|
||||
# The 'bsln' table in TestBSLN-2 refers to control points in glyph 'P'
|
||||
# for defining its baselines. Therefore, the subsetted font should
|
||||
# include this glyph even though it is not requested explicitly.
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-2.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--glyphs=one", "--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_2.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_bsln_format_2_from_format_3(self):
|
||||
# TestBSLN-3 defines the ideographic baseline to be the font's default,
|
||||
# and specifies that glyphs {.notdef, zero, one, two, P} use the roman
|
||||
# baseline instead of the default ideographic baseline. As we request
|
||||
# a subsetted font with zero and the implicit .notdef and P for
|
||||
# baseline measurement, all glyphs in the resulting font use the Roman
|
||||
# baseline. In this case, we expect a format 2 'bsln' table because it
|
||||
# is the most compact encoding.
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-3.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--unicodes=U+0030",
|
||||
"--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_2.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_bsln_format_3(self):
|
||||
# TestBSLN-3 defines the ideographic baseline to be the font's default,
|
||||
# and specifies that glyphs {.notdef, zero, one, two} use the roman
|
||||
# baseline instead of the default ideographic baseline. We request
|
||||
# a subset where the majority of glyphs use the roman baseline,
|
||||
# but one single glyph (uni2EA2) is ideographic. In the resulting
|
||||
# subsetted font, we expect a format 1 'bsln' table whose default
|
||||
# is Roman, but with an override that uses the ideographic baseline
|
||||
# for uni2EA2.
|
||||
_, fontpath = self.compile_font(self.getpath("TestBSLN-3.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
subset.main([fontpath, "--unicodes=U+0030-0031,U+2EA2",
|
||||
"--output-file=%s" % subsetpath])
|
||||
subsetfont = TTFont(subsetpath)
|
||||
self.expect_ttx(subsetfont, self.getpath("expect_bsln_3.ttx"), ["bsln"])
|
||||
|
||||
def test_subset_clr(self):
|
||||
_, fontpath = self.compile_font(self.getpath("TestCLR-Regular.ttx"), ".ttf")
|
||||
subsetpath = self.temp_path(".ttf")
|
||||
|
Loading…
x
Reference in New Issue
Block a user