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

fix: line_length assertion error for odd paths #279

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

JeppeKlitgaard
Copy link
Contributor

This fixes #278, see discussion there.

The proposed fix is likely not the optimal one – I am happy to change it.

@anthrotype

@anthrotype
Copy link
Member

hm that would effectively mean the _farthest method would yield two Vector(0.0, 0.0), Vector(0.0, 0.0) in this situation, where the arc endpoint sits exactly on the previous command end point.

Maybe we should simply catch that situation somewhere near

https://github.com/googlefonts/picosvg/blob/c19605d818528329ebd3af90715bfc9054f517db/src/picosvg/svg_reuse.py#L120-131

and simply continue and skip it altogether. That arc is as if it's not there IIUC.

/cc @rsheeter

@anthrotype anthrotype requested a review from rsheeter November 16, 2022 11:54
@anthrotype
Copy link
Member

though on the other end, we don't do similar filtering out of such overlapping segments for non arcs in the normalization method, so maybe we should let it through like you are currently doing.

Rod is the author of that code and he knows better what he was thinking when he added that assertion

@rsheeter
Copy link
Collaborator

I think there is a general question of whether we should eliminate pointless commands, tracked in #280, but until we address that I think this makes sense.

Ty for the PR.

@rsheeter rsheeter merged commit ffd4841 into googlefonts:main Nov 16, 2022
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.

Throws AssertionError: line_length 0.0 must be > 0 on OpenMoji 1F5FE
3 participants