qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.44k stars 2.99k forks source link

Multi-line text in a SVG file is not drawn correctly in Print Composer #11856

Open qgib opened 15 years ago

qgib commented 15 years ago

Author Name: craigleat - (craigleat -) Original Redmine Issue: 1796 Affected QGIS version: 3.0.0 Redmine category:map_composer/printing


The attached file is an inkscape SVG containing an A2 titleblock. The multi-line text is drawn on a single line when the SVG is imported into Print Composer.


qgib commented 15 years ago

Author Name: craigleat - (craigleat -)


This bug was created from: http://trac.osgeo.org/qgis/ticket/1647

qgib commented 15 years ago

Author Name: Giovanni Manghi (@gioman)


This is duplicate of #11707 (see below the last comment) and seems to be not a qgis problem.

Multiline text often fails to import correctly. There are two possible solutions (outside of QGIS):

* Fix the import problems in QT (I believe that's the desired route) 

* Fix the Inkscape export - which is theoretically standards compliant - but a bit awkward as it outputs everything in styles and uses strange repeated/redundant style and placement attributes. Once the attributes are cleaned up manuall, QGIS importst the SVGs fine

I would recommend fixing both issues - but it is somehow outside the scope of QGIS. So I guess we can really close this bug. It's probably not solved but it can't be solved in QGIS directly.

We should knock on Nokia/Trolltech and Inkscape door to get this fixed.
qgib commented 15 years ago

Author Name: craigleat - (craigleat -)


I don't think it is a duplicate since #11707 is an enhancement and moreover has been closed. The current bug should remain open until fixed since it affects usability. If it needs to be fixed upstream then great it won't consume our devs' time.

qgib commented 15 years ago

Author Name: craigleat - (craigleat -)


Replying to [comment:2 lutra]:

  • Fix the Inkscape export

Inkscape appears to work correctly as the SVG file attached to this ticket displays properly in Firefox. The problem seems to be with QGIS or its dependencies.

qgib commented 15 years ago

Author Name: Marco Hugentobler (@mhugent)


This is most likely a bug in the Qt svg code

qgib commented 15 years ago

Author Name: craigleat - (craigleat -)


Replying to [comment:6 mhugent]:

This is most likely a bug in the Qt svg code

Marco, are you able to report this on the Qt Task Tracker? Sorry, but I don't feel I know enough Qt to make a meaningful bug report.

http://qt.nokia.com/developer/task-tracker

qgib commented 12 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 12 years ago

Author Name: Paolo Cavallini (@pcav)


qgib commented 12 years ago

Author Name: Paolo Cavallini (@pcav)


qgib commented 10 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 10 years ago

Author Name: Nyall Dawson (@nyalldawson)


qgib commented 10 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 8 years ago

Author Name: Médéric RIBREUX (Médéric RIBREUX)


Hello, bug triage...

this bug is still present in QGIS 2.13 master.


qgib commented 8 years ago

Author Name: Médéric RIBREUX (Médéric RIBREUX)


qgib commented 8 years ago

Author Name: Médéric RIBREUX (Médéric RIBREUX)


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 6 years ago

Author Name: Alessandro Sarretta (@alesarrett)


Still present in QGIS 3.0

qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


pjshelton commented 3 years ago

Still an issue on Windows using version 3.16.3 compiled and running against Qt v5.11.2

pjshelton commented 3 years ago

In a short search of the QT issues tracker (https://bugreports.qt.io/browse/), I found these three; 'Qt' QtQTBUG-8137 line breaks in SVG files are not rendered correctly 'Qt' QtQTBUG-69508 QtSvg: newlines get ignored in text fields 'Qt' QtQTBUG-11072 svg with elements when the element has its own text is not displayed correctly

It seems that QT only supports SVG Tiny 1.2 which does not include support for the elements. Inkscape produces full SVG spec code.

So maybe a QGIS documentation issue?

Pedro-Murteira commented 2 years ago

I can no longer reproduce this issue on QGIS 3.22.3. (Windows 10)

pjshelton commented 2 years ago

It still does not work as expected on my computer using QGIS 3.22.3. This is using the svg that was tended in the original post of this bug.

Result, image

expectation, image

version of qgis image

pjshelton commented 2 years ago

As I said a year ago, this is an issue with QT only supporting SVG Tiny 1.2. Until either QGIS or QT fix that issue, this will be a problem for QGIS users.

esnyder-rve commented 2 years ago

A possible solution would be to just bypass Qt and use another library. Could have an all-in-one library which parses and renders the SVG (such as svgren: https://github.com/cppfw/svgren), or just a parser which can be used to setup internal QGIS rendering using QGIS' own geometry and existing rendering classes (such as svgpp: https://github.com/svgpp/svgpp)

The two examples here are just examples, and are not intended to be a "Use this library!" statement. Further research would be needed before picking a library for this suggestion.

SrNetoChan commented 1 year ago

Confirmed in QGIS 3.32.1 (Linux)