Use monospace font for textboxes

Matches the spacing of our stroke font so the tabs are correctly
displayed in WYSIWYG

Fixes https://gitlab.com/kicad/code/kicad/issues/1807
This commit is contained in:
Seth Hillbrand 2021-02-08 15:58:11 -08:00
parent e2f8b1a4b1
commit 6f0424d742
2 changed files with 10 additions and 0 deletions

View File

@ -127,6 +127,11 @@ DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR( SCH_EDIT_FRAME* aParent, SCH_TEXT* aTe
m_valueMultiLine->Bind( wxEVT_STC_CHARADDED, &DIALOG_LABEL_EDITOR::onScintillaCharAdded, this );
wxFont font;
font.SetFamily( wxFONTFAMILY_MODERN ); // Use a monospace font to match the stroke font spacing
m_valueMultiLine->StyleSetFaceName( wxSTC_STYLE_DEFAULT, font.GetFaceName() );
m_valueMultiLine->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient because the
// various versions have different controls so we want to store sizes for each version.
m_hash_key = TO_UTF8( GetTitle() );

View File

@ -91,6 +91,11 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO
SetInitialFocus( m_MultiLineText );
m_SingleLineSizer->Show( false );
wxFont font;
font.SetFamily( wxFONTFAMILY_MODERN ); // Use a monospace font to match the stroke font spacing
m_MultiLineText->StyleSetFaceName( wxSTC_STYLE_DEFAULT, font.GetFaceName() );
m_MultiLineText->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set
// This option makes sense only for footprint texts; texts on board are always visible.
m_Visible->SetValue( true );
m_Visible->Enable( false );