Pcbnew: Fix plot PDF, broken by commit f3457794cf

Also disable option to use native font in PDF and PS plotter format, because this option has never worked.

Fixes: lp:1707412
https://bugs.launchpad.net/kicad/+bug/1707412
This commit is contained in:
jean-pierre charras 2017-07-30 10:57:16 +02:00
parent 67ae5935d6
commit abe2a46ae7
3 changed files with 18 additions and 7 deletions

View File

@ -775,7 +775,10 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
aMultilineAllowed = false; // the text has only one line.
// Emit native PDF text (if requested)
if( m_textMode != PLOTTEXTMODE_STROKE && !aMultilineAllowed )
// Currently: does not work: disable it
bool use_native = false; // = m_textMode != PLOTTEXTMODE_STROKE && !aMultilineAllowed;
if( use_native )
{
const char *fontname = aItalic ? (aBold ? "/KicadFontBI" : "/KicadFontI")
: (aBold ? "/KicadFontB" : "/KicadFont");
@ -831,7 +834,7 @@ void PDF_PLOTTER::Text( const wxPoint& aPos,
}
// Plot the stroked text (if requested)
if( m_textMode != PLOTTEXTMODE_NATIVE || aMultilineAllowed )
if( !use_native )
{
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );

View File

@ -940,7 +940,10 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
aMultilineAllowed = false; // the text has only one line.
// Draw the native postscript text (if requested)
if( m_textMode == PLOTTEXTMODE_NATIVE && !aMultilineAllowed )
// Currently: does not work: disable it
bool use_native = false; // = m_textMode == PLOTTEXTMODE_NATIVE && !aMultilineAllowed;
if( use_native )
{
const char *fontname = aItalic ? (aBold ? "/KicadFont-BoldOblique"
: "/KicadFont-Oblique")
@ -993,7 +996,7 @@ void PS_PLOTTER::Text( const wxPoint& aPos,
}
// Draw the stroked text (if requested)
if( m_textMode != PLOTTEXTMODE_NATIVE || aMultilineAllowed )
if( !use_native )
{
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold, aMultilineAllowed );

View File

@ -315,6 +315,7 @@ void DIALOG_PLOT::CreateDrillFile( wxCommandEvent& event )
void DIALOG_PLOT::OnChangeOutlineMode( wxCommandEvent& event )
{
m_plotTextAsLineOpt->Enable( !m_plotOutlineModeOpt->GetValue() );
if( !m_plotTextAsLineOpt->IsEnabled() )
m_plotTextAsLineOpt->SetValue( true );
}
@ -411,7 +412,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_forcePSA4OutputOpt->Enable( false );
m_forcePSA4OutputOpt->SetValue( false );
m_plotTextAsLineOpt->Enable( false );
m_plotTextAsLineOpt->SetValue( false );
m_plotTextAsLineOpt->SetValue( true );
m_PlotOptionsSizer->Hide( m_GerberOptionsSizer );
m_PlotOptionsSizer->Hide( m_HPGLOptionsSizer );
@ -600,8 +601,12 @@ void DIALOG_PLOT::applyPlotSettings()
tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
tempOptions.SetPlotOutlineMode( m_plotOutlineModeOpt->GetValue() );
tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
tempOptions.SetTextMode( m_plotTextAsLineOpt->GetValue() ?
PLOTTEXTMODE_DEFAULT : PLOTTEXTMODE_NATIVE );
if( !m_plotTextAsLineOpt->IsEnabled() ) // Currently, only DXF supports this option
tempOptions.SetTextMode( PLOTTEXTMODE_DEFAULT );
else
tempOptions.SetTextMode( m_plotTextAsLineOpt->GetValue() ?
PLOTTEXTMODE_DEFAULT : PLOTTEXTMODE_NATIVE );
// Update settings from text fields. Rewrite values back to the fields,
// since the values may have been constrained by the setters.