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
.
1 Answer
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>
'%]
-
But it is not possible to render as HTML the legend! Bloc text it is, but not legend bloc.– katagenaJun 2, 2022 at 14:34
-