Trace logging for fonts.

This commit is contained in:
Jeff Young 2022-01-18 12:43:31 +00:00
parent 4e493e2cbc
commit d4ff829c26
3 changed files with 16 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include <font/fontconfig.h> #include <font/fontconfig.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <wx/log.h> #include <wx/log.h>
#include <trace_helpers.h>
using namespace fontconfig; using namespace fontconfig;
@ -147,6 +148,8 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
FcStrList* langStrList = FcStrListCreate( langStrSet ); FcStrList* langStrList = FcStrListCreate( langStrSet );
FcChar8* langStr = FcStrListNext( langStrList ); FcChar8* langStr = FcStrListNext( langStrList );
std::string theFamily( reinterpret_cast<char *>( family ) );
if( !langStr ) if( !langStr )
{ {
// Symbol fonts (Wingdings, etc.) have no language // Symbol fonts (Wingdings, etc.) have no language
@ -162,6 +165,11 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
langSupported = true; langSupported = true;
break; break;
} }
else
{
wxLogTrace( traceFonts, "Font '%s' language '%s' not supported by OS.",
theFamily, langWxStr );
}
langStr = FcStrListNext( langStrList ); langStr = FcStrListNext( langStrList );
} }
@ -173,7 +181,6 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
continue; continue;
std::string theFile( reinterpret_cast<char *>( file ) ); std::string theFile( reinterpret_cast<char *>( file ) );
std::string theFamily( reinterpret_cast<char *>( family ) );
std::string theStyle( reinterpret_cast<char *>( style ) ); std::string theStyle( reinterpret_cast<char *>( style ) );
FONTINFO fontInfo( theFile, theStyle, theFamily ); FONTINFO fontInfo( theFile, theStyle, theFamily );

View File

@ -45,6 +45,7 @@ const wxChar* const tracePrinting = wxT( "KICAD_PRINT" );
const wxChar* const traceAutoSave = wxT( "KICAD_AUTOSAVE" ); const wxChar* const traceAutoSave = wxT( "KICAD_AUTOSAVE" );
const wxChar* const tracePathsAndFiles = wxT( "KICAD_PATHS_AND_FILES" ); const wxChar* const tracePathsAndFiles = wxT( "KICAD_PATHS_AND_FILES" );
const wxChar* const traceLocale = wxT( "KICAD_LOCALE" ); const wxChar* const traceLocale = wxT( "KICAD_LOCALE" );
const wxChar* const traceFonts = wxT( "KICAD_FONTS" );
const wxChar* const traceScreen = wxT( "KICAD_SCREEN" ); const wxChar* const traceScreen = wxT( "KICAD_SCREEN" );
const wxChar* const traceZoomScroll = wxT( "KICAD_ZOOM_SCROLL" ); const wxChar* const traceZoomScroll = wxT( "KICAD_ZOOM_SCROLL" );
const wxChar* const traceSymbolResolver = wxT( "KICAD_SYM_RESOLVE" ); const wxChar* const traceSymbolResolver = wxT( "KICAD_SYM_RESOLVE" );

View File

@ -148,6 +148,13 @@ extern const wxChar* const tracePathsAndFiles;
*/ */
extern const wxChar* const traceLocale; extern const wxChar* const traceLocale;
/**
* Flag to enable locale debug output.
*
* Use "KICAD_FONTS" to enable.
*/
extern const wxChar* const traceFonts;
/** /**
* Flag to enable debug output of #BASE_SCREEN and it's derivatives. * Flag to enable debug output of #BASE_SCREEN and it's derivatives.
* *