I read the QGIS 3.2 Changelog and saw a new feature to add text on top of symbols for vector layers. Does anyone knows how to do this?
As J.R. pointed out, the feature mentioned in the 3.2 changelog is a LEGEND feature, meaning that the text is added on top of the legend, not on the map symbology. ahmadhanb perfectly explained how to implement this feature. If you want to display text on top of the map symbols, see below.
Here's how to add text on top of the symbols on the map:
Method One: non-repeating text (once per feature)
Open the Labels tab of the Layer Styling Panel. Choose "single labels" from the first drop-down menu. If your label text is stored in an attribute table field, select that field from the
Label with dropdown menu. If you want to label each feature with the same text, simply type that text into the
Label with text box, surrounded by single quotation marks. Eg, to display the text
thisismylabel on each feature, type
Method Two: repeating text
In the Symbology tab of the Layer Styling Panel, add a symbol level. If using a categorized symbol, click the Change symbol button, then add a symbol level.
Change the new symbol level to a point marker, and change the marker type to font marker.
In the font marker section, scroll down to the symbol selector area. Click the 'data-defined settings button' next to the symbol selector, and choose the field with the label text.
Now you should see repeating text on every polygon.
To access the settings for how far apart the text markers are spaced, highlight 'point pattern fill' in the symbol layer display.