From d4ff829c2634c4eb1de0af7aaf56727533fa81df Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 18 Jan 2022 12:43:31 +0000 Subject: [PATCH] Trace logging for fonts. --- common/font/fontconfig.cpp | 9 ++++++++- common/trace_helpers.cpp | 1 + include/trace_helpers.h | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/font/fontconfig.cpp b/common/font/fontconfig.cpp index 61bed644f2..9548a3c26d 100644 --- a/common/font/fontconfig.cpp +++ b/common/font/fontconfig.cpp @@ -21,6 +21,7 @@ #include #include #include +#include using namespace fontconfig; @@ -147,6 +148,8 @@ void FONTCONFIG::ListFonts( std::vector& aFonts ) FcStrList* langStrList = FcStrListCreate( langStrSet ); FcChar8* langStr = FcStrListNext( langStrList ); + std::string theFamily( reinterpret_cast( family ) ); + if( !langStr ) { // Symbol fonts (Wingdings, etc.) have no language @@ -162,6 +165,11 @@ void FONTCONFIG::ListFonts( std::vector& aFonts ) langSupported = true; break; } + else + { + wxLogTrace( traceFonts, "Font '%s' language '%s' not supported by OS.", + theFamily, langWxStr ); + } langStr = FcStrListNext( langStrList ); } @@ -173,7 +181,6 @@ void FONTCONFIG::ListFonts( std::vector& aFonts ) continue; std::string theFile( reinterpret_cast( file ) ); - std::string theFamily( reinterpret_cast( family ) ); std::string theStyle( reinterpret_cast( style ) ); FONTINFO fontInfo( theFile, theStyle, theFamily ); diff --git a/common/trace_helpers.cpp b/common/trace_helpers.cpp index bc57acad56..c1bd0b4332 100644 --- a/common/trace_helpers.cpp +++ b/common/trace_helpers.cpp @@ -45,6 +45,7 @@ const wxChar* const tracePrinting = wxT( "KICAD_PRINT" ); const wxChar* const traceAutoSave = wxT( "KICAD_AUTOSAVE" ); const wxChar* const tracePathsAndFiles = wxT( "KICAD_PATHS_AND_FILES" ); const wxChar* const traceLocale = wxT( "KICAD_LOCALE" ); +const wxChar* const traceFonts = wxT( "KICAD_FONTS" ); const wxChar* const traceScreen = wxT( "KICAD_SCREEN" ); const wxChar* const traceZoomScroll = wxT( "KICAD_ZOOM_SCROLL" ); const wxChar* const traceSymbolResolver = wxT( "KICAD_SYM_RESOLVE" ); diff --git a/include/trace_helpers.h b/include/trace_helpers.h index 4c9ffe229f..c1e4dc3ba2 100644 --- a/include/trace_helpers.h +++ b/include/trace_helpers.h @@ -148,6 +148,13 @@ extern const wxChar* const tracePathsAndFiles; */ 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. *