@@ -221,7 +221,7 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM
221
221
}
222
222
223
223
mRefFont = lyr.textFont ;
224
- mFontSizeSpinBox ->setValue ( mRefFont .pointSizeF () );
224
+ mFontSizeSpinBox ->setValue ( lyr. textFont .pointSizeF () );
225
225
btnTextColor->setColor ( lyr.textColor );
226
226
mFontTranspSpinBox ->setValue ( lyr.textTransp );
227
227
@@ -583,9 +583,11 @@ void QgsLabelingGui::updateFontViaStyle( const QString & fontstyle )
583
583
{
584
584
QFont styledfont;
585
585
bool foundmatch = false ;
586
+ int fontSize = 12 ; // QFontDatabase::font() needs an integer for size
586
587
if ( !fontstyle.isEmpty () )
587
588
{
588
- styledfont = mFontDB .font ( mRefFont .family (), fontstyle, mRefFont .pointSizeF () );
589
+ styledfont = mFontDB .font ( mRefFont .family (), fontstyle, fontSize );
590
+ styledfont.setPointSizeF ( mRefFont .pointSizeF () );
589
591
if ( QApplication::font ().toString () != styledfont.toString () )
590
592
{
591
593
foundmatch = true ;
@@ -595,7 +597,8 @@ void QgsLabelingGui::updateFontViaStyle( const QString & fontstyle )
595
597
{
596
598
foreach ( const QString &style, mFontDB .styles ( mRefFont .family () ) )
597
599
{
598
- styledfont = mFontDB .font ( mRefFont .family (), style, mRefFont .pointSizeF () );
600
+ styledfont = mFontDB .font ( mRefFont .family (), style, fontSize );
601
+ styledfont.setPointSizeF ( mRefFont .pointSizeF () );
599
602
styledfont = styledfont.resolve ( mRefFont );
600
603
if ( mRefFont .toString () == styledfont.toString () )
601
604
{
@@ -606,6 +609,7 @@ void QgsLabelingGui::updateFontViaStyle( const QString & fontstyle )
606
609
}
607
610
if ( foundmatch )
608
611
{
612
+ // styledfont.setPointSizeF( mRefFont.pointSizeF() );
609
613
styledfont.setCapitalization ( mRefFont .capitalization () );
610
614
styledfont.setUnderline ( mRefFont .underline () );
611
615
styledfont.setStrikeOut ( mRefFont .strikeOut () );
@@ -629,7 +633,7 @@ void QgsLabelingGui::updateFont( QFont font )
629
633
bool missing = false ;
630
634
if ( QApplication::font ().toString () != mRefFont .toString () )
631
635
{
632
- QFont testfont = mFontDB .font ( mRefFont .family (), mFontDB .styleString ( mRefFont ), mRefFont . pointSizeF () );
636
+ QFont testfont = mFontDB .font ( mRefFont .family (), mFontDB .styleString ( mRefFont ), 12 );
633
637
if ( QApplication::font ().toString () == testfont.toString () )
634
638
{
635
639
missing = true ;
@@ -667,8 +671,11 @@ void QgsLabelingGui::updateFont( QFont font )
667
671
void QgsLabelingGui::blockFontChangeSignals ( bool blk )
668
672
{
669
673
mFontStyleComboBox ->blockSignals ( blk );
674
+ mFontCapitalsComboBox ->blockSignals ( blk );
670
675
mFontUnderlineBtn ->blockSignals ( blk );
671
676
mFontStrikethroughBtn ->blockSignals ( blk );
677
+ mFontWordSpacingSpinBox ->blockSignals ( blk );
678
+ mFontLetterSpacingSpinBox ->blockSignals ( blk );
672
679
}
673
680
674
681
void QgsLabelingGui::updatePreview ()
0 commit comments