I want to make labels automatically smaller so they fit within the polygons. The biggest font-size is 12 and I want to decrease the font-size to be restricted to the boundary of the polygons.

There is a time consuming option using the field calculator by using the polygons area field. Is there another way like using a plugin or similar to reduce the font-size automatically?

enter image description here

  • have you found any workaround for this problem ?
    – geogeek
    Sep 17, 2015 at 13:38

2 Answers 2

  • You can make the font size constant in metres rather than points, so it will scale with the map. In Layer Styling, select Metres at Scale instead of Points.

  • You can also make the size in points (or metres) a function of polygon area, using an expression.

    The polygons below are 10000 square km on the outside, and smaller in the middle of the map. The expression for the size (metres at scale) was simple:


    A more complex formula may be useful.

enter image description here

Zoomed in, it scales with the map:

enter image description here

You can base the font size on the area of the polygon.

  • this works for larger polygons but smaller polygons have illegible text. Is there a way of setting a minimum font size so font doesn't get too small?
    – Theo F
    Jun 21, 2022 at 20:57
  • 1
    Did you look at the available functions? You could use a CASE statement to check for a minimal area, etc. Don’t be afraid to look at the functions in the expression builder.
    – wingnut
    Jun 23, 2022 at 4:40
  • I found an elegant solution here: gis.stackexchange.com/questions/376037/…
    – Theo F
    Jun 26, 2022 at 14:25

Not sure if you have already tried this but you can edit the placement of your labels:

Layer properties > Labels > Placement

Select Offset from centroid and choose the whole polygon and the centre quadrant.

Layer properties label

Unless you also edit the Scale-based visibility in the Rendering section (Layer properties > Labels > Rendering), the labels will constantly appear at the same size when zooming in or out which may result in labels exceeding the perimeters of the polygon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.