5

I've just opened a feature request, but maybe someone knows a temporary solution.

In QGIS 2.2 one can change the default font of the Print Composer (through the Menu Option -> Setttings). But I think it is not possible to do the same with labels.

This is a little bit boring when one has to export a project from a Linux to a Windows machine. In Linux (debian in my case) the default font in Cantarell, font that is not recognized by Windows.

2
  • Did you ever find a solution for this? Would be very worthwhile!
    – Simbamangu
    Commented Dec 8, 2014 at 15:59
  • Hi @Simbamangu, unfortunately not yet. If you take a look at the link of the feature request you will see that it is still open.
    – matteo
    Commented Dec 9, 2014 at 10:56

2 Answers 2

5

As a workaround (or even a solution) you can create a variable (project or global based) with the default font - maybe one that is found on both OSs?

To do that, you can create either a project based variable (only applies to that project) or a global variable (applies to every qgis project).

To make a global variable, click Settings > Options > Variables (pane on left).

To make a project based variable, do this through Project > Project Properties > Variables.

Once you decide if you'd like a project or global variable, hit the green + sign, and for example, make a variable called def_font and with the value Comic Sans.

def_font Comic Sans

Now you can use that variable as the font through a data defined override (expression). See screenshot below where that variable can be applied from Layer Properties > Label (tab)

font variable usage in qgis

Now that variable can be applied to each layer that would use that font, and if you ever need to change the font (for those 20 layers!) just change the def_font variable and voila - it updates all layers referencing that variable.


The above example shows how to change the font face/family but other variables can be created for other font styling changes like bold, size, placement, etc.

2
  • it is possible thanks to the Variable introduction in the last QGIS releases. but, in fact, this is the solution to an old problem
    – matteo
    Commented Mar 24, 2016 at 22:27
  • 1
    Doesn't work for the print composer labels unfortunately
    – Damien
    Commented Aug 30, 2019 at 4:55
0

It is possible, to change the "Default" Text-Style in the "Style Manager": https://docs.qgis.org/3.22/en/docs/user_manual/style_library/style_manager.html This style then is used for new labels (at least in my case). Likely it is as well possible to overwrite the default text style with a new style called "Default".

I hope that this is fairly stable, but I'm just starting to test it.

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.