From a3d64d604c632227beb651ad2af7a07d11d87228 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 20 Jun 2024 15:33:03 -0700 Subject: [PATCH] Silence font replace warnings for libs When loading schematics/pcbs, notification of font replacements might be warranted but in libraries, this warning is not helpful and intrusive (cherry picked from commit 11c61649343e8942a012c3de6c442542515db5fb) --- common/font/fontconfig.cpp | 16 +++++- eeschema/sch_io/altium/sch_io_altium.cpp | 7 +++ .../sch_io/cadstar/sch_io_cadstar_archive.cpp | 7 +++ eeschema/sch_io/eagle/sch_io_eagle.cpp | 16 ++++-- eeschema/sch_io/easyeda/sch_io_easyeda.cpp | 16 ++++-- .../sch_io/easyedapro/sch_io_easyedapro.cpp | 4 ++ .../sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp | 24 +++++++-- include/font/fontconfig.h | 9 ++++ pcbnew/kicad_clipboard.cpp | 3 ++ .../altium/pcb_io_altium_circuit_maker.cpp | 4 ++ .../altium/pcb_io_altium_circuit_studio.cpp | 5 ++ .../pcb_io/altium/pcb_io_altium_designer.cpp | 6 +++ pcbnew/pcb_io/altium/pcb_io_solidworks.cpp | 3 ++ .../pcb_io/cadstar/pcb_io_cadstar_archive.cpp | 6 +++ pcbnew/pcb_io/eagle/pcb_io_eagle.cpp | 6 +++ .../pcb_io/easyeda/pcb_io_easyeda_plugin.cpp | 6 +++ .../pcb_io/easyedapro/pcb_io_easyedapro.cpp | 6 +++ pcbnew/pcb_io/geda/pcb_io_geda.cpp | 4 ++ .../pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp | 53 +++++++++++-------- 19 files changed, 165 insertions(+), 36 deletions(-) diff --git a/common/font/fontconfig.cpp b/common/font/fontconfig.cpp index 67f71d2d9c..8d3a0b6b2b 100644 --- a/common/font/fontconfig.cpp +++ b/common/font/fontconfig.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN @@ -37,6 +38,8 @@ using namespace fontconfig; static FONTCONFIG* g_config = nullptr; static bool g_fcInitSuccess = false; +REPORTER* FONTCONFIG::s_reporter = nullptr; + /** * A simple wrapper to avoid exporing fontconfig in the header */ @@ -57,6 +60,12 @@ FONTCONFIG::FONTCONFIG() }; +void fontconfig::FONTCONFIG::SetReporter( REPORTER* aReporter ) +{ + s_reporter = aReporter; +} + + /** * This is simply a wrapper to call FcInit() with SEH for Windows * SEH on Windows can only be used in functions without objects that might be unwinded @@ -317,12 +326,15 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString if( retval == FF_RESULT::FF_ERROR ) { - wxLogWarning( _( "Error loading font '%s'." ), qualifiedFontName ); + if( s_reporter ) + s_reporter->Report( wxString::Format( _( "Error loading font '%s'." ), qualifiedFontName ) ); } else if( retval == FF_RESULT::FF_SUBSTITUTE ) { fontName.Replace( ':', ' ' ); - wxLogWarning( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ); + + if( s_reporter ) + s_reporter->Report( wxString::Format( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ) ); } FcPatternDestroy( pat ); diff --git a/eeschema/sch_io/altium/sch_io_altium.cpp b/eeschema/sch_io/altium/sch_io_altium.cpp index 39b9d5c555..7474238ea4 100644 --- a/eeschema/sch_io/altium/sch_io_altium.cpp +++ b/eeschema/sch_io/altium/sch_io_altium.cpp @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -325,6 +326,9 @@ SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATI fileName.SetExt( FILEEXT::KiCadSchematicFileExtension ); m_schematic = aSchematic; + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Delete on exception, if I own m_rootSheet, according to aAppendToMe std::unique_ptr deleter( aAppendToMe ? nullptr : m_rootSheet ); @@ -4292,6 +4296,9 @@ long long SCH_IO_ALTIUM::getLibraryTimestamp( const wxString& aLibraryPath ) con void SCH_IO_ALTIUM::ensureLoadedLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties ) { + // Suppress font substitution warnings + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( m_libCache.count( aLibraryPath ) ) { wxCHECK( m_timestamps.count( aLibraryPath ), /*void*/ ); diff --git a/eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp b/eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp index 98d78a1f0b..de57f26b00 100644 --- a/eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp +++ b/eeschema/sch_io/cadstar/sch_io_cadstar_archive.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -68,6 +69,9 @@ SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFi { wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr ); + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + SCH_SHEET* rootSheet = nullptr; @@ -251,6 +255,9 @@ void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath, wxFileName csafn; wxString fplibname = "cadstarpcblib"; + // Suppress font substitution warnings + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( aProperties && aProperties->count( "csa" ) ) { csafn = wxFileName( aProperties->at( "csa" ) ); diff --git a/eeschema/sch_io/eagle/sch_io_eagle.cpp b/eeschema/sch_io/eagle/sch_io_eagle.cpp index 7f30bbdf08..1cf2884704 100644 --- a/eeschema/sch_io/eagle/sch_io_eagle.cpp +++ b/eeschema/sch_io/eagle/sch_io_eagle.cpp @@ -39,19 +39,21 @@ #include #include #include +#include #include #include #include #include #include +#include #include +#include #include #include -#include -#include #include -#include #include +#include +#include #include #include #include @@ -59,9 +61,9 @@ #include #include #include +#include #include #include -#include // Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top @@ -408,6 +410,9 @@ SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC wxASSERT( !aFileName || aSchematic != nullptr ); LOCALE_IO toggle; // toggles on, then off, the C locale. + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + m_filename = aFileName; m_schematic = aSchematic; @@ -582,6 +587,9 @@ long long SCH_IO_EAGLE::getLibraryTimestamp( const wxString& aLibraryPath ) cons void SCH_IO_EAGLE::ensureLoadedLibrary( const wxString& aLibraryPath ) { + // Suppress font substitution warnings + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( m_eagleLibs.find( m_libName ) != m_eagleLibs.end() ) { wxCHECK( m_timestamps.count( m_libName ), /*void*/ ); diff --git a/eeschema/sch_io/easyeda/sch_io_easyeda.cpp b/eeschema/sch_io/easyeda/sch_io_easyeda.cpp index 8860d3018c..b83b1afaf4 100644 --- a/eeschema/sch_io/easyeda/sch_io_easyeda.cpp +++ b/eeschema/sch_io/easyeda/sch_io_easyeda.cpp @@ -25,14 +25,14 @@ #include "sch_easyeda_parser.h" #include "sch_io_easyeda.h" -#include -#include -#include +#include #include #include -#include +#include +#include +#include #include - +#include #include #include #include @@ -309,6 +309,9 @@ void SCH_IO_EASYEDA::EnumerateSymbolLib( wxArrayString& aSymbolNameList, { std::map namesCounter; + // Suppress font substitution warnings + fontconfig::FONTCONFIG::SetReporter( nullptr ); + try { wxFFileInputStream in( aLibraryPath ); @@ -612,6 +615,9 @@ SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMAT { wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr ); + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + SCH_SHEET* rootSheet = nullptr; if( aAppendToMe ) diff --git a/eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp b/eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp index 3f0e446c09..0f6366ef8f 100644 --- a/eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp +++ b/eeschema/sch_io/easyedapro/sch_io_easyedapro.cpp @@ -25,6 +25,7 @@ #include "sch_easyedapro_parser.h" #include "sch_io_easyedapro.h" +#include #include #include #include @@ -423,6 +424,9 @@ SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName, { wxCHECK( !aFileName.IsEmpty() && aSchematic, nullptr ); + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + SCH_SHEET* rootSheet = nullptr; if( aAppendToMe ) diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp index fa5ad23000..051671138b 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp @@ -28,15 +28,25 @@ #include #include #include +#include + #include #include #include -#include +#include +#include +#include #include +#include +#include +#include #include #include -#include #include // SYMBOL_ORIENTATION_T +#include +#include +#include +#include #include #include #include @@ -62,9 +72,9 @@ #include // for PropPowerSymsOnly definition. #include #include +#include // for PropPowerSymsOnly definition. +#include #include // for ::ResolvePossibleSymlinks() -#include -#include using namespace TSCHEMATIC_T; @@ -109,6 +119,9 @@ SCH_SHEET* SCH_IO_KICAD_SEXPR::LoadSchematicFile( const wxString& aFileName, SCH wxFileName fn = aFileName; + // Show the font substitution warnings + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Unfortunately child sheet file names the legacy schematic file format are not fully // qualified and are always appended to the project path. The aFileName attribute must // always be an absolute path so the project path can be used for load child sheet files. @@ -1416,6 +1429,9 @@ void SCH_IO_KICAD_SEXPR::saveInstances( const std::vector& a void SCH_IO_KICAD_SEXPR::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties ) { + // Suppress font substitution warnings + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() ) { // a spectacular episode in memory management: diff --git a/include/font/fontconfig.h b/include/font/fontconfig.h index 6f12bdb4e8..9ad5514749 100644 --- a/include/font/fontconfig.h +++ b/include/font/fontconfig.h @@ -30,6 +30,7 @@ #include #include +class REPORTER; namespace fontconfig { @@ -67,9 +68,17 @@ public: */ void ListFonts( std::vector& aFonts, const std::string& aDesiredLang ); + /** + * Set the reporter to use for reporting font substitution warnings. + * + * @param aReporter The reporter to use for reporting font substitution warnings. + */ + static void SetReporter( REPORTER* aReporter ); + private: std::map m_fontInfoCache; wxString m_fontCacheLastLang; + static REPORTER* s_reporter; /** * Matches the two rfc 3306 language entries, used for when searching for matching family names diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index ec71f2457c..ff61e07c8c 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -414,6 +415,8 @@ BOARD* CLIPBOARD_IO::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, wxLogNull doNotLog; // disable logging of failed clipboard actions + fontconfig::FONTCONFIG::SetReporter( nullptr ); + auto clipboard = wxTheClipboard; wxClipboardLocker clipboardLock( clipboard ); diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp index 5727129360..07d0ce392f 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp @@ -28,11 +28,13 @@ #include +#include #include #include #include #include #include +#include #include @@ -66,6 +68,8 @@ BOARD* PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard( const wxString& aFileName, BOARD* m_board = aAppendToMe ? aAppendToMe : new BOARD(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Give the filename to the board if it's new if( !aAppendToMe ) m_board->SetFileName( aFileName ); diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp index 4124aaa1ba..9d94f58965 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp @@ -28,11 +28,14 @@ #include +#include + #include #include #include #include #include +#include #include @@ -66,6 +69,8 @@ BOARD* PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard( const wxString& aFileName, BOARD m_board = aAppendToMe ? aAppendToMe : new BOARD(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Give the filename to the board if it's new if( !aAppendToMe ) m_board->SetFileName( aFileName ); diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp index fc3959e8f8..810b56ab69 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -79,10 +80,13 @@ bool PCB_IO_ALTIUM_DESIGNER::CanReadLibrary( const wxString& aFileName ) const BOARD* PCB_IO_ALTIUM_DESIGNER::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties, PROJECT* aProject ) { + m_props = aProperties; m_board = aAppendToMe ? aAppendToMe : new BOARD(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Give the filename to the board if it's new if( !aAppendToMe ) m_board->SetFileName( aFileName ); @@ -153,6 +157,8 @@ long long PCB_IO_ALTIUM_DESIGNER::GetLibraryTimestamp( const wxString& aLibraryP void PCB_IO_ALTIUM_DESIGNER::loadAltiumLibrary( const wxString& aLibraryPath ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + try { auto it = m_fplibFiles.find( aLibraryPath ); diff --git a/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp b/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp index 2d460b0211..fdce3f9af8 100644 --- a/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -58,6 +59,8 @@ BOARD* PCB_IO_SOLIDWORKS::LoadBoard( const wxString& aFileName, BOARD* aAppendTo m_board = aAppendToMe ? aAppendToMe : new BOARD(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Give the filename to the board if it's new if( !aAppendToMe ) m_board->SetFileName( aFileName ); diff --git a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp index 29ca2acc36..1857f2ca8b 100644 --- a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp +++ b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp @@ -24,12 +24,14 @@ */ #include +#include #include #include #include #include #include #include +#include std::map PCB_IO_CADSTAR_ARCHIVE::DefaultLayerMappingCallback( @@ -100,6 +102,8 @@ BOARD* PCB_IO_CADSTAR_ARCHIVE::LoadBoard( const wxString& aFileName, BOARD* aApp m_board = aAppendToMe ? aAppendToMe : new BOARD(); clearLoadedFootprints(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + CADSTAR_PCB_ARCHIVE_LOADER tempPCB( aFileName, m_layer_mapping_handler, m_show_layer_mapping_warnings, m_progressReporter ); tempPCB.Load( m_board, aProject ); @@ -232,6 +236,8 @@ long long PCB_IO_CADSTAR_ARCHIVE::GetLibraryTimestamp( const wxString& aLibraryP void PCB_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( m_cache.count( aLibraryPath ) ) { wxCHECK( m_timestamps.count( aLibraryPath ), /*void*/ ); diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index be25c5ff37..05497a289d 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -61,6 +61,7 @@ Load() TODO's #include #include +#include #include #include #include @@ -77,6 +78,7 @@ Load() TODO's #include #include #include +#include #include #include @@ -326,6 +328,8 @@ BOARD* PCB_IO_EAGLE::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, LOCALE_IO toggle; // toggles on, then off, the C locale. wxXmlNode* doc; + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + init( aProperties ); m_board = aAppendToMe ? aAppendToMe : new BOARD(); @@ -3156,6 +3160,8 @@ wxDateTime PCB_IO_EAGLE::getModificationTime( const wxString& aPath ) void PCB_IO_EAGLE::cacheLib( const wxString& aLibPath ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + try { wxDateTime modtime = getModificationTime( aLibPath ); diff --git a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp index 51e4ccb033..698c9f3485 100644 --- a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp +++ b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp @@ -27,12 +27,14 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -140,6 +142,8 @@ BOARD* PCB_IO_EASYEDA::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, m_props = aProperties; m_board = aAppendToMe ? aAppendToMe : new BOARD(); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + // Give the filename to the board if it's new if( !aAppendToMe ) m_board->SetFileName( aFileName ); @@ -379,6 +383,8 @@ FOOTPRINT* PCB_IO_EASYEDA::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, bool aKeepUUID, const STRING_UTF8_MAP* aProperties ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + PCB_IO_EASYEDA_PARSER parser( nullptr ); m_loadedFootprints.clear(); diff --git a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp index 3c0325ebde..9fff507a72 100644 --- a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp +++ b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro.cpp @@ -29,10 +29,12 @@ #include #include +#include #include #include #include #include +#include #include #include @@ -108,6 +110,8 @@ BOARD* PCB_IO_EASYEDAPRO::LoadBoard( const wxString& aFileName, BOARD* aAppendTo if( !aAppendToMe ) m_board->SetFileName( aFileName ); + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + if( m_progressReporter ) { m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) ); @@ -312,6 +316,8 @@ FOOTPRINT* PCB_IO_EASYEDAPRO::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName, bool aKeepUUID, const STRING_UTF8_MAP* aProperties ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + PCB_IO_EASYEDAPRO_PARSER parser( nullptr, nullptr ); FOOTPRINT* footprint = nullptr; diff --git a/pcbnew/pcb_io/geda/pcb_io_geda.cpp b/pcbnew/pcb_io/geda/pcb_io_geda.cpp index 30d02dd20a..f49f6a4d7b 100644 --- a/pcbnew/pcb_io/geda/pcb_io_geda.cpp +++ b/pcbnew/pcb_io/geda/pcb_io_geda.cpp @@ -32,6 +32,7 @@ #include // for KiROUND #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #include @@ -933,6 +935,8 @@ FOOTPRINT* PCB_IO_GEDA::FootprintLoad( const wxString& aLibraryPath, bool aKeepUUID, const STRING_UTF8_MAP* aProperties ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true ); if( footprint ) diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp index c6e03225c1..77049ee050 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp @@ -22,47 +22,50 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +// base64 code. Needed for PCB_REFERENCE_IMAGE +#define wxUSE_BASE64 1 +#include +#include +#include +#include +#include +#include + #include #include #include +#include #include #include // for enum RECT_CHAMFER_POSITIONS definition -#include +#include +#include +#include +#include #include #include #include -#include -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include +#include #include #include #include #include -#include #include #include -#include -#include -#include -#include #include +#include +#include +#include #include -#include -#include -#include -#include +#include -// For some reason wxWidgets is built with wxUSE_BASE64 unset so expose the wxWidgets -// base64 code. Needed for PCB_REFERENCE_IMAGE -#define wxUSE_BASE64 1 -#include -#include +#include #include @@ -2425,6 +2428,8 @@ BOARD* PCB_IO_KICAD_SEXPR::LoadBoard( const wxString& aFileName, BOARD* aAppendT unsigned lineCount = 0; + fontconfig::FONTCONFIG::SetReporter( &WXLOG_REPORTER::GetInstance() ); + if( m_progressReporter ) { m_progressReporter->Report( wxString::Format( _( "Loading %s..." ), aFileName ) ); @@ -2494,6 +2499,8 @@ void PCB_IO_KICAD_SEXPR::init( const STRING_UTF8_MAP* aProperties ) void PCB_IO_KICAD_SEXPR::validateCache( const wxString& aLibraryPath, bool checkModified ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( !m_cache || !m_cache->IsPath( aLibraryPath ) || ( checkModified && m_cache->IsModified() ) ) { // a spectacular episode in memory management: @@ -2591,6 +2598,8 @@ FOOTPRINT* PCB_IO_KICAD_SEXPR::ImportFootprint( const wxString& aFootprintPath, wxString fcontents; wxFFile f( aFootprintPath ); + fontconfig::FONTCONFIG::SetReporter( nullptr ); + if( !f.IsOpened() ) return nullptr; @@ -2607,6 +2616,8 @@ FOOTPRINT* PCB_IO_KICAD_SEXPR::FootprintLoad( const wxString& aLibraryPath, bool aKeepUUID, const STRING_UTF8_MAP* aProperties ) { + fontconfig::FONTCONFIG::SetReporter( nullptr ); + const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true ); if( footprint )