Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements #8. The general idea is to add a helper for casting rays from various points and directions, looking at the intersections between the ray and the glyph, and then trying to organise those intersections into pairs a relatively similar distance apart. i.e.
should return 177,177 and ignore the 802 as an outlier.
It also adds some routines for sweeping a ray around a portion of the glyph (which we call "jittering") and then taking the average discarding outliers. This allows for us to measure stems while ignoring irrelevant features. i.e. in this glyph, we should get a value for red (and maybe orange) but not blue:
Using these new routines, we can find values for XOPQ, XOUC, XOLC, XOFI, YOPQ, YOUC, YOLC and YOFI.
The next step is to add routines which "expect" a number of intersections and then choose a value from the set which is not the most common. (i.e. with the same H above, we should say "expect to see four intersections and when you do, give me the pair with the maximum distance between points) this is how we return the 802 to get XTRA.