Honour renderSettings' default font.

This still leaves a few things out in the cold,
such as hit-testing and polygon generation.
But at least it allows us to plot with a default
font.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19031
This commit is contained in:
Jeff Young
2025-07-17 09:35:21 +01:00
parent 0495828a55
commit e230d5164d
33 changed files with 197 additions and 258 deletions
+3 -14
View File
@@ -736,19 +736,8 @@ void BRDITEMS_PLOTTER::PlotText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, boo
const KIFONT::METRICS& aFontMetrics, bool aStrikeout )
{
int maxError = m_board->GetDesignSettings().m_MaxError;
KIFONT::FONT* font = aText->GetFont();
if( !font )
{
wxString defaultFontName; // empty string is the KiCad stroke font
if( m_plotter->RenderSettings() )
defaultFontName = m_plotter->RenderSettings()->GetDefaultFont();
font = KIFONT::FONT::GetFont( defaultFontName, aText->IsBold(), aText->IsItalic() );
}
wxString shownText( aText->GetShownText( true ) );
KIFONT::FONT* font = aText->GetDrawFont( m_plotter->RenderSettings() );
wxString shownText( aText->GetShownText( true ) );
if( shownText.IsEmpty() )
return;
@@ -834,7 +823,7 @@ void BRDITEMS_PLOTTER::PlotText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, boo
wxStringSplit( shownText, strings_list, '\n' );
positions.reserve( strings_list.Count() );
aText->GetLinePositions( positions, (int) strings_list.Count() );
aText->GetLinePositions( m_plotter->RenderSettings(), positions, (int) strings_list.Count() );
for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
{