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.65k stars 3.01k forks source link

SVG print exports with wrong font #47017

Open kobben opened 2 years ago

kobben commented 2 years ago

What is the bug or the crash?

Text export of SVG in print layouts is buggy. My main problem is that the exported file uses fonts that are not always the correct one (specifically the wrong font variations).

My test case shows that a 'simple' font such as Helvetica-Regular is correct exported:

Litli-Árskógssandur

But more 'complicated' fonts (with more variations) such as Branding-Medium gets exported wrongly:

The underlying problem/cause seems to be that the former is using 'simple' structure with "font-family", whereas the latter uses css styles (wrongly)....

Attached .zip file has both full SVG files , plus test data and settings.

Steps to reproduce the issue

From the attached zip archive, open test_font_output.cgz and open the print layout and print to SVG output . Changing the font in the Label settings to 'Branding Medium' (see the settings in the .png files) will cause the said problem

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.22.2-Białowieża | QGIS code revision | 1601ec46d0 -- | -- | -- | -- Qt version | 5.15.2 Python version | 3.9.5 GDAL/OGR version | 3.3.2 PROJ version | 8.1.1 EPSG Registry database version | v10.028 (2021-07-07) GEOS version | 3.9.1-CAPI-1.14.2 SQLite version | 3.35.2 PDAL version | 2.3.0 PostgreSQL client version | 12.3 SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.11.5 OS version | macOS 12.1   |   |   |   Active Python plugins QuickOSM | 1.17.1 quick_map_services | 0.19.19 pdokservicesplugin | 3.6.0 karika | 1.5 ImportPhotos | 2.2.2 processing | 2.12.99 sagaprovider | 2.12.99 grassprovider | 2.12.99 db_manager | 0.1.20 MetaSearch | 0.3.5

Supported QGIS version

New profile

Additional context

Find the mention ZIP file with test data at https://kartoweb.itc.nl/fileshare/public/test_font_output.zip

YoannQDQ commented 1 month ago

Related to #49979