Skip to content

Commit

Permalink
[tx_test] Test to capture current glyph bbox results
Browse files Browse the repository at this point in the history
Relates to #655
  • Loading branch information
miguelsousa committed Oct 26, 2018
1 parent 17d4be5 commit 8438c09
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tx_data/expected_output/bug655.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### glyph[tag] {gname,enc,width,{left,bottom,right,top}}
glyph[0] {a,-,500,{76,-124,389,303}}
glyph[1] {b,-,500,{-235,-235,0,235}}
glyph[2] {c,-,500,{56,-10,369,303}}
glyph[3] {d,-,500,{86,80,418,412}}
glyph[4] {e,-,500,{86,80,100,412}}
### aggregate
bbox {-235,-235,418,412}
tag {1,1,3,3}
gname {b,b,d,d}
40 changes: 40 additions & 0 deletions tests/tx_data/input/bug655.ufo/fontinfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ascender</key>
<integer>750</integer>
<key>capHeight</key>
<integer>750</integer>
<key>descender</key>
<integer>-250</integer>
<key>postscriptBlueValues</key>
<array>
</array>
<key>postscriptFamilyBlues</key>
<array>
</array>
<key>postscriptFamilyOtherBlues</key>
<array>
</array>
<key>postscriptFontName</key>
<string>None-None</string>
<key>postscriptOtherBlues</key>
<array>
</array>
<key>postscriptStemSnapH</key>
<array>
</array>
<key>postscriptStemSnapV</key>
<array>
</array>
<key>unitsPerEm</key>
<integer>1000</integer>
<key>versionMajor</key>
<integer>0</integer>
<key>versionMinor</key>
<integer>0</integer>
<key>xHeight</key>
<integer>500</integer>
</dict>
</plist>
12 changes: 12 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/a.glif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<glyph name="a" format="1">
<advance width="500"/>
<outline>
<contour>
<point x="503" y="-10" type="line"/>
<point x="389" y="303" type="line"/>
<point x="76" y="189" type="line"/>
<point x="190" y="-124" type="line"/>
</contour>
</outline>
</glyph>
12 changes: 12 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/b.glif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<glyph name="b" format="1">
<advance width="500"/>
<outline>
<contour>
<point x="235" y="0" type="line"/>
<point x="0" y="235" type="line"/>
<point x="-235" y="0" type="line"/>
<point x="0" y="-235" type="line"/>
</contour>
</outline>
</glyph>
12 changes: 12 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/c.glif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<glyph name="c" format="1">
<advance width="500"/>
<outline>
<contour>
<point x="391" y="104" type="line"/>
<point x="369" y="207" type="line"/>
<point x="56" y="303" type="line"/>
<point x="170" y="-10" type="line"/>
</contour>
</outline>
</glyph>
16 changes: 16 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/contents.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>a</key>
<string>a.glif</string>
<key>b</key>
<string>b.glif</string>
<key>c</key>
<string>c.glif</string>
<key>d</key>
<string>d.glif</string>
<key>e</key>
<string>e.glif</string>
</dict>
</plist>
12 changes: 12 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/d.glif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<glyph name="d" format="1">
<advance width="500"/>
<outline>
<contour>
<point x="418" y="80" type="line"/>
<point x="418" y="412" type="line"/>
<point x="86" y="412" type="line"/>
<point x="86" y="80" type="line"/>
</contour>
</outline>
</glyph>
12 changes: 12 additions & 0 deletions tests/tx_data/input/bug655.ufo/glyphs/e.glif
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<glyph name="e" format="1">
<advance width="500"/>
<outline>
<contour>
<point x="418" y="80" type="line"/>
<point x="100" y="412" type="line"/>
<point x="86" y="412" type="line"/>
<point x="86" y="80" type="line"/>
</contour>
</outline>
</glyph>
14 changes: 14 additions & 0 deletions tests/tx_data/input/bug655.ufo/lib.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>public.glyphOrder</key>
<array>
<string>a</string>
<string>b</string>
<string>c</string>
<string>d</string>
<string>e</string>
</array>
</dict>
</plist>
10 changes: 10 additions & 0 deletions tests/tx_data/input/bug655.ufo/metainfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>creator</key>
<string>org.robofab.ufoLib</string>
<key>formatVersion</key>
<integer>2</integer>
</dict>
</plist>
8 changes: 8 additions & 0 deletions tests/tx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,11 @@ def test_recalculate_font_bbox_bug618(to_format, args, exp_filename):
diff_mode = ['-m', 'bin']

assert differ([expected_path, save_path] + diff_mode)


def test_glyph_bboxes_bug655():
font_path = get_input_path('bug655.ufo')
expected_path = get_expected_path('bug655.txt')
result_path = get_temp_file_path()
runner(CMD + ['-o', 'mtx', '2', '-f', font_path, result_path])
assert differ([expected_path, result_path])

0 comments on commit 8438c09

Please sign in to comment.