Project: QGIS

Version: 3.26

Feature: Control label anchor placement relative to text position

A control is now provided for defining what part of the text (start, middle, or end) of line labels correspond to the anchor position defined in label placement. This allows for more precise placement of labels according to specific requirements, such as lining up the end of a labels text with a specific point on a line feature.

In prior releases of QGIS, labels would always be centered over the anchor position of lines, unless it was a curved label, which used the start of the label for determining the anchor orientation.

A new option for "Follow placement" has also been added, which means that the text anchor will depend on the placement along line setting. This control attempts to determine the appropriate alignment option automatically according to the label placement on the feature and exhibits the following behaviors:

  • For labels anchored near the start of the line (0-25%), the anchor placement will be the start of the label text
  • For labels anchored near the end of the line (75-100%), the anchor placement will be the end of the label text
  • For anchor placements between 25 and 75%, the anchor placement will be the center of the label text

This feature was funded by City of Freiburg im Breisgau

This feature was developed by Nyall Dawson (North Road Consulting)