-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add 'textLength' attribute to <svg:tspan> elements in SVG export #44
Comments
I also already had this problem when implementing the rendering of KText elements for the Sprotty-based viewer of KLighD. For that platform, I implemented the SVG rendering with that attribute here as well, however, I found out that also may cause a slightly inconsistent look between glyphs in different texts on other platforms not natively supporting the font. A solution for optimal consistency would be to only use open and free-to-use fonts and include them in the viewer and the SVGs directly. If you find another solution that preserves the texts in the SVG (not rasterizing them or converting them to paths), please let me know. |
That's for sure, but we're hopefully getting closer...
Ok, but I guess that will never happen :-/ |
I did some experiments with the generation of the more precisely only the last This seems to be documented here: https://bugs.chromium.org/p/chromium/issues/detail?id=375258 Consequence: I'm thinking about dropping the |
Btw. Firefox seem to not handle |
This is exactly why I also opted to only use |
Unfortunately, that's only partly helpful. On the one hand I'm not trained in reading tsx, and the freeHEP SVG builder has its own sophistications on the other hand. Thanks anyway ;-) |
…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'
…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'
…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'
…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'
…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'
…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'
…ents in changes for #44 as suggested by reviewers
…ents in changes for #44 as suggested by reviewers
…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'
…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'
…ents in changes for #44 as suggested by reviewers
@NiklasRentzCAU, @soerendomroes we can close this, right? |
Yes, the PR for this issue is merged into master and we did not notics any further problems regarding this issue. |
…space: pre' styling for multi-line text label in the freehep-based SVG generation appears to me like some collateral damage of the solution of #44, updated tests
…space: pre' styling for multi-line text label in the freehep-based SVG generation appears to me like some collateral damage of the solution of #44, updated tests
SVG exports of diagrams suffer (and will always suffer) from the different text renderings on different machines, and worse, even in different browsers on the same machine.
I just figured out that the SVG elements
<text>
and<tspan>
offer the attributestextLength
andlengthAdjust
, which I wasn't aware of. See also https://codepen.io/tigt/post/more-robust-svg-text-with-lengthadjust-and-font-size-adjustHence, it would be valuable to add the designated
textLength
value to the generated SVG output and check whether that improves the portability of SVG exports.The text was updated successfully, but these errors were encountered: