7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 18:51:40 +00:00

ADDED: Default font option to cli schematic plot exports

This commit is contained in:
Andrea Greco 2025-01-04 16:51:09 +00:00 committed by Mark Roszko
parent fd34750c4b
commit ee255fb389
3 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,7 @@ public:
SCH_PLOT_FORMAT m_plotFormat;
wxString m_filename;
wxString m_drawingSheet;
wxString m_defaultFont;
bool m_plotAll;
bool m_plotDrawingSheet;

View File

@ -275,6 +275,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
std::unique_ptr<SCH_RENDER_SETTINGS> renderSettings = std::make_unique<SCH_RENDER_SETTINGS>();
InitRenderSettings( renderSettings.get(), aPlotJob->m_theme, sch, aPlotJob->m_drawingSheet );
renderSettings->SetDefaultFont( aPlotJob->m_defaultFont );
std::unique_ptr<SCH_PLOTTER> schPlotter = std::make_unique<SCH_PLOTTER>( sch );

View File

@ -22,6 +22,7 @@
#include <sch_plotter.h>
#include "command_sch_export_plot.h"
#include <cli/exit_codes.h>
#include "font/kicad_font_name.h"
#include "jobs/job_export_sch_plot.h"
#include <layer_ids.h>
#include <wx/crt.h>
@ -38,6 +39,7 @@
#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
#define ARG_EXCLUDE_PDF_HIERARCHICAL_LINKS "--exclude-pdf-hierarchical-links"
#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
#define ARG_FONT_NAME "--default-font"
const JOB_HPGL_PLOT_ORIGIN_AND_UNITS hpgl_origin_ops[4] = {
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT,
@ -76,6 +78,10 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
.implicit_value( true )
.default_value( false );
m_argParser.add_argument( ARG_FONT_NAME )
.help( UTF8STDSTR( _( "Default font name" ) ) )
.default_value( wxString( KICAD_FONT_NAME ).ToStdString() );
if( aPlotFormat == SCH_PLOT_FORMAT::PDF )
{
m_argParser.add_argument( ARG_EXCLUDE_PDF_PROPERTY_POPUPS )
@ -149,6 +155,7 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
plotJob->m_plotPages = pages;
plotJob->m_plotDrawingSheet = !m_argParser.get<bool>( ARG_EXCLUDE_DRAWING_SHEET );
plotJob->m_pageSizeSelect = JOB_PAGE_SIZE::PAGE_SIZE_AUTO;
plotJob->m_defaultFont = m_argParser.get( ARG_FONT_NAME );
if( m_plotFormat == SCH_PLOT_FORMAT::PDF
|| m_plotFormat == SCH_PLOT_FORMAT::POST