magicsunday / webtrees-fan-chart

SVG based ancestor fan chart module for webtrees genealogy application.
GNU General Public License v3.0
60 stars 19 forks source link

Gender color outline in SVG not working in AI and Inkscape #101

Closed FelixBuehler closed 1 month ago

FelixBuehler commented 10 months ago

Describe the bug When exporting the SVG, my programs won't display the color of the gender-outline. This is most like due to the color being a variable and not set in the path.

Expected behavior All normal programs to be able to deal with the color.

Screenshots (Additional info removed by me) Screenshot 2024-01-22 173158

magicsunday commented 7 months ago

Looks like Inkscape is not able to handle CSS variables. Adding a style tag directly to a path-element style="fill: var(--sex-f-bg, rgb(233, 218, 241)) does not change anything, only if I remove the "var" part from it.

So we need to find a way to extract all used CSS classes of the chart, look up any CSS variable and replace it with the proper defined color expression, create a new style-tag inside exported SVG containing all the corrected CSS, or wait and hope Inkscape will support CSS variables soon or later.

FelixBuehler commented 7 months ago

A small workaround I do now: I open the exported svg in my browser and then print it as pdf. Then it contains all the colors and is even faster to view than the SVG. I'm no expert (in this field), so maybe a "export to PDF" might even be the best solution, since it's the file format most people can handle?

magicsunday commented 1 month ago

Exported as SVG

fan-chart

The only downside I could see is that Inkscape does not support underline within elements.

FelixBuehler commented 1 month ago

Awesome! That looks very good. Do the failed checks of the commit prevent this changes to be accepted? I'm no expert in Git-Checks/Commits/PR.

magicsunday commented 1 month ago

I will merge it tomorrow into the main branch.