diff --git a/src/core/qgstextrenderer.cpp b/src/core/qgstextrenderer.cpp index 6e1eb79dc1a..b78d5ef4e61 100644 --- a/src/core/qgstextrenderer.cpp +++ b/src/core/qgstextrenderer.cpp @@ -1382,8 +1382,8 @@ void QgsTextFormat::readFromLayer( QgsVectorLayer* layer ) if ( layer->customProperty( QStringLiteral( "labeling/fontSizeUnit" ) ).toString().isEmpty() ) { - d->fontSizeUnits = layer->customProperty( QStringLiteral( "labeling/fontSizeInMapUnits" ), 0 ).toUInt() == 0 ? - QgsUnitTypes::RenderPoints : QgsUnitTypes::RenderMapUnits; + d->fontSizeUnits = layer->customProperty( QStringLiteral( "labeling/fontSizeInMapUnits" ), QVariant( false ) ).toBool() ? + QgsUnitTypes::RenderMapUnits : QgsUnitTypes::RenderPoints; } else {