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
SVG export of label box fails: solid fill and label misalligned #2813
Labels
Comments
ChrisIdema
changed the title
SVG render of label box fails: solid fill and label misalligned
SVG export of label box fails: solid fill and label misalligned
May 11, 2023
nathanal
added a commit
to nathanal/gephi
that referenced
this issue
Aug 30, 2023
- Remove text outline's fill (avoids doubling text fill) (svg) - Boxes no longer have solid fill, but are stroked (svg, pdf) - Boxes, labels use transparency (svg) - Non-zero outline size no longer affects box stroke (preview) - Fix first box size by setting an explicit stroke (preview) - Box has consistent sharp corners (preview) - Box size accounts for outline size (all) - Box matches label position and looks roughly centered (svg) dominant-baseline is unsupported by batik at the moment: https://xmlgraphics.apache.org/batik/status.html
8 tasks
nathanal
added a commit
to nathanal/gephi
that referenced
this issue
Aug 31, 2023
- Remove text outline's fill (avoids doubling text fill) (svg) - Boxes no longer have solid fill, but are stroked (svg, pdf) - Boxes, labels use transparency (svg) - Non-zero outline size no longer affects box stroke (preview) - Fix first box size by setting an explicit stroke (preview) - Box has consistent sharp corners (preview) - Box size accounts for outline size (all) - Box matches label position and looks roughly centered (svg) dominant-baseline is unsupported by batik at the moment: https://xmlgraphics.apache.org/batik/status.html
nathanal
added a commit
to nathanal/gephi
that referenced
this issue
Sep 2, 2023
- Remove text outline's fill (avoids doubling text fill) (svg) - Boxes no longer have solid fill, but are stroked (svg, pdf) - Boxes, labels use transparency (svg) - Non-zero outline size no longer affects box stroke (preview) - Fix first box size by setting an explicit stroke (preview) - Box has consistent sharp corners (preview) - Box size accounts for outline size (all) - Box matches label position and looks roughly centered (svg) dominant-baseline is unsupported by batik at the moment: https://xmlgraphics.apache.org/batik/status.html
nathanal
added a commit
to nathanal/gephi
that referenced
this issue
Sep 2, 2023
- Remove text outline's fill (avoids doubling text fill) (svg) - Boxes no longer have solid fill, but are stroked (svg, pdf) - Boxes, labels use transparency (svg) - Non-zero outline size no longer affects box stroke (preview) - Fix first box size by setting an explicit stroke (preview) - Box has consistent sharp corners (preview) - Box size accounts for outline size (all) - Box size includes descenders (y,g,p, etc) (pdf) - Box matches label position and looks roughly centered (svg) dominant-baseline is unsupported by batik at the moment: https://xmlgraphics.apache.org/batik/status.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
I export a graph which has boxes around the labels to SVG and to PNG. I expect the SVG to match the preview and PNG export. Below is the preview/PNG export.
Current Behavior
In the SVG the boxes have a solid fill instead of a border and the label is too low. The PNG is fine.
Possible Solution
The rectangle can be rendered differently
instead of
The label should be aligned at the top:
Instead of central:
As a workarround I used regular expression to do this:
and
Which results in a better image:
But as you can see the boxes in the preview are slightly wider and significantly taller.
So this isn't a full fix. The width and the height have to be changed too.
And even in the preview the clearance on the right is too small, so that has to be fixed too.
Steps to Reproduce
Context
Your Environment
The text was updated successfully, but these errors were encountered: