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

Setting a database field in font symbol for complex labelling won't render #36944

Closed
M-Rick opened this issue Jun 3, 2020 · 0 comments · Fixed by #36945
Closed

Setting a database field in font symbol for complex labelling won't render #36944

M-Rick opened this issue Jun 3, 2020 · 0 comments · Fixed by #36945
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling

Comments

@M-Rick
Copy link

M-Rick commented Jun 3, 2020

Describe the bug
For complex labelling feature I need to use symbols markers.
They have the advantage to be able to combine multiple items altogether.
Also, they are currently the only "easy" solution to associate many SVG symbols, with different markers, fonts, texts and colours of any kind.

Capture d’écran 2020-06-03 à 23 29 40

Capture d’écran 2020-06-03 à 23 29 23

In one of the latest nightly, it is even possible to select the font style like this (Thin Italic).

Capture d’écran 2020-06-03 à 23 25 22

Unfortunately, there is a bug in the Characters Expressions editor for the Font marker making almost impossible to use any of the fields of the current database. It may work sometimes, but most of the time it won't display anything. In the examples above, the route numbers did work.I don't know why. I tried with String values, Integer values, converted Integers into String in calculation fields and couldn't get any result. Text is universal UTF 8. I tried by creating a virtual field with calculation, keeping the same king and just using my working field as an entry and then used this virtual field, the route numbers disappeared!
As a result, You need to write text manually in the text box entry. It is acceptable for a single feature, but for a couple ones it won't. The only way will be by creating a SVG including all the necessary items for each feature. But all the benefices of a GIS are lost in this case and it's time consuming.

How to Reproduce

Quite easy to reproduce.

Select a feature, whatever the kind, it doesn't matter.

Create a new label feature and use ' ' as value (to avoid text rendering).

Then in Background create a new symbol marker.
Use a Font Marker and in the text box write a space (or it won't do anything) and then select any database filed in the Characters Expressions editor at the very bottom of the window.

Capture d’écran 2020-06-03 à 21 20 44

Valid your changes and refresh your map, nothing should be displayed unless you write text by hand. The length has no importance.

QGIS and OS versions

I use QGIS 3.10.6, but tried in nightly and with Windows version with no better results.
Mac OS 10.14.6 'Mojave'

Additional context

In order to save time, I join a pre-made labelling style.
Test labels.qml.zip

@M-Rick M-Rick added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 3, 2020
@nyalldawson nyalldawson self-assigned this Jun 3, 2020
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 3, 2020
@gioman gioman added the Labeling Related to QGIS map labeling label Jun 4, 2020
nyalldawson added a commit that referenced this issue Jun 4, 2020
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! Labeling Related to QGIS map labeling
Projects
None yet
3 participants