Skip to content

Commit d06203b

Browse files
committedOct 14, 2012
Initialize default font in labeling engine
1 parent d1a66b9 commit d06203b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
155155
yOffset = 0;
156156
angleOffset = 0;
157157
centroidWhole = false;
158-
//textFont = QFont();
158+
textFont = QApplication::font();
159159
textNamedStyle = QString( "" );
160160
textColor = Qt::black;
161161
textTransp = 0;
@@ -363,6 +363,8 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
363363
if ( layer->customProperty( "labeling" ).toString() != QString( "pal" ) )
364364
return; // there's no information available
365365

366+
// NOTE: set defaults for newly added properties, for backwards compatibility
367+
366368
fieldName = layer->customProperty( "labeling/fieldName" ).toString();
367369
isExpression = layer->customProperty( "labeling/isExpression" ).toBool();
368370
placement = ( Placement ) layer->customProperty( "labeling/placement" ).toInt();
@@ -373,7 +375,7 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
373375
yOffset = layer->customProperty( "labeling/yOffset", QVariant( 0.0 ) ).toDouble();
374376
angleOffset = layer->customProperty( "labeling/angleOffset", QVariant( 0.0 ) ).toDouble();
375377
centroidWhole = layer->customProperty( "labeling/centroidWhole", QVariant( false ) ).toBool();
376-
QString fontFamily = layer->customProperty( "labeling/fontFamily" ).toString();
378+
QString fontFamily = layer->customProperty( "labeling/fontFamily", QVariant( QApplication::font().family() ) ).toString();
377379
double fontSize = layer->customProperty( "labeling/fontSize" ).toDouble();
378380
int fontWeight = layer->customProperty( "labeling/fontWeight" ).toInt();
379381
bool fontItalic = layer->customProperty( "labeling/fontItalic" ).toBool();

0 commit comments

Comments
 (0)
Please sign in to comment.