6

I have to design a symbology in QGIS following a very strict rulebook. I need to place certain attributes as at exact positions aroud the symbol. Since it is defined as part of the symbol, I do not us labels in this occasion but use font markers in addition to other symbols to create the symbol I need.

However, the text is of varying length. I can define offset and anchor point position but the text is always centred, which means longer text can cover the symbol etc. Is there a way to set the text of the font marker itself to left-justified?

Edit: I am trying to create symbols for certain emergency managment situations. Here is a rather complex example from the rulebook I have to follow for that. I am trying to add text similar to the text fields on the lower right corner of that example: enter image description here

I suppose I can use rule based labels for this, but the style is meant to work in QGIS as well as in QField and a Geoserverapplication that we are supposed to use. In my experience labels tend to get messed quicker than symbols - but I may be mistaken hiere.

0

1 Answer 1

3

A workaround would be to use a constant number of characters and to apply the same offset everywhere. To achieve this, the rpad() function can be used to add spaces to the right of the current text.

It is not perfect though, as different letters have different width.

enter image description here

1
  • Thanks for the hint. This works good enough, but requires some trial and error. Commented Jan 11, 2022 at 19:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.