Question: 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?

[![enter image description here](https://i.stack.imgur.com/7BcWn.png)](https://i.stack.imgur.com/7BcWn.png)

Answer: 
Right-click the the target layer `-> Properties -> Legend` and click on Set Labels from expression:

[![enter image description here](https://i.stack.imgur.com/oxGey.png)](https://i.stack.imgur.com/oxGey.png)

In expression you can write whatever you want, for example:

```
 substr( "FieldName",4,1)

```

Click Apply and OK

[![enter image description here](https://i.stack.imgur.com/KUaqs.png)](https://i.stack.imgur.com/KUaqs.png)

Output:

[![enter image description here](https://i.stack.imgur.com/hLJwj.png)](https://i.stack.imgur.com/hLJwj.png)
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 `'thisismylabel'`.

[![enter image description here](https://i.stack.imgur.com/GEDWs.png)](https://i.stack.imgur.com/GEDWs.png)

**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.

[![enter image description here](https://i.stack.imgur.com/nhbfp.png)](https://i.stack.imgur.com/nhbfp.png)

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.

[![enter image description here](https://i.stack.imgur.com/GrD4F.png)](https://i.stack.imgur.com/GrD4F.png)

Now you should see repeating text on every polygon.

[![enter image description here](https://i.stack.imgur.com/3Lw81.png)](https://i.stack.imgur.com/3Lw81.png)

To access the settings for how far apart the text markers are spaced, highlight 'point pattern fill' in the symbol layer display.

[![enter image description here](https://i.stack.imgur.com/afI3y.png)](https://i.stack.imgur.com/afI3y.png)