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

Investigate implicit line operators in <path> #102

Open
deeplook opened this issue Dec 25, 2017 · 4 comments
Open

Investigate implicit line operators in <path> #102

deeplook opened this issue Dec 25, 2017 · 4 comments

Comments

@deeplook
Copy link
Owner

deeplook commented Dec 25, 2017

I've stumbled over a very simply logo that svglib does partly not render (the blueish triangle is missing): https://upload.wikimedia.org/wikipedia/commons/c/c7/HERE_logo.svg. It does appear though when adding l operators to the first path, turning it into:

<path d="m 26.95,66.453001 l -11,11 l -11,-11 l 22,0 z" style="fill:#65c1c2" />

So there seems to be some convention about implicit line operators that is not followed by svglib, yet. This is simply a ticket to investigate this further.

@deeplook
Copy link
Owner Author

Ok, this is a good starter: https://www.w3.org/TR/SVG11/paths.html#PathDataMovetoCommands

"""
Start a new sub-path at the given (x,y) coordinate. M (uppercase) indicates that absolute coordinates will follow; m (lowercase) indicates that relative coordinates will follow. If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.
"""

@claudep
Copy link
Collaborator

claudep commented Dec 27, 2017

Weird, I cannot reproduce the blueish triangle issue locally.

@deeplook
Copy link
Owner Author

deeplook commented Dec 27, 2017

Maybe an issue with the rendering application. I think I have used only Apple Preview.app, so far...
But nope, just tested with Adobe Reader XI 11.0.0 on MacOS 10.11.6. Same behaivour: missing bluish triangle without additional l operators. Fine, after adding them.

@claudep
Copy link
Collaborator

claudep commented Mar 8, 2018

Here's the PDF I just produced locally with svglib master (blueish triangle visible with Evince):
HERE_logo.pdf

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

No branches or pull requests

2 participants