More tests/testing using Python?
Thomas Shinnick <[email protected]>
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <CAEfS-phvujVC4BwEEe34eCU+gtJLq1VmNnJL3TSTvOXM86-crw@mail.gmail.com> |
I hate things sneaking up on me. I love tests that say I haven't again
broken things broken before. So I've been thinking...
If I started a simple-minded test in Python scripting that checked whether
"remove overlap" seems to work, could y'all point out the test fonts and
particular characters illustrating (old) bugs.
I'm thinking that something as simple as "how many splines are there
_now_?" could be a helpful test.
For example, one of my glyphs with overlapping strokes, sampling data using
a Python script tells me the glyph starts out with 6 splines and they're
all closed (b/c individually expanded strokes)
#contours: 6
boundBox: (-13.6533203125, 486.3466796875, 313.6533203125,
813.6533203125)
isEmpty(): 0
is_quadratic: 0
selfIntersects(): True
closed: 1
closed: 1
closed: 1
closed: 1
closed: 1
closed: 1
After applying "remove overlaps" I get the expected number of splines, now
only 4 due to overlap removal (yay!) but... some of them aren't closed
splines (boo!).
#contours: 4
boundBox: (-12.5, 487.5, 312.5, 812.5)
isEmpty(): 0
is_quadratic: 0
selfIntersects(): True
closed: 0
closed: 1
closed: 0
closed: 1
Just a simple programmed test: how many to begin with, how many after
applying operation, are they all closed, ... and one could include an
indication of what the points ought to be (thus how the spline ought to
'look')
Hey, in this particular erroring case, the boundingBox for at least one
resulting 'bad' spline would be way wrong - much too broad from top to
bottom - again an easy check.
It'd at least be a good "smoke test", yes?
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Fontforge-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fontforge-devel