In QGIS 3.16 I have a 3 lined label
"Projekt" || '\n' || "Art" || '\n' || "Bearb"
How can I make only the text of the first line ("Projekt"
) bold or a bigger size?
In QGIS 3.16 I have a 3 lined label
"Projekt" || '\n' || "Art" || '\n' || "Bearb"
How can I make only the text of the first line ("Projekt"
) bold or a bigger size?
In QGIS 3.16, in label properties, you can check 'render as HTML', so that Labels can be interpreted as HTML code. Than your label can be writed as:
'<b>'||"Projekt"||'</b>' || '<br>' || "Art" || '<br>' || "Bearb"
you use <b></b>
to write bold style and <br>
to change line.
In my solution I have supposed that Projekt,Art and Bearb are attribute name.
HTML Styling in labels is currently limited to colors, but you can work around that by using John's dynamic SVG solutions (see here and here), or by exporting to SVG (keep text as text objects) and edit the labels manually in Inkscape or Illustrator. Also, this feature may be coming soon, as katagena helpfully pointed out here.
Edit: katagena's answer has been removed. See Babel's answer instead.
In 3.16 this is not possible with a single label but in the following QGIS 3.28 (will be released October 2022) this will be implemented. See more at blog post by North Road .
You might use a workaround in 3.16 by using Rule-based labeling and adding each line as own label and defining the vertical offset for each: