I am trying to change the font size of the feature labels based on attributes from a field. I can't find an example of how to do this.
I believe I can do this by setting up a data defined expression in the Labels
>Text
>Size
expression but I am not sure how to formulate the actual expression.
I am looking for an example of how this expression would be set up.
Best Answer
Firstly, go on the
Layer Properties
>Labels
>Text
window.Then, edit the expression for the text size (I marked it in the image below):
In the expression field, simply write the name of the field which stores the sizes for the fonts of the labels. In my case, the field was called
font_height
, so I wrote (remember to use these" "
):Finally, click on the Apply button and this will be the result: