5

Is there a way to set the labels size of font to fit the scale of the map in the composer window but also to fit in the main window?

The map in the composer is size A0 and the scale is 1:5000. In order to see the labels clearly in the composer, I set the labels font size to 23. So in the main window it's too large but in the composer it's OK.

1 Answer 1

9

In the labels properties choose a data defined properties for the size (drop-down menu on the right of the field) and plug-in this expression.

CASE
WHEN  $map='mymapincomposer' THEN 23
WHEN  $map='canvas' THEN 8
ELSE 12
END

You'll just have to replace 'mymapincomposer' by the name of the map item in your composition. Just adapt the expression if you have multiple composers. please note the id name for the main windows is 'canvas'.

Enjoy!

1
  • Should be @map_id = 'canvas' in QGIS 2.18 for example.
    – gisnside
    Commented Jun 19, 2018 at 14:44

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.