Skip to content
Permalink
Browse files
labeling: fix missing fonts warning
  • Loading branch information
jef-n committed Jul 27, 2013
1 parent 8b5f22e commit 51dbbe13578d2232689eaff94ab741840242d829
Showing with 16 additions and 11 deletions.
  1. +11 −9 src/app/qgslabelinggui.cpp
  2. +2 −1 src/core/qgsfontutils.cpp
  3. +2 −0 src/core/qgspallabeling.cpp
  4. +1 −1 src/ui/qgslabelingguibase.ui
@@ -48,7 +48,8 @@
QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QWidget* parent )
: QWidget( parent ), mLBL( lbl ), mLayer( layer ), mMapCanvas( mapCanvas )
{
if ( !layer ) return;
if ( !layer )
return;

setupUi( this );
mCharDlg = new QgsCharacterSelectorDialog( this );
@@ -111,8 +112,8 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
break;
case QGis::NoGeometry:
break;
default:
Q_ASSERT( 0 && "NOOOO!" );
case QGis::UnknownGeometry:
qFatal( "unknown geometry type unexpected" );
}

// show/hide options based upon geometry type
@@ -281,8 +282,6 @@ void QgsLabelingGui::init()
case QgsPalLayerSettings::Free:
radPolygonFree->setChecked( true );
break;
default:
Q_ASSERT( 0 && "NOOO!" );
}

if ( lyr.placement == QgsPalLayerSettings::Line || lyr.placement == QgsPalLayerSettings::Curved )
@@ -366,9 +365,9 @@ void QgsLabelingGui::init()
updateFont( mRefFont );

// show 'font not found' if substitution has occurred (should come after updateFont())
mFontMissingLabel->setVisible( !lyr.mTextFontFound );
if ( !lyr.mTextFontFound )
{
mFontMissingLabel->setVisible( true );
QString missingTxt = tr( "%1 not found. Default substituted." );
QString txtPrepend = tr( "Chosen font" );
if ( !lyr.mTextFontFamily.isEmpty() )
@@ -565,7 +564,9 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
lyr.placement = QgsPalLayerSettings::Free;
}
else
Q_ASSERT( 0 && "NOOO!" );
{
qFatal( "Invalid settings" );
}


lyr.textColor = btnTextColor->color();
@@ -1048,7 +1049,7 @@ void QgsLabelingGui::updateFont( QFont font )
}

// test if font is actually available
mFontMissingLabel->setVisible( QgsFontUtils::fontMatchOnSystem( mRefFont ) );
mFontMissingLabel->setVisible( !QgsFontUtils::fontMatchOnSystem( mRefFont ) );

mDirectSymbLeftLineEdit->setFont( mRefFont );
mDirectSymbRightLineEdit->setFont( mRefFont );
@@ -1115,7 +1116,8 @@ void QgsLabelingGui::updatePreview()
}
else // in points
{
previewFont.setPointSize( fontSize );
if ( fontSize > 0 )
previewFont.setPointSize( fontSize );
mPreviewSizeSlider->setEnabled( false );
grpboxtitle = sampleTxt;

@@ -53,7 +53,8 @@ bool QgsFontUtils::fontFamilyMatchOnSystem( const QString& family, QString* chos
{
// full 'family [foundry]' strings have to match
*match = ( *it == family );
if ( match ) { break; }
if ( *match )
break;
}
else
{
@@ -1778,6 +1778,7 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
}
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception" ).arg( f.id() ), 4 );
return;
}
@@ -2085,6 +2086,7 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
}
catch ( QgsCsException &e )
{
Q_UNUSED( e );
QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception on data-defined position" ).arg( f.id() ), 4 );
return;
}
@@ -1287,7 +1287,7 @@
font-style: italic;</string>
</property>
<property name="text">
<string notr="true">missing font text</string>
<string>Font is missing.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

0 comments on commit 51dbbe1

Please sign in to comment.