1

I'm using QGIS 3.16. I have a variable called Projet_font in my projet. My problem is in the layout composer, it doesn't seem to be possible to use this variable to set the font text? Here is as exemple where we set the font for the legend, but there is no place to put my variable @Projet_font. enter image description here

1 Answer 1

0

Unfortunately I don't think it is possible for the default legend. You could render your text as HTML and write an expression like:

[%'
<!DOCTYPE>
<html>
    <head>
        <style>
            .my_text
            {
                font-family:    ' + @Project_font +';
                font-size:      40px;
                font-weight:    bold;
                color: ' + @Project_color + '
            }
        </style>
    </head>

    <body>
        <div class="my_text">some text</div>
    </body>
</html>
'%]
2
  • But it is not possible to render as HTML the legend! Bloc text it is, but not legend bloc.
    – katagena
    Jun 2, 2022 at 14:34
  • No that is not possible Jun 2, 2022 at 16:46

Your Answer

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

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