Font cleanup and bug fixes.

This commit is contained in:
Jeff Young 2022-01-09 18:33:32 +00:00
parent f379c49084
commit 76368af7b9
5 changed files with 2 additions and 5 deletions

View File

@ -661,7 +661,6 @@ void EDA_TEXT::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset,
GetLinePositions( positions, strings.Count() );
// FONT TODO: this is going to use the KiCad font because it doesn't know any better...
for( unsigned ii = 0; ii < strings.Count(); ii++ )
printOneLineOfText( aSettings, aOffset, aColor, aFillMode, strings[ii], positions[ii] );
}

View File

@ -66,7 +66,7 @@ FONT* FONT::getDefaultFont()
FONT* FONT::GetFont( const wxString& aFontName, bool aBold, bool aItalic )
{
if( aFontName.empty() || aFontName == wxT( "KiCad Font" ) )
if( aFontName.empty() || aFontName.StartsWith( wxT( "KiCad Font" ) ) )
return getDefaultFont();
std::tuple<wxString, bool, bool> key = { aFontName, aBold, aItalic };

View File

@ -88,7 +88,7 @@ KIFONT::FONT* FONT_CHOICE::GetFontSelection( bool aBold, bool aItalic ) const
if( GetSelection() <= 0 )
return nullptr;
else if( GetSelection() == 1 && m_systemFontCount == 2 )
return KIFONT::FONT::GetFont( "KiCad", aBold, aItalic );
return KIFONT::FONT::GetFont( "KiCad Font", aBold, aItalic );
else
return KIFONT::FONT::GetFont( GetStringSelection(), aBold, aItalic );
}

View File

@ -599,7 +599,6 @@ void SCH_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOverbarSynta
if( !faceName.IsEmpty() )
{
// FONT TODO: notify user about missing font
aText->SetFont( KIFONT::FONT::GetFont( faceName, aText->IsBold(),
aText->IsItalic() ) );
}

View File

@ -474,7 +474,6 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText )
if( !faceName.IsEmpty() )
{
// FONT TODO: notify user about missing font
aText->SetFont( KIFONT::FONT::GetFont( faceName, aText->IsBold(),
aText->IsItalic() ) );
}