Highlighted

SVG line elements disappear when markers are used

New Here ,
Sep 02, 2020

Copy link to clipboard

Copied

I wrote a program that generates SVG XML. These SVG fragments are exceprted from a much larger document, but here are the parts that are relevant to my plea for help.

 

 

 

<defs>
  <style type="text/css"><![CDATA[
    .gxasc { fill: black; stroke: white; stroke-width: 2px }
    .gxasc2 { fill: black; stroke: black; stroke-width: 2px }
    .gxasc5 { fill: none; stroke: black; stroke-width: 1px; marker-end: url(#motion) }
    ]]>
  </style>
  <marker id="motion" markerWidth="1" markerHeight="5" refX="0" refY="2.5" orient="auto">
    <line style="fill: none; stroke: black; stroke-width: 1px" x1="0" y1="0" x2="0" y2="5"/>
  </marker>
</defs>
<g id="ascc-stars" class="gxasc">
  <g>
    <line class="gxasc5" x1="2516.0843" y1="1196.6601" x2="2719.3656" y2="1095.6923"/>
    <circle cx="2516.0843" cy="1196.6601" r="20.522"/>
    <line class="gxasc2" x1="2495.5623" y1="1220.1821" x2="2536.6063" y2="1220.1821"/>
  </g>
  <circle cx="939.5155" cy="957.7022" r="14.606"/>
  <circle cx="1868.2093" cy="2512.765" r="12.766"/>
  <circle cx="3388.3147" cy="2570.5778" r="12.742"/>
  <circle cx="3669.6188" cy="1144.8815" r="12.656"/>
</g>

 

 

 

The global class .gxasc5 is attributed to a <line> element, and that class defines the style for those many elements, which includes a marker-end style, pointing to the <marker> with id="motion". That marker draws a perpendicular line at the end of the line darwn out by the <line> element with the "gxasc5" class. Typical use of SVG markers. But when I open the generated SVG in Illustrator 24.3, the little marker line is right where I expect it, but the line to which it should be attached is nowehere to be found. That path is just not there. What am I doing wrong here???

Adobe Community Professional
Correct answer by Monika Gause | Adobe Community Professional

Illustrator does not "open" SVG, but it imports them translating them into its own DOM.

 

It doesn't support the full SVG standard. And also when exporting this again from Illustrator, certain parts might get omitted.

 

If you want more and better support of SVG, you can make a feature request: http://illustrator.uservoice.com

Topics

Bug, Draw and design, How to, Import and export

Views

40

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

SVG line elements disappear when markers are used

New Here ,
Sep 02, 2020

Copy link to clipboard

Copied

I wrote a program that generates SVG XML. These SVG fragments are exceprted from a much larger document, but here are the parts that are relevant to my plea for help.

 

 

 

<defs>
  <style type="text/css"><![CDATA[
    .gxasc { fill: black; stroke: white; stroke-width: 2px }
    .gxasc2 { fill: black; stroke: black; stroke-width: 2px }
    .gxasc5 { fill: none; stroke: black; stroke-width: 1px; marker-end: url(#motion) }
    ]]>
  </style>
  <marker id="motion" markerWidth="1" markerHeight="5" refX="0" refY="2.5" orient="auto">
    <line style="fill: none; stroke: black; stroke-width: 1px" x1="0" y1="0" x2="0" y2="5"/>
  </marker>
</defs>
<g id="ascc-stars" class="gxasc">
  <g>
    <line class="gxasc5" x1="2516.0843" y1="1196.6601" x2="2719.3656" y2="1095.6923"/>
    <circle cx="2516.0843" cy="1196.6601" r="20.522"/>
    <line class="gxasc2" x1="2495.5623" y1="1220.1821" x2="2536.6063" y2="1220.1821"/>
  </g>
  <circle cx="939.5155" cy="957.7022" r="14.606"/>
  <circle cx="1868.2093" cy="2512.765" r="12.766"/>
  <circle cx="3388.3147" cy="2570.5778" r="12.742"/>
  <circle cx="3669.6188" cy="1144.8815" r="12.656"/>
</g>

 

 

 

The global class .gxasc5 is attributed to a <line> element, and that class defines the style for those many elements, which includes a marker-end style, pointing to the <marker> with id="motion". That marker draws a perpendicular line at the end of the line darwn out by the <line> element with the "gxasc5" class. Typical use of SVG markers. But when I open the generated SVG in Illustrator 24.3, the little marker line is right where I expect it, but the line to which it should be attached is nowehere to be found. That path is just not there. What am I doing wrong here???

Adobe Community Professional
Correct answer by Monika Gause | Adobe Community Professional

Illustrator does not "open" SVG, but it imports them translating them into its own DOM.

 

It doesn't support the full SVG standard. And also when exporting this again from Illustrator, certain parts might get omitted.

 

If you want more and better support of SVG, you can make a feature request: http://illustrator.uservoice.com

Topics

Bug, Draw and design, How to, Import and export

Views

41

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 02, 2020 0
Adobe Community Professional ,
Sep 03, 2020

Copy link to clipboard

Copied

Illustrator does not "open" SVG, but it imports them translating them into its own DOM.

 

It doesn't support the full SVG standard. And also when exporting this again from Illustrator, certain parts might get omitted.

 

If you want more and better support of SVG, you can make a feature request: http://illustrator.uservoice.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 03, 2020 0
New Here ,
Sep 03, 2020

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 03, 2020 0