Closed danceb closed 1 year ago
I modified the comment above, because the mounts of the fonts and plugin folders where not correctly. Changed it to the folders mentioned in the readme, but still getting the same errors.
I tried to set the environmental variable FcgidInitialEnv QT_QPA_FONTDIR "/usr/local/share/fonts"
within qgis-server.conf.template
related to https://github.com/qgis/QGIS/issues/51688, but this doesn't change anything.
How can we detect, if this is a issue which comes from the qgis server itself or from the adjustments made while building a custom image based on it?
@HusseinKabbout Any ideas?
To simplify the test case more, I left over my own building attempts with a custom Dockerfile and entrypoint.sh and just pulled your image and configured it within the docker-compose.yml and mount the font folder there:
qwc-qgis-server:
image: sourcepole/qwc-qgis-server:3.28.6
restart: unless-stopped
volumes:
- ./volumes/qgs-resources/stage:/data:ro
- ./volumes/geodata/stage:/geodata:ro
- ./pg_service.stage.conf:/etc/postgresql-common/pg_service.conf:ro
- ./qwc-qgis-server/fonts:/usr/local/share/fonts
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
security_opt:
- apparmor=unconfined
until 3.28.5 the legend is generated correctly with the mounted custom font and since 3.28.6 this does not work anymore.
@HusseinKabbout Any (new) thoughts about this?
The fonts are listed when starting the container. Are your additional fonts missing in the output? Latest LTR version is 3.28.10.
Yes, the custum font is listed correctly, Arial in my case:
qwc-qgis-server_1 | /usr/local/share/fonts/Arial.ttf: Arial:style=Standard,Normal,obyčejné,Κανονικά,Regular,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
So the mounting seems to work.
But this is a sample legend image with 3.28.5:
And this what it lools like with a newer version (3.28.10 here):
So the custom font is not used for creating the legend image.
Could you try to mount the custom fonts in /usr/share/fonts/truetype
instead?
Looking at the legend output in the given resolution, I can't spot a difference in the font. Are you sure, that not only the font size differs?
Thats exactly the thing I recognized at this moment. I think the standard font size of the getLegendGraphics request from qgis server has changed and this result in confusing me ... So everything should be fine here.
I specified the correct font now via the extraLegendParameters in the config.json and it is loaded correctly.
However I am getting QFont::fromString: Invalid description '(empty)'
within the log, but this is not related to this issue here, I guess.
To include additional fonts, change the locale and other things I am building an own qwc-qgis-server image based on yours. Since the Dockerfile and entrypoint.sh files are changed plainly, I had to rewrite our files as well to work with the current versions of qgis server. Unfortunately I don't get the fonts work properly. They are used within GetMap requests and also on the print templates in a correct way. But in the legendGraphics the font is not used and I am getting the following error within the logs:
Any hints, where this could come from?
My Dockerfile:
My entrypoint.sh
Any ideas would be very helpful, thanks!