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

Auto-parama-roundup (WIP) #11

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Auto-parama-roundup (WIP) #11

wants to merge 3 commits into from

Conversation

simoncozens
Copy link
Contributor

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.
Screenshot 2024-10-01 at 13 48 05
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:

Screenshot 2024-10-01 at 13 54 20

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.

@simoncozens
Copy link
Contributor Author

Actually, plan B: I'm going to use winding numbers to differentiate between transparent and ink.

@simoncozens
Copy link
Contributor Author

Now I am starting to get some interesting results:

Screenshot 2024-10-02 at 13 30 35 Screenshot 2024-10-02 at 13 35 58

However it's not clear to me what the parametric values mean for italic fonts. Should I measure it like this:

Screenshot 2024-10-02 at 13 39 43

or like this:

Screenshot 2024-10-02 at 13 40 27

@simoncozens
Copy link
Contributor Author

Looking at Amstelvar and Robotoflex, parametric values should not correct for slant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant