Bug report #8068
Wrong font display in qgis server
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||16907|
Fonts in qgs-server are bigger than in the client, and look much worse (rasterized?). Confirmed in two different installations (one Debian and one RH).
Also, transparencies seem (unconfirmed) to be darker.
This happened recently on master.
#2 Updated by Larry Shaffer over 9 years ago
I believe this may be due to my recent reworking of that part of labeling engine. I'll be working on #3975 next (same area of code) and will also look into this.
I have not worked on QGIS Server before, so I have not assigned myself to the issue, if that is where the issue actually is.
#5 Updated by Andreas Neumann over 9 years ago
Just a quick question.
Are you sure that the fonts are properly installed on QGIS server? I also had font-issues between server and desktop and believed the fonts were intalled, but they were not.
Once I properly installed the fonts, updated the font-cache and restarted Apache, the fonts rendered fine on QGIS server - like on Desktop.
#6 Updated by Paolo Cavallini over 9 years ago
Until a recent qgis server upgrade things worked well. Now checked by setting up all fonts in the project a lmodern and:
aptitude install lmodern dpkg-reconfigure fontconfig-config dpkg-reconfigure fontconfig /etc/init.d/apache2 restart
Results as attached (bigger labels from WMS, smaller from the project). See also http://geosisma-lizmap.faunalia.it (fonts too big, labels overlap each other).
#9 Updated by Michael Douchin over 9 years ago
I have seen that this bug also concerns the composer legend font size in server-side produced pdf. When exporting a composer from QGIS desktop to pdf, font size are correct. When using the getPrint request from the server to do the same export, font size are bigger.
#10 Updated by Jürgen Fischer over 9 years ago
This might also affect tests. Eg. http://dash.orfeo-toolbox.org/testDetails.php?test=18079481&build=123920
#15 Updated by Larry Shaffer over 9 years ago
- Assignee set to Larry Shaffer
- % Done changed from 0 to 70
I finally got some time to start work on this. It appears to be a little of both Server and labeling, but mostly it is a labeling issue.
The basic cause, as far as I can determine, is that the server initializes its default QImage at 75 dpi (why specifically 75?, I can't determine). On Mac, where the default renderer's painter device is 72 dpi, this causes the Desktop fonts to be 1.04 larger than the server's. On other platforms, where the default dpi is higher (say 96), then the server fonts would be shown larger.
I have an adjustment ratio for such a dpi difference for producing print output with labels, but it is triggered only for rasterized output. When I adjusted this to be always on, it fixed the server font issue (at least on my Mac), but then caused complicated issues with the drop shadow implementation.
I will work more on it tonight and clean up the branch/commits so others can test/help. Unfortunately, I have not had the time to build a comprehensive test suite using the new labeling Python API.
There are also a couple of other issues with labeling output (letter-spacing, etc.) that I will work on next, then hopefully I can find the time to produce the test suite to discover more issues.