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

SVG print exports with wrong font #47017

Open
1 of 2 tasks
kobben opened this issue Jan 26, 2022 · 0 comments
Open
1 of 2 tasks

SVG print exports with wrong font #47017

kobben opened this issue Jan 26, 2022 · 0 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@kobben
Copy link

kobben commented Jan 26, 2022

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:

<style type="text/css"> .st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill-opacity:0;} .st2{fill-rule:evenodd;clip-rule:evenodd;fill:#E8718D;stroke:#232323;stroke-width:0.2399;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:10;} .st3{fill:#323232;} .st4{font-family:'Branding-SemilightItalic';} .st5{font-size:16.0764px;} </style>

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

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.22.2-Białowieża QGIS code revision 1601ec4
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

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

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

@kobben kobben added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 26, 2022
@gioman gioman added the Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

2 participants