Another way to set fixed-width font (that works on OSX).

This commit is contained in:
Jeff Young 2021-02-09 18:46:04 +00:00
parent 3d920c4088
commit 65c41cff42
1 changed files with 5 additions and 4 deletions

View File

@ -91,10 +91,11 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO
SetInitialFocus( m_MultiLineText ); SetInitialFocus( m_MultiLineText );
m_SingleLineSizer->Show( false ); m_SingleLineSizer->Show( false );
wxFont font; int size = wxNORMAL_FONT->GetPointSize();
font.SetFamily( wxFONTFAMILY_MODERN ); // Use a monospace font to match the stroke font spacing wxFont fixedFont( size, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL );
m_MultiLineText->StyleSetFaceName( wxSTC_STYLE_DEFAULT, font.GetFaceName() );
m_MultiLineText->StyleClearAll(); // Addresses a bug in wx3.0 where styles are not correctly set for( size_t i = 0; i < wxSTC_STYLE_MAX; ++i )
m_MultiLineText->StyleSetFont( i, fixedFont );
// This option makes sense only for footprint texts; texts on board are always visible. // This option makes sense only for footprint texts; texts on board are always visible.
m_Visible->SetValue( true ); m_Visible->SetValue( true );