diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp
index 92689bf5ae..a48fbe2d95 100644
--- a/common/plotters/SVG_plotter.cpp
+++ b/common/plotters/SVG_plotter.cpp
@@ -343,6 +343,28 @@ void SVG_PLOTTER::EndBlock( void* aData )
}
+void SVG_PLOTTER::StartLayer( const wxString& aLayerName )
+{
+ // Close any pending graphics context group
+ if( m_graphics_changed )
+ setSVGPlotStyle( GetCurrentLineWidth() );
+
+ // Start a new named layer group with inkscape-compatible layer attributes
+ fmt::print( m_outputFile, "\n",
+ TO_UTF8( aLayerName ), TO_UTF8( aLayerName ) );
+}
+
+
+void SVG_PLOTTER::EndLayer()
+{
+ // Close any pending graphics context group first
+ fmt::print( m_outputFile, "\n" );
+ // Then close the layer group
+ fmt::print( m_outputFile, "\n" );
+ m_graphics_changed = true; // Force new graphics context on next draw
+}
+
+
void SVG_PLOTTER::emitSetRGBColor( double r, double g, double b, double a )
{
uint32_t red = (uint32_t) ( 255.0 * r );
@@ -764,6 +786,7 @@ bool SVG_PLOTTER::StartPlot( const wxString& aPageNumber )
" xmlns:svg=\"http://www.w3.org/2000/svg\"\n"
" xmlns=\"http://www.w3.org/2000/svg\"\n"
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n"
+ " xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n"
" version=\"1.1\"\n";
// Write header.
diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp
index 9caa296215..877e30fd19 100644
--- a/eeschema/tools/symbol_editor_edit_tool.cpp
+++ b/eeschema/tools/symbol_editor_edit_tool.cpp
@@ -44,6 +44,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -52,6 +53,297 @@
#include