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

Changed SVG generation of KTexts #52

Merged
merged 5 commits into from
Sep 18, 2020
Merged

Changed SVG generation of KTexts #52

merged 5 commits into from
Sep 18, 2020

Conversation

sailingKieler
Copy link
Member

Hey guys, please test the SVG generation with your applications, if possible, and let me know if you see any problems.

…tion to enable the generation of 'textLength' property values for '<text>' elements in SVGs (#44)

 * added flag in 'KlighdPaintContext',
 * added checkbox in 'SaveAsImageDiaglog' and related export data records
 * moved some recently misplaced properties from 'SVGOffscreenRenderer' to 'IOffscreenRenderer'
…nRenderingTest'

* extracted logic for reveal test size data of KTexts in 'PlacementUtil'
* included incorporation of test size data in 'KlighdStyledText'
* switched to order preserving map impls in 'KlighdSemanticDiagramData'
* refined 'SemanticSVGGraphics2D' here and there, dropped clipping around <text> elements
…SVG exporter to generate multi-line texts as a group of <text> elements instead of <tspan> elements (#44)

* abolished generation of '<tspan>' elements entirely
* updated 'FreeHEPSVGOffscreenRenderingTest'
@sailingKieler
Copy link
Member Author

See also #44

@NiklasRentzCAU
Copy link
Member

Generally looks good and now similar to the result that the Klighd-Sprotty view generates. There are still two minor problems I found:

  1. The new checkbox for saving the graph as an image is not fully contained in the wizard.
    Screenshot from 2020-07-17 08-30-24
  2. Either the text size estimation does not include leading or trailing white space characters or the internal SVG Viewer of Eclipse does something wrong with that:
    Screenshot from 2020-07-17 08-42-14-2
    This shows that the text spans only the area it should, but the trailing space that is in the texts "input bool " and "output bool " seems to be ignored. However, when viewing the same SVG in Inkscape this problem does not occur. In my code I found this line in the text rendering:
    ...{ 'xml:space': 'preserve' } // This attribute makes the text size estimation include any trailing white spaces.
    So adding the attribute xml:space="preserve" here also might improve the overall spacing.

@sailingKieler
Copy link
Member Author

@NiklasRentzCAU and @uruuru thanks for the feedback, I'll take care about it on occasion.

@sailingKieler
Copy link
Member Author

Reported issues should be fixed now.
@NiklasRentzCAU I would appreciate if you could test the dialog as well as the SVG export with labels containing whitespace.
Thanks!

Copy link
Member

@NiklasRentzCAU NiklasRentzCAU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Works as expected.

@sailingKieler
Copy link
Member Author

@NiklasRentzCAU or @soerendomroes please merge these changes before preparing the next release.
I'm off this week and rather busy next week, so I won't have time to care. I ask "my customer" about their tests and didn't hear any complaints yet.

@NiklasRentzCAU NiklasRentzCAU merged commit 307dc41 into master Sep 18, 2020
@sailingKieler sailingKieler deleted the cs-44svgRefac branch October 26, 2020 12:05
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

Successfully merging this pull request may close these issues.

3 participants