Skip to content
Permalink
Browse files

Disabled test run

  • Loading branch information
nyalldawson committed May 12, 2020
1 parent 7dfc510 commit 678fa8897378d3b8dc5010e0dc4d27e6f4c79691
Showing with 15 additions and 7 deletions.
  1. +13 −7 src/core/textrenderer/qgstextcharacterformat.cpp
  2. +2 −0 src/core/textrenderer/qgstextcharacterformat.h
@@ -22,6 +22,8 @@ QgsTextCharacterFormat::QgsTextCharacterFormat( const QTextCharFormat &format )
#if 0 // settings which affect font metrics are disabled for now
, mFontWeight( format.hasProperty( QTextFormat::FontWeight ) ? format.fontWeight() : -1 )
, mItalic( format.hasProperty( QTextFormat::FontItalic ) ? ( format.fontItalic() ? BooleanValue::SetTrue : BooleanValue::SetFalse ) : BooleanValue::NotSet )
, mFontPointSize( format.hasProperty( QTextFormat::FontPointSize ) ? format.fontPointSize() : - 1 )
, mFontFamily( format.hasProperty( QTextFormat::FontFamily ) ? format.fontFamily() : QString() )
#endif
, mStrikethrough( format.hasProperty( QTextFormat::FontStrikeOut ) ? ( format.fontStrikeOut() ? BooleanValue::SetTrue : BooleanValue::SetFalse ) : BooleanValue::NotSet )
, mUnderline( format.hasProperty( QTextFormat::FontUnderline ) ? ( format.fontUnderline() ? BooleanValue::SetTrue : BooleanValue::SetFalse ) : BooleanValue::NotSet )
@@ -72,19 +74,23 @@ void QgsTextCharacterFormat::setOverline( QgsTextCharacterFormat::BooleanValue e

void QgsTextCharacterFormat::updateFontForFormat( QFont &font ) const
{
if ( mUnderline != BooleanValue::NotSet )
font.setUnderline( mUnderline == QgsTextCharacterFormat::BooleanValue::SetTrue );
if ( mOverline != BooleanValue::NotSet )
font.setOverline( mOverline == QgsTextCharacterFormat::BooleanValue::SetTrue );
if ( mStrikethrough != QgsTextCharacterFormat::BooleanValue::NotSet )
font.setStrikeOut( mStrikethrough == QgsTextCharacterFormat::BooleanValue::SetTrue );

#if 0 // settings which affect font metrics are disabled for now
if ( mItalic != QgsTextCharacterFormat::BooleanValue::NotSet )
font.setItalic( mItalic == QgsTextCharacterFormat::BooleanValue::SetTrue );
if ( mFontWeight != -1 )
font.setWeight( mFontWeight );
if ( !mFontFamily.isEmpty() )
font.setFamily( mFontFamily );
if ( mFontPointSize != -1 )
font.setPointSizeF( mFontPointSize );
#endif

if ( mUnderline != BooleanValue::NotSet )
font.setUnderline( mUnderline == QgsTextCharacterFormat::BooleanValue::SetTrue );
if ( mOverline != BooleanValue::NotSet )
font.setOverline( mOverline == QgsTextCharacterFormat::BooleanValue::SetTrue );
if ( mStrikethrough != QgsTextCharacterFormat::BooleanValue::NotSet )
font.setStrikeOut( mStrikethrough == QgsTextCharacterFormat::BooleanValue::SetTrue );
}

#if 0 // settings which affect font metrics are disabled for now
@@ -163,6 +163,8 @@ class CORE_EXPORT QgsTextCharacterFormat
#if 0 // settings which affect font metrics are disabled for now
int mFontWeight = -1;
BooleanValue mItalic = BooleanValue::NotSet;
double mFontPointSize = -1;
QString mFontFamily;
#endif

BooleanValue mStrikethrough = BooleanValue::NotSet;

0 comments on commit 678fa88

Please sign in to comment.
You can’t perform that action at this time.