Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stemhist] Integration tests & fixes #552

Merged
merged 6 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
370 changes: 195 additions & 175 deletions python/afdko/stemhist.py

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.all.hstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Horizontal Stem List for cidfont.ps on Mon Aug 13 02:44:48 2018
Count Width Glyph List
41 47 ['cid00002', 'cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00011', 'cid00012', 'cid00013', 'cid00014', 'cid00017', 'cid00018', 'cid00019', 'cid00021', 'cid00022', 'cid00024', 'cid00025', 'cid00026']
21 46 ['cid00002', 'cid00003', 'cid00005', 'cid00009', 'cid00012', 'cid00017', 'cid00019', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026', 'cid00028', 'cid00030', 'cid00032', 'cid00034', 'cid00042', 'cid00046']
18 50 ['cid00004', 'cid00006', 'cid00007', 'cid00008', 'cid00013', 'cid00016', 'cid00018', 'cid00020', 'cid00021', 'cid00023', 'cid00027', 'cid00058']
15 45 ['cid00008', 'cid00015', 'cid00018', 'cid00019', 'cid00042', 'cid00046', 'cid00055', 'cid00057', 'cid00058', 'cid00060', 'cid00061', 'cid00063', 'cid00064']
11 36 ['cid00033', 'cid00035', 'cid00036', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00045', 'cid00051', 'cid00052', 'cid00056']
9 41 ['cid00012', 'cid00015', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026', 'cid00034']
8 57 ['cid00029', 'cid00031', 'cid00043', 'cid00044']
4 178 ['cid00006', 'cid00021', 'cid00027']
4 39 ['cid00038', 'cid00049', 'cid00050', 'cid00051']
3 82 ['cid00057', 'cid00060', 'cid00062']
3 72 ['cid00035', 'cid00040', 'cid00041']
3 65 ['cid00030', 'cid00032', 'cid00048']
3 42 ['cid00032', 'cid00052', 'cid00053']
3 40 ['cid00034', 'cid00052', 'cid00054']
3 35 ['cid00043', 'cid00044', 'cid00054']
2 177 ['cid00006', 'cid00007']
2 128 ['cid00036', 'cid00037']
2 110 ['cid00045', 'cid00052']
2 99 ['cid00011', 'cid00033']
2 71 ['cid00022', 'cid00048']
2 61 ['cid00060', 'cid00061']
2 60 ['cid00029', 'cid00064']
2 56 ['cid00018', 'cid00019']
2 55 ['cid00033', 'cid00047']
2 53 ['cid00033', 'cid00047']
2 52 ['cid00028', 'cid00047']
2 43 ['cid00008', 'cid00053']
1 188 ['cid00013']
1 163 ['cid00053']
1 152 ['cid00053']
1 98 ['cid00037']
1 77 ['cid00034']
1 66 ['cid00028']
1 64 ['cid00054']
1 63 ['cid00059']
1 59 ['cid00031']
1 58 ['cid00048']
1 51 ['cid00008']
1 44 ['cid00063']
1 34 ['cid00034']
1 10 ['cid00062']
52 changes: 52 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.all.vstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Vertical Stem List for cidfont.ps on Mon Aug 13 02:44:48 2018
Count Width Glyph List
13 84 ['cid00020', 'cid00028', 'cid00029', 'cid00031', 'cid00035', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00044', 'cid00056', 'cid00063']
11 95 ['cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00013', 'cid00017', 'cid00019', 'cid00042']
10 90 ['cid00029', 'cid00031', 'cid00032', 'cid00043', 'cid00044', 'cid00047', 'cid00057', 'cid00060', 'cid00061', 'cid00064']
9 85 ['cid00013', 'cid00020', 'cid00033', 'cid00035', 'cid00040', 'cid00041', 'cid00043', 'cid00045', 'cid00047']
8 81 ['cid00029', 'cid00031', 'cid00034', 'cid00035', 'cid00037', 'cid00044', 'cid00046']
7 94 ['cid00003', 'cid00008', 'cid00009', 'cid00018', 'cid00021', 'cid00022', 'cid00026']
6 83 ['cid00032', 'cid00036', 'cid00048', 'cid00059', 'cid00063']
6 76 ['cid00006', 'cid00007', 'cid00021', 'cid00048']
5 109 ['cid00004', 'cid00005', 'cid00008', 'cid00016', 'cid00018']
4 229 ['cid00002', 'cid00025', 'cid00026']
4 92 ['cid00014', 'cid00032', 'cid00055', 'cid00061']
4 89 ['cid00028', 'cid00058', 'cid00061', 'cid00064']
4 82 ['cid00028', 'cid00033', 'cid00034', 'cid00043']
3 51 ['cid00015', 'cid00022']
2 110 ['cid00016', 'cid00018']
2 99 ['cid00017', 'cid00019']
2 88 ['cid00011', 'cid00030']
2 87 ['cid00054', 'cid00058']
2 75 ['cid00034', 'cid00063']
2 72 ['cid00034', 'cid00054']
2 46 ['cid00006', 'cid00007']
1 232 ['cid00038']
1 231 ['cid00023']
1 230 ['cid00012']
1 228 ['cid00050']
1 227 ['cid00024']
1 223 ['cid00051']
1 221 ['cid00050']
1 203 ['cid00054']
1 200 ['cid00051']
1 195 ['cid00052']
1 190 ['cid00049']
1 188 ['cid00059']
1 187 ['cid00051']
1 183 ['cid00050']
1 157 ['cid00015']
1 156 ['cid00015']
1 153 ['cid00022']
1 135 ['cid00037']
1 134 ['cid00036']
1 100 ['cid00003']
1 93 ['cid00055']
1 91 ['cid00012']
1 80 ['cid00046']
1 79 ['cid00063']
1 66 ['cid00054']
1 60 ['cid00007']
1 52 ['cid00014']
1 49 ['cid00060']
1 15 ['cid00034']
55 changes: 55 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.bot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Bottom Zone List for cidfont.ps on Mon Aug 13 02:46:01 2018
Count Bottom Zone Glyph List
4 -249 ['cid00037', 'cid00052']
6 -239 ['cid00034', 'cid00043', 'cid00044']
2 -216 ['cid00018']
2 -163 ['cid00011']
1 -20 ['cid00064']
10 -15 ['cid00004', 'cid00008', 'cid00016', 'cid00020', 'cid00022']
1 -14 ['cid00034']
32 -13 ['cid00028', 'cid00029', 'cid00030', 'cid00031', 'cid00032', 'cid00042', 'cid00043', 'cid00044', 'cid00046', 'cid00047', 'cid00048', 'cid00054', 'cid00055', 'cid00058', 'cid00060', 'cid00061', 'cid00063']
1 -12 ['cid00018']
6 -10 ['cid00018', 'cid00019', 'cid00028', 'cid00029', 'cid00031']
1 -8 ['cid00048']
3 -7 ['cid00015', 'cid00023', 'cid00024']
2 -6 ['cid00049', 'cid00050']
65 0 ['cid00002', 'cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00012', 'cid00013', 'cid00014', 'cid00015', 'cid00017', 'cid00019', 'cid00021', 'cid00025', 'cid00026', 'cid00027', 'cid00033', 'cid00035', 'cid00036', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00045', 'cid00051', 'cid00053', 'cid00056', 'cid00057', 'cid00059', 'cid00062']
1 160 ['cid00034']
1 193 ['cid00059']
1 217 ['cid00002']
1 240 ['cid00032']
1 256 ['cid00064']
1 264 ['cid00017']
1 274 ['cid00008']
1 310 ['cid00019']
1 315 ['cid00058']
2 318 ['cid00006', 'cid00007']
1 319 ['cid00009']
2 323 ['cid00003', 'cid00053']
1 336 ['cid00061']
1 345 ['cid00060']
1 378 ['cid00045']
1 389 ['cid00054']
1 415 ['cid00034']
4 416 ['cid00035', 'cid00040', 'cid00041', 'cid00048']
4 422 ['cid00033', 'cid00047']
4 431 ['cid00029', 'cid00031', 'cid00043', 'cid00044']
1 432 ['cid00053']
1 433 ['cid00052']
4 436 ['cid00038', 'cid00049', 'cid00050', 'cid00051']
5 442 ['cid00028', 'cid00030', 'cid00032', 'cid00042', 'cid00046']
1 447 ['cid00034']
2 491 ['cid00021', 'cid00027']
2 492 ['cid00006', 'cid00007']
2 564 ['cid00060', 'cid00062']
2 598 ['cid00036', 'cid00037']
5 614 ['cid00055', 'cid00057', 'cid00058', 'cid00063', 'cid00064']
4 619 ['cid00006', 'cid00007', 'cid00021', 'cid00027']
1 620 ['cid00023']
2 622 ['cid00022', 'cid00024']
14 623 ['cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00011', 'cid00012', 'cid00013', 'cid00014', 'cid00017', 'cid00019', 'cid00025', 'cid00026']
2 624 ['cid00015', 'cid00023']
7 628 ['cid00012', 'cid00015', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026']
5 634 ['cid00004', 'cid00008', 'cid00016', 'cid00018', 'cid00020']
1 649 ['cid00054']
1 650 ['cid00033']
30 changes: 30 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.hstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Horizontal Stem List for cidfont.ps on Mon Aug 13 02:43:49 2018
Count Width Glyph List
40 47 ['cid00002', 'cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00011', 'cid00012', 'cid00013', 'cid00014', 'cid00017', 'cid00019', 'cid00021', 'cid00022', 'cid00024', 'cid00025', 'cid00026']
15 46 ['cid00002', 'cid00003', 'cid00005', 'cid00009', 'cid00012', 'cid00017', 'cid00019', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026']
11 36 ['cid00033', 'cid00035', 'cid00036', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00045', 'cid00051', 'cid00052', 'cid00056']
10 50 ['cid00006', 'cid00007', 'cid00013', 'cid00021', 'cid00023', 'cid00027', 'cid00058']
8 41 ['cid00012', 'cid00015', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026']
4 178 ['cid00006', 'cid00021', 'cid00027']
4 39 ['cid00038', 'cid00049', 'cid00050', 'cid00051']
3 82 ['cid00057', 'cid00060', 'cid00062']
3 45 ['cid00008', 'cid00015', 'cid00019']
3 42 ['cid00032', 'cid00052', 'cid00053']
2 177 ['cid00006', 'cid00007']
2 55 ['cid00033', 'cid00047']
2 53 ['cid00033', 'cid00047']
2 43 ['cid00008', 'cid00053']
2 40 ['cid00052', 'cid00054']
2 35 ['cid00043', 'cid00044']
1 188 ['cid00013']
1 163 ['cid00053']
1 152 ['cid00053']
1 77 ['cid00034']
1 65 ['cid00048']
1 63 ['cid00059']
1 60 ['cid00029']
1 59 ['cid00031']
1 58 ['cid00048']
1 56 ['cid00019']
1 34 ['cid00034']
1 10 ['cid00062']
59 changes: 59 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.top.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Top Zone List for cidfont.ps on Mon Aug 13 02:46:01 2018
Count Top Zone Glyph List
2 749 ['cid00033']
5 739 ['cid00029', 'cid00031', 'cid00035', 'cid00038', 'cid00039']
4 726 ['cid00036', 'cid00037']
12 684 ['cid00004', 'cid00008', 'cid00016', 'cid00018', 'cid00020', 'cid00054']
1 674 ['cid00002']
54 669 ['cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00011', 'cid00012', 'cid00013', 'cid00014', 'cid00015', 'cid00017', 'cid00019', 'cid00021', 'cid00022', 'cid00023', 'cid00024', 'cid00025', 'cid00026', 'cid00027']
11 659 ['cid00055', 'cid00057', 'cid00058', 'cid00061', 'cid00063', 'cid00064']
2 654 ['cid00056', 'cid00059']
4 646 ['cid00060', 'cid00062']
25 488 ['cid00028', 'cid00029', 'cid00030', 'cid00031', 'cid00032', 'cid00034', 'cid00035', 'cid00040', 'cid00041', 'cid00042', 'cid00043', 'cid00044', 'cid00045', 'cid00046']
2 481 ['cid00048']
3 477 ['cid00033', 'cid00047']
14 475 ['cid00033', 'cid00038', 'cid00047', 'cid00049', 'cid00050', 'cid00051', 'cid00052', 'cid00053']
1 449 ['cid00034']
1 429 ['cid00054']
1 406 ['cid00060']
1 397 ['cid00061']
1 369 ['cid00003']
1 366 ['cid00009']
3 365 ['cid00006', 'cid00007', 'cid00058']
1 355 ['cid00019']
1 318 ['cid00008']
1 316 ['cid00064']
1 311 ['cid00017']
1 282 ['cid00032']
1 264 ['cid00002']
1 256 ['cid00059']
1 200 ['cid00034']
1 188 ['cid00013']
2 178 ['cid00006', 'cid00027']
1 163 ['cid00053']
1 82 ['cid00057']
1 63 ['cid00034']
1 58 ['cid00048']
1 56 ['cid00022']
1 53 ['cid00028']
2 52 ['cid00030', 'cid00032']
1 51 ['cid00054']
5 50 ['cid00006', 'cid00013', 'cid00027', 'cid00029', 'cid00048']
1 49 ['cid00031']
15 47 ['cid00002', 'cid00003', 'cid00005', 'cid00006', 'cid00007', 'cid00009', 'cid00010', 'cid00012', 'cid00013', 'cid00014', 'cid00017', 'cid00019', 'cid00021', 'cid00025', 'cid00026']
1 46 ['cid00019']
4 44 ['cid00029', 'cid00031', 'cid00043', 'cid00044']
2 42 ['cid00028', 'cid00053']
1 41 ['cid00015']
1 39 ['cid00047']
11 36 ['cid00008', 'cid00033', 'cid00035', 'cid00036', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00045', 'cid00051', 'cid00056']
5 35 ['cid00004', 'cid00016', 'cid00018', 'cid00020']
6 32 ['cid00042', 'cid00046', 'cid00055', 'cid00058', 'cid00060', 'cid00061']
1 31 ['cid00063']
1 10 ['cid00062']
1 -64 ['cid00011']
1 -139 ['cid00052']
1 -151 ['cid00037']
1 -160 ['cid00018']
1 -193 ['cid00034']
2 -204 ['cid00043', 'cid00044']
36 changes: 36 additions & 0 deletions tests/stemhist_data/expected_output/cidfont.vstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Vertical Stem List for cidfont.ps on Mon Aug 13 02:43:49 2018
Count Width Glyph List
11 84 ['cid00028', 'cid00029', 'cid00031', 'cid00035', 'cid00038', 'cid00039', 'cid00040', 'cid00041', 'cid00044', 'cid00056']
8 85 ['cid00013', 'cid00033', 'cid00035', 'cid00040', 'cid00041', 'cid00043', 'cid00045', 'cid00047']
6 76 ['cid00006', 'cid00007', 'cid00021', 'cid00048']
5 81 ['cid00029', 'cid00031', 'cid00035', 'cid00037', 'cid00044']
4 229 ['cid00002', 'cid00025', 'cid00026']
4 83 ['cid00036', 'cid00048', 'cid00059']
3 51 ['cid00015', 'cid00022']
2 94 ['cid00008', 'cid00022']
2 82 ['cid00028', 'cid00043']
2 46 ['cid00006', 'cid00007']
1 232 ['cid00038']
1 231 ['cid00023']
1 230 ['cid00012']
1 228 ['cid00050']
1 227 ['cid00024']
1 223 ['cid00051']
1 221 ['cid00050']
1 203 ['cid00054']
1 200 ['cid00051']
1 195 ['cid00052']
1 190 ['cid00049']
1 188 ['cid00059']
1 187 ['cid00051']
1 183 ['cid00050']
1 157 ['cid00015']
1 156 ['cid00015']
1 153 ['cid00022']
1 92 ['cid00014']
1 90 ['cid00047']
1 88 ['cid00011']
1 60 ['cid00007']
1 52 ['cid00014']
1 49 ['cid00060']
1 15 ['cid00034']
43 changes: 43 additions & 0 deletions tests/stemhist_data/expected_output/font.all.hstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Horizontal Stem List for font.ufo on Mon Aug 13 01:16:56 2018
Count Width Glyph List
41 47 ['A', 'B', 'D', 'E', 'F', 'H', 'I', 'J', 'K', 'L', 'M', 'P', 'Q', 'R', 'T', 'U', 'W', 'X', 'Y']
21 46 ['A', 'B', 'D', 'H', 'K', 'P', 'R', 'U', 'V', 'W', 'X', 'Y', 'a', 'c', 'e', 'g', 'o', 's']
18 50 ['C', 'E', 'F', 'G', 'L', 'O', 'Q', 'S', 'T', 'V', 'Z', 'three']
15 45 ['G', 'N', 'Q', 'R', 'eight', 'five', 'nine', 'o', 's', 'six', 'three', 'two', 'zero']
11 36 ['f', 'h', 'i', 'k', 'l', 'm', 'n', 'one', 'r', 'x', 'y']
9 41 ['K', 'N', 'U', 'V', 'W', 'X', 'Y', 'g']
8 57 ['b', 'd', 'p', 'q']
4 178 ['E', 'T', 'Z']
4 39 ['k', 'v', 'w', 'x']
3 82 ['five', 'seven', 'two']
3 72 ['h', 'm', 'n']
3 65 ['c', 'e', 'u']
3 42 ['e', 'y', 'z']
3 40 ['ampersand', 'g', 'y']
3 35 ['ampersand', 'p', 'q']
2 177 ['E', 'F']
2 128 ['i', 'j']
2 110 ['r', 'y']
2 99 ['J', 'f']
2 71 ['U', 'u']
2 61 ['five', 'six']
2 60 ['b', 'nine']
2 56 ['Q', 'R']
2 55 ['f', 't']
2 53 ['f', 't']
2 52 ['a', 't']
2 43 ['G', 'z']
1 188 ['L']
1 163 ['z']
1 152 ['z']
1 98 ['j']
1 77 ['g']
1 66 ['a']
1 64 ['ampersand']
1 63 ['four']
1 59 ['d']
1 58 ['u']
1 51 ['G']
1 44 ['eight']
1 34 ['g']
1 10 ['seven']
52 changes: 52 additions & 0 deletions tests/stemhist_data/expected_output/font.all.vstm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Vertical Stem List for font.ufo on Mon Aug 13 01:16:56 2018
Count Width Glyph List
13 84 ['S', 'a', 'b', 'd', 'eight', 'h', 'k', 'l', 'm', 'n', 'one', 'q']
11 95 ['B', 'D', 'E', 'F', 'H', 'I', 'L', 'P', 'R', 'o']
10 90 ['b', 'd', 'e', 'five', 'nine', 'p', 'q', 'six', 't', 'two']
9 85 ['L', 'S', 'f', 'h', 'm', 'n', 'p', 'r', 't']
8 81 ['b', 'd', 'g', 'h', 'j', 'q', 's']
7 94 ['B', 'G', 'H', 'Q', 'T', 'U', 'Y']
6 83 ['e', 'eight', 'four', 'i', 'u']
6 76 ['E', 'F', 'T', 'u']
5 109 ['C', 'D', 'G', 'O', 'Q']
4 229 ['A', 'X', 'Y']
4 92 ['M', 'e', 'six', 'zero']
4 89 ['a', 'nine', 'six', 'three']
4 82 ['a', 'f', 'g', 'p']
3 51 ['N', 'U']
2 110 ['O', 'Q']
2 99 ['P', 'R']
2 88 ['J', 'c']
2 87 ['ampersand', 'three']
2 75 ['eight', 'g']
2 72 ['ampersand', 'g']
2 46 ['E', 'F']
1 232 ['k']
1 231 ['V']
1 230 ['K']
1 228 ['w']
1 227 ['W']
1 223 ['x']
1 221 ['w']
1 203 ['ampersand']
1 200 ['x']
1 195 ['y']
1 190 ['v']
1 188 ['four']
1 187 ['x']
1 183 ['w']
1 157 ['N']
1 156 ['N']
1 153 ['U']
1 135 ['j']
1 134 ['i']
1 100 ['B']
1 93 ['zero']
1 91 ['K']
1 80 ['s']
1 79 ['eight']
1 66 ['ampersand']
1 60 ['F']
1 52 ['M']
1 49 ['five']
1 15 ['g']
Loading