Custom text appearance in QGIS

At a first glance when you add a label the options that QGIS offers to change the appearance of a text seem very limited, especially when you migrate from Arc, which offers a nice variety of predefined text styles. Below you can see the options you get in QGIS by default. There are options for changing fonts font style, font color but no options to add a shadow or a border around the text, effects that are quite common when creating maps. In the next figure you can see the default appearance, which in my case its not looking nice as the background colors are very saturated.

qgis_fonts1 qgis_fonts2

Here is the magic of QGIS:

There is a tick box Render as HTML right below where you type the text, that allows you to use html expressions to define text.

So instead of writing Willows as text you can add for example

which produce exactly the effect I was going for.

You can further tweak the appearance of the border by changing the 5px number to adjust the thickness and the color by inserting any html color code (https://htmlcolorcodes.com/).

The results with the above settings is:

qgis_fonts3

As you may have already guessed this opens endless possibilities for text styles.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *