Bug report #8068

Wrong font display in qgis server

Added by Paolo Cavallini over 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Larry Shaffer
Category:Labelling
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

Description

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.

labels.png (232 KB) Paolo Cavallini, 2013-06-24 02:54 AM


Related issues

Related to QGIS Application - Bug report #8413: Labels backgrounds are not correctly aligned in QGIS serv... Closed 2013-08-05

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Priority changed from Normal to Severe/Regression

Confirmed the issue with font sizes. I cannot see any problem with transparencies of both features or labels.

#2 Updated by Larry Shaffer over 6 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.

#3 Updated by Larry Shaffer over 6 years ago

Assuming this is for fonts defined as points (is it?), as a test, could you see if it also happens when a font size is defined in map units (like UTM meters)?

#4 Updated by Giovanni Manghi over 6 years ago

Larry Shaffer wrote:

could you see if it also happens when a font size is defined in map units (like UTM meters)?

yes

#5 Updated by Andreas Neumann over 6 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 6 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).

#7 Updated by Paolo Cavallini over 6 years ago

#9 Updated by Michael Douchin over 6 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.

#11 Updated by Nathan Woodrow over 6 years ago

Should this be blocking QGIS Desktop when it's server related?

#12 Updated by Paolo Cavallini over 6 years ago

AFAIK we are releasing both together, so blockers for one is blocking also the other.

#13 Updated by Marco Hugentobler over 6 years ago

  • Category changed from QGIS Server to Labelling

Should this be blocking QGIS Desktop when it's server related?

It is most likely labeling related.

#14 Updated by Paolo Cavallini over 6 years ago

This is also my understanding. It appeared after a Larry modification of the labelling.

#15 Updated by Larry Shaffer over 6 years ago

  • Assignee set to Larry Shaffer
  • % Done changed from 0 to 70

Hi,

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.

#16 Updated by Giovanni Manghi about 6 years ago

  • Target version set to Future Release - High Priority

#17 Updated by Karl-Magnus Jonsson almost 6 years ago

Hi,
can we expect this issue to be fixed in version 2.2? It would really be appreciated. We havn't upgraded our production server to 2.0 yet and that's too bad.

#18 Updated by Evgeniy Nikulin almost 6 years ago

It's blocker. We can not use the server > 1.8.

#19 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

In the latest master code for qgis server seems that things are ok. I tested on both Linux (ubuntu) and Windows (osgeo4w).

Please reopen if necessary.

Also available in: Atom PDF