Skip to content

Commit

Permalink
Initialize default font in labeling engine
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Oct 14, 2012
1 parent d1a66b9 commit d06203b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/qgspallabeling.cpp
Expand Up @@ -155,7 +155,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
yOffset = 0;
angleOffset = 0;
centroidWhole = false;
//textFont = QFont();
textFont = QApplication::font();
textNamedStyle = QString( "" );
textColor = Qt::black;
textTransp = 0;
Expand Down Expand Up @@ -363,6 +363,8 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
if ( layer->customProperty( "labeling" ).toString() != QString( "pal" ) )
return; // there's no information available

// NOTE: set defaults for newly added properties, for backwards compatibility

fieldName = layer->customProperty( "labeling/fieldName" ).toString();
isExpression = layer->customProperty( "labeling/isExpression" ).toBool();
placement = ( Placement ) layer->customProperty( "labeling/placement" ).toInt();
Expand All @@ -373,7 +375,7 @@ void QgsPalLayerSettings::readFromLayer( QgsVectorLayer* layer )
yOffset = layer->customProperty( "labeling/yOffset", QVariant( 0.0 ) ).toDouble();
angleOffset = layer->customProperty( "labeling/angleOffset", QVariant( 0.0 ) ).toDouble();
centroidWhole = layer->customProperty( "labeling/centroidWhole", QVariant( false ) ).toBool();
QString fontFamily = layer->customProperty( "labeling/fontFamily" ).toString();
QString fontFamily = layer->customProperty( "labeling/fontFamily", QVariant( QApplication::font().family() ) ).toString();
double fontSize = layer->customProperty( "labeling/fontSize" ).toDouble();
int fontWeight = layer->customProperty( "labeling/fontWeight" ).toInt();
bool fontItalic = layer->customProperty( "labeling/fontItalic" ).toBool();
Expand Down

0 comments on commit d06203b

Please sign in to comment.