View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016823 | Scribus | Graphics / Image Frames | public | 2022-07-06 14:42 | 2024-12-18 20:03 |
Reporter | rafael.social.user@gmail.com | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 1.5.8 | ||||
Summary | 0016823: SVG pattern rendering : Scribus not showing correctly SVG | ||||
Description | I designed a SVG simple file, with stripped lines inside. LibreOffice (Writer and Draw) are not able to show the filled pattern. | ||||
Steps To Reproduce | 1.Insert "Rotulo.svg" in any new Impress or Draw document | ||||
Additional Information | Scribus doesn't show SVG content as it should Incorrectly displayed in Scribus and LibreOffice Correctly displayed in any web browser and Inkscape (as you can see inmediately in "attached" file. I notified it to LibreOffice bug tracker https://bugs.documentfoundation.org/show_bug.cgi?id=149880 | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
|
|
Issue is with `fill='url("#rough-1609495203056042")'` being ignored. Imported shape is OK but content is empty |
|
Confirmed. The result of importing this SVG currently looks like: ``` Manjaro 23.1.0 Scribus Version 1.5.9.svn Build ID: C--T-F-C1.15.10-64bit Built: 13 August 2023 Companion Programs: Ghostscript: 10.02.1 Libraries: cairo: 1.15.10 Harfbuzz: 1.7.2 littlecms: 2090 podofo: 0.9.5 poppler: 0.62.0 ``` |
|
I checked the SVG plugin. Patterns are parsed in void SVGPlug::parsePattern(const QDomElement &b) Scribus renders all patterns as an image. Especially for the "GIMP" example, the rendered pattern image is 1x1 px, because the pattern width and height is 1 px too. What is missing is the processing of the viewBox attribute. See here: https://www.w3.org/TR/SVG11/pservers.html#Patterns If I hard code the pattern size in the SVG plugin I get the result below. The pattern is correct, but it is blurry and the clipping is messed. |
|
I must add that LibreOffice fixed issue, maybe their patch could take into account to fix in Scribus this issue. Thank you |
|
Hello Rafael, in case that might help, could you provide the url for the LibreOffice commit ? |
|
I imported the GIMP SVG file in Inkscape and LibreOffice Writer to check how it looks like. Both applications are importing the pattern as vector path. Scribus renders it as image. I think to make a correct fix, we should rethink the rendering / display of the pattern in Scribus. The SVG plugin creates the pattern correctly as PageItem_Polyline, but then it renders it as image to "unify" it for a later usage. Perhaps we should store the vector path information in a ScPattern object and render it at runtime correctly on canvas. In that way, the output renderer can decide how to render the pattern (as image, as vector graphic, as whatever). It seems like it is a bigger research to check how LibreOffice implemented the import. I just found the SVG pattern parser, but it only reads the data in SVG file. BTW the parser handles all attributes defined by WC3, Scribus missed some. https://github.com/LibreOffice/core/blob/master/svgio/source/svgreader/svgpatternnode.cxx Object creation for canvas is somewhere else. I guess LibreOffice implementation doesn't really help us here, because Scribus has a good implementation. It only needs fixes for size calculation of the pattern and perhaps a better way how to import patterns. The clipping issue is not related to patterns, because it doesn't work for solid colors too (at least for the GIMP SVG file). |
|
Hi Jluc I put the LibreOffice bug link to the thread I opened in "Additional information". Simply click that link and you will see how they fixed issue. nitramr, I'm totally agree with you. Scribus should not convert SVG to bitmap. In fact, I always thought Scribus respect SVG content to let user to rescale and reuse vectorial objects. |
|
it looks like the issue for libreoffice was because of the doublequotes in the fill value. AMOF it doesnt make any difference for scribus... but here is the SVG without doublequotes in fill value. |
|
> it looks like the issue for libreoffice was because of the doublequotes in the fill value. is this then an upstream Libreoffice issue that should accommodate the doublequote edgecase ? |
|
Nope luzpaz. LibreOffice had an issue with doublequotes and fixed it. Scribus has a more complex issue as described by nitramr and raphael, and i i can't sum it up. |
|
The ticket probably needs a rename to highlight @nitramr diagnosis |
|
Perhaps I, who reported the problem a long time ago (2022), could change it, but logically, if there is a more appropriate title, it should be the forum administrators who read the responses and rename the ticket accordingly. |
|
rafael, there are a lot of other tickets that are generically named that haven't been renamed. If you don't mind, would you please rename it yourself? |
|
Sincerely, I don't know what to put instead my original title. |
|
jluc has now modified the title and the relevant information seems to be there. btw, the administrator can fix titles that are technically wrong, but if the title should be edited to match new insights on the ticket, then it makes much sense, that it gets fixed by people who understand what is going on. and, even as a reporter, we are all entitled to not understand what is going on behind the scene, and have the feeling that we cannot come up with a better title! and, anyway, two years does not make a scribus ticket old! there are patches that have been setting in here for waaaaaayyyyyy loooooooonger! : - ) |
|
Perfect then. It will always be better if an English speaker changes it, as they will use the most appropriate words. Regarding the time it takes to resolve issues with free software, I am already very clear that time passes in a completely different way for developers than for users, but that is another topic we better not discuss here... :( |
|
Recently I had some more problems with SVG import. There are some things missing in the current implementation (e.g. more clipping path types, vector-based patterns, effects like the Gaussian blur). At first I tried to fix the problems, but the more I worked on the topic, the more I realized that parsing SVG can become very complex. I think we should consider an external library that acts as a preprocessor. In theory, we would then only have to write an adapter that transfers the simplified structure into Scribus elements. The biggest problem at the moment is resolving inherited or linked styles. I have looked at some libraries, such as lunaSVG or usvg, that could possibly be suitable. However, it needs some testing. Especially since these libraries have some dependencies that are already implemented in Qt (e.g. QImage or QTransform). References: https://github.com/styluslabs/usvg https://github.com/sammycage/lunasvg |
|
Using a library reads like the way to go for such a complex but standard job |
|
> external library Sounds like a good idea |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-07-06 14:42 | rafael.social.user@gmail.com | New Issue | |
2022-07-06 14:42 | rafael.social.user@gmail.com | File Added: Rotulo.svg | |
2022-07-09 12:43 | JLuc | Note Added: 0049725 | |
2023-12-22 16:04 | luzpaz | Note Added: 0050686 | |
2023-12-22 16:04 | luzpaz | File Added: Screenshot_20231222_110318.png | |
2023-12-22 16:20 | JLuc | Relationship added | child of 0002931 |
2023-12-26 19:09 | nitramr | Note Added: 0050697 | |
2023-12-26 19:09 | nitramr | File Added: Bildschirmfoto vom 2023-12-26 20-03-54.png | |
2023-12-27 11:40 | rafael.social.user@gmail.com | Note Added: 0050698 | |
2023-12-27 12:30 | JLuc | Note Added: 0050699 | |
2023-12-27 13:44 | nitramr | Note Added: 0050700 | |
2023-12-27 16:12 | rafael.social.user@gmail.com | Note Added: 0050702 | |
2024-11-26 20:19 | nitramr | Relationship added | related to 0015838 |
2024-11-28 10:57 | JLuc | Note Added: 0051678 | |
2024-11-28 10:57 | JLuc | File Added: Rotulo_nodoublequotes.svg | |
2024-11-28 15:00 | luzpaz | Note Added: 0051683 | |
2024-11-28 15:08 | JLuc | Note Added: 0051685 | |
2024-12-16 14:42 | luzpaz | Note Added: 0051736 | |
2024-12-16 16:32 | JLuc | Summary | Scribus not showing correctly SVG => SVG pattern rendering : Scribus not showing correctly SVG |
2024-12-16 18:30 | rafael.social.user@gmail.com | Note Added: 0051738 | |
2024-12-16 18:52 | luzpaz | Note Added: 0051739 | |
2024-12-16 23:37 | rafael.social.user@gmail.com | Note Added: 0051741 | |
2024-12-17 06:01 | ale | Note Added: 0051742 | |
2024-12-17 08:51 | rafael.social.user@gmail.com | Note Added: 0051743 | |
2024-12-17 09:28 | nitramr | Note Added: 0051744 | |
2024-12-17 09:52 | JLuc | Note Added: 0051746 | |
2024-12-17 09:52 | JLuc | Note Edited: 0051746 | |
2024-12-18 14:39 | luzpaz | Note Added: 0051749 | |
2024-12-18 20:03 | JLuc | Note Edited: 0051746 |