diff --git a/common/drawing_sheet/ds_data_model_io.cpp b/common/drawing_sheet/ds_data_model_io.cpp index 30c3100638..409c82cc87 100644 --- a/common/drawing_sheet/ds_data_model_io.cpp +++ b/common/drawing_sheet/ds_data_model_io.cpp @@ -253,7 +253,7 @@ void DS_DATA_MODEL_IO::format( DS_DATA_ITEM_TEXT* aItem, int aNestLevel ) const { m_out->Print( 0, " (font" ); - if( aItem->m_Font && !aItem->m_Font->Name().IsEmpty() ) + if( aItem->m_Font && !aItem->m_Font->GetName().IsEmpty() ) m_out->Print( 0, " (face \"%s\")", aItem->m_Font->NameAsToken() ); if( write_thickness ) diff --git a/common/eda_text.cpp b/common/eda_text.cpp index 4c08057ae0..31bd477af6 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -781,7 +781,7 @@ wxString EDA_TEXT::GetTextStyleName() const wxString EDA_TEXT::GetFontName() const { if( GetFont() ) - return GetFont()->Name(); + return GetFont()->GetName(); else return wxEmptyString; } @@ -812,7 +812,7 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl aFormatter->Print( 0, " (font" ); - if( GetFont() && !GetFont()->Name().IsEmpty() ) + if( GetFont() && !GetFont()->GetName().IsEmpty() ) aFormatter->Print( 0, " (face \"%s\")", GetFont()->NameAsToken() ); // Text size diff --git a/common/font/font.cpp b/common/font/font.cpp index 516d31b32b..35b6c2ae42 100644 --- a/common/font/font.cpp +++ b/common/font/font.cpp @@ -53,12 +53,6 @@ FONT::FONT() } -const wxString& FONT::Name() const -{ - return m_fontName; -} - - FONT* FONT::getDefaultFont() { if( !s_defaultFont ) diff --git a/common/widgets/font_choice.cpp b/common/widgets/font_choice.cpp index 4dea77fe2b..d34146aed7 100644 --- a/common/widgets/font_choice.cpp +++ b/common/widgets/font_choice.cpp @@ -72,11 +72,11 @@ void FONT_CHOICE::SetFontSelection( KIFONT::FONT* aFont ) } else { - SetStringSelection( aFont->Name() ); + SetStringSelection( aFont->GetName() ); if( GetSelection() == wxNOT_FOUND ) { - Append( aFont->Name() + m_notFound ); + Append( aFont->GetName() + m_notFound ); SetSelection( GetCount() ); } } diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index dc2418f67f..4495d16d11 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -472,6 +472,8 @@ void LIB_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + aList.emplace_back( _( "Style" ), GetTextStyleName() ); aList.emplace_back( _( "Text Size" ), MessageTextFromValue( aFrame->GetUserUnits(), diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 49edec0feb..516701e6af 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -363,6 +363,8 @@ void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + aList.emplace_back( _( "Style" ), GetTextStyleName() ); aList.emplace_back( _( "Text Size" ), MessageTextFromValue( aFrame->GetUserUnits(), diff --git a/eeschema/lib_textbox.cpp b/eeschema/lib_textbox.cpp index 6c448abed0..ab0a4e27c0 100644 --- a/eeschema/lib_textbox.cpp +++ b/eeschema/lib_textbox.cpp @@ -373,6 +373,8 @@ void LIB_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) }; int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0; aList.emplace_back( _( "Style" ), textStyle[style] ); diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 79ff9abf87..a6c945a0d6 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -691,6 +691,8 @@ void SCH_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + aList.emplace_back( _( "Style" ), GetTextStyleName() ); aList.emplace_back( _( "Text Size" ), MessageTextFromValue( aFrame->GetUserUnits(), diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 56c651e461..53525b6eef 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -786,6 +786,8 @@ void SCH_LABEL_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) }; int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0; aList.emplace_back( _( "Style" ), textStyle[style] ); diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 55d529cfa8..ebf9b5628b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -472,6 +472,8 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) }; int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0; aList.emplace_back( _( "Style" ), textStyle[style] ); diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index c8ea9f4663..ee303e4f8f 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -376,6 +376,8 @@ void SCH_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); + wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) }; int style = IsBold() && IsItalic() ? 3 : IsBold() ? 2 : IsItalic() ? 1 : 0; aList.emplace_back( _( "Style" ), textStyle[style] ); diff --git a/include/font/font.h b/include/font/font.h index 02c0221eaf..9af11c1e5f 100644 --- a/include/font/font.h +++ b/include/font/font.h @@ -108,17 +108,17 @@ public: virtual ~FONT() { } - virtual bool IsStroke() const { return false; } + virtual bool IsStroke() const { return false; } virtual bool IsOutline() const { return false; } - virtual bool IsBold() const { return false; } - virtual bool IsItalic() const { return false; } + virtual bool IsBold() const { return false; } + virtual bool IsItalic() const { return false; } - static FONT* GetFont( const wxString& aFontName = "", bool aBold = false, + static FONT* GetFont( const wxString& aFontName = wxEmptyString, bool aBold = false, bool aItalic = false ); - static bool IsStroke( const wxString& aFontName ); + static bool IsStroke( const wxString& aFontName ); - const wxString& Name() const; - inline const char* NameAsToken() const { return Name().utf8_str().data(); } + const wxString& GetName() const { return m_fontName; }; + inline const char* NameAsToken() const { return GetName().utf8_str().data(); } /** * Draw a string. @@ -266,7 +266,7 @@ private: inline std::ostream& operator<<(std::ostream& os, const KIFONT::FONT& aFont) { - os << "[Font \"" << aFont.Name() << "\"" << ( aFont.IsStroke() ? " stroke" : "" ) + os << "[Font \"" << aFont.GetName() << "\"" << ( aFont.IsStroke() ? " stroke" : "" ) << ( aFont.IsOutline() ? " outline" : "" ) << ( aFont.IsBold() ? " bold" : "" ) << ( aFont.IsItalic() ? " italic" : "" ) << "]"; return os; diff --git a/pcbnew/fp_text.cpp b/pcbnew/fp_text.cpp index 5398811a32..d99005b2e9 100644 --- a/pcbnew/fp_text.cpp +++ b/pcbnew/fp_text.cpp @@ -259,6 +259,7 @@ EDA_ANGLE FP_TEXT::GetDrawRotation() const void FP_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { + EDA_UNITS units = aFrame->GetUserUnits(); wxString msg; static const wxString text_type_msg[3] = @@ -293,14 +294,10 @@ void FP_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetUserUnits(), GetTextThickness() ); - aList.emplace_back( _( "Thickness" ), msg ); - - msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); - aList.emplace_back( _( "Width" ), msg ); - - msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() ); - aList.emplace_back( _( "Height" ), msg ); + aList.emplace_back( _( "Font" ), GetDrawFont()->GetName() ); + aList.emplace_back( _( "Thickness" ), MessageTextFromValue( units, GetTextThickness() ) ); + aList.emplace_back( _( "Width" ), MessageTextFromValue( units, GetTextWidth() ) ); + aList.emplace_back( _( "Height" ), MessageTextFromValue(units, GetTextHeight() ) ); } diff --git a/pcbnew/fp_textbox.cpp b/pcbnew/fp_textbox.cpp index a4e09d6daa..1d3d62d224 100644 --- a/pcbnew/fp_textbox.cpp +++ b/pcbnew/fp_textbox.cpp @@ -239,6 +239,7 @@ void FP_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); aList.emplace_back( _( "Thickness" ), MessageTextFromValue( units, GetTextThickness() ) ); aList.emplace_back( _( "Text Width" ), MessageTextFromValue( units, GetTextWidth() ) ); aList.emplace_back( _( "Text Height" ), MessageTextFromValue( units, GetTextHeight() ) ); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index fb7217ef83..3fab1181b0 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -335,6 +335,12 @@ void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, GetUnits( units ); aList.emplace_back( _( "Units" ), GetAbbreviatedUnitsLabel( units ).Trim( false ) ); + aList.emplace_back( _( "Font" ), m_text.GetDrawFont()->GetName() ); + aList.emplace_back( _( "Text Thickness" ), + MessageTextFromValue( units, m_text.GetTextThickness() ) ); + aList.emplace_back( _( "Text Width" ), MessageTextFromValue( units, m_text.GetTextWidth() ) ); + aList.emplace_back( _( "Text Height" ), MessageTextFromValue( units, m_text.GetTextHeight() ) ); + ORIGIN_TRANSFORMS originTransforms = aFrame->GetOriginTransforms(); units = aFrame->GetUserUnits(); diff --git a/pcbnew/pcb_text.cpp b/pcbnew/pcb_text.cpp index 99bf201073..0310b20398 100644 --- a/pcbnew/pcb_text.cpp +++ b/pcbnew/pcb_text.cpp @@ -141,6 +141,7 @@ void PCB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); aList.emplace_back( _( "Thickness" ), MessageTextFromValue( units, GetTextThickness() ) ); aList.emplace_back( _( "Width" ), MessageTextFromValue( units, GetTextWidth() ) ); aList.emplace_back( _( "Height" ), MessageTextFromValue( units, GetTextHeight() ) ); diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index e411900751..e9bdff9818 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -233,6 +233,7 @@ void PCB_TEXTBOX::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetName() ); aList.emplace_back( _( "Text Thickness" ), MessageTextFromValue( units, GetTextThickness() ) ); aList.emplace_back( _( "Text Width" ), MessageTextFromValue( units, GetTextWidth() ) ); aList.emplace_back( _( "Text Height" ), MessageTextFromValue( units, GetTextHeight() ) );