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

Export clean SVGs with user-specified metadata #567

Open
psvoboda76 opened this issue Mar 14, 2022 · 4 comments
Open

Export clean SVGs with user-specified metadata #567

psvoboda76 opened this issue Mar 14, 2022 · 4 comments
Labels
Feature New feature or request Rust Involves Rust programming for the backend

Comments

@psvoboda76
Copy link

psvoboda76 commented Mar 14, 2022

Blocked on #1832


It would be nice to extend SVG Export by:

  1. Adding id to the exported elements. In Graphite Editor, you specify the id in the properties pane,
    svg_id

then this id should be exported into the underlying svg.

<path id="idOfShape" d="M....

  1. Text should be exported as a text element with properties such as size, font, etc. Currently, it is exported as a path - eg. it is not possible to modify it. (this is important when using Graphite along with other graphical editors, or intend to use exported graphics in web with some animations)

  2. Currently, there is no option to specify floating-point precision when exporting, the exported svg can get huge. For example, currently when I create the rect element, I get:

<path d="M178.79528808593741 -364.70001220703125L374.39532470703114 -364.70001220703125L374.39532470703114 -217.89999389648438L178.79528808593741 -217.89999389648438Z" ...

if I could round for example to 3 dec. places, I could get

<path d="M178.795 -364.700L374.395 -364.700L374.395 -217.899L178.795 -217.899Z" ...

which is much shorter.

@Keavon Keavon added Feature New feature or request Available Rust Involves Rust programming for the backend labels Mar 16, 2022
@Keavon Keavon added this to the Sprint 15 (upcoming) milestone Mar 16, 2022
@Keavon
Copy link
Member

Keavon commented Mar 16, 2022

I've envisioned that this, along with other SVG metadata, could be included in a Properties panel section called "SVG Metadata" which includes a place to give it a custom ID, class, style, animation data, etc. I've never loved the automatic translation of layer name into a hyphenated ID that is used in other software since I usually have to go and manually strip that out when cleaning up the SVG syntax. But doing this in a custom properties section would make that optional and give the user more control. Does that seem like an improvement, or would it be disadvantageous over your proposal (@psvoboda76) in ways I haven't thought about?

@psvoboda76
Copy link
Author

I fully agree, having a separate section "SVG Metadata" in the Properties panel is a better idea. It definitely is the right solution. Thank you.

I've envisioned that this, along with other SVG metadata, could be included in a Properties panel section called "SVG Metadata" which includes a place to give it a custom ID, class, style, animation data, etc. I've never loved the automatic translation of layer name into a hyphenated ID that is used in other software since I usually have to go and manually strip that out when cleaning up the SVG syntax. But doing this in a custom properties section would make that optional and give the user more control. Does that seem like an improvement, or would it be disadvantageous over your proposal (@psvoboda76) in ways I haven't thought about?

@Keavon Keavon changed the title SVG export - add id, export text as text element, specify dec. precision SVG export with user-specified metadata Apr 21, 2022
@Keavon Keavon changed the title SVG export with user-specified metadata Clean SVG export with user-specified metadata Apr 21, 2022
@Keavon Keavon removed the Available label Apr 21, 2022
@Keavon Keavon removed this from the Sprint 16 (upcoming) milestone May 14, 2022
@Keavon Keavon added the Blocked label Aug 13, 2022
@psvoboda76
Copy link
Author

Hi,

Are there any time plans for implementing this option? I want to help. However, I am react js developer and never worked with vue before. Is there some design idea about the "SVG Metadata" pane? Eg. what it should contain aside of the id? Is someone working on it already I can contact and help?

@Keavon
Copy link
Member

Keavon commented Dec 19, 2022

Hi @psvoboda76, that will all be Rust code that works within our node system as part of a not-yet-built "Attributes" system that is used to send metadata alongside data through the node network (which is why I marked this as blocked until we have that). You'd be welcome to learn Rust and help us build that, but I might suggest the way you can help speed up the inclusion of this feature would be taking on some other tasks that generally improve the usability of the Graphite editor as a whole. If you're interested in doing that, let me know and I can suggest some options for tasks that would be beginner-friendly and predominantly focused around frontend code.

@Keavon Keavon changed the title Clean SVG export with user-specified metadata Export clean SVGs with user-specified metadata Mar 4, 2023
@0HyperCube 0HyperCube moved this to Blocked, Awaiting Full Node System in Task Board Mar 18, 2023
@Keavon Keavon moved this from Blocked, Awaiting Full Node System to Longer-Term in Task Board Apr 27, 2023
@Keavon Keavon removed the Blocked label May 31, 2023
@Keavon Keavon moved this to Blocked in Task Board May 31, 2023
@Keavon Keavon removed the P-Low label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request Rust Involves Rust programming for the backend
Projects
Status: Blocked
Development

No branches or pull requests

2 participants