Browse Source

Force fontconfig to look at the correct path for fonts.conf on windows

newinvert
Marek Roszko 2 years ago
parent
commit
208d146a03
  1. 11
      common/paths.cpp
  2. 7
      common/pgm_base.cpp
  3. 7
      include/paths.h

11
common/paths.cpp

@ -443,6 +443,17 @@ wxString PATHS::GetOSXKicadDataDir()
#ifdef __WXWINDOWS__
wxString PATHS::GetWindowsFontConfigDir()
{
wxFileName fn;
fn.AssignDir( getWindowsKiCadRoot() );
fn.AppendDir( wxS( "etc" ) );
fn.AppendDir( wxS( "fonts" ) );
return fn.GetPathWithSep();
}
wxString PATHS::getWindowsKiCadRoot()
{
wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) );

7
common/pgm_base.cpp

@ -512,6 +512,13 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
SetLanguagePath();
SetDefaultLanguage( tmp );
#ifdef _MSC_VER
// We need to set this because the internal fontconfig logic
// seems to search relative to the dll rather the other logic it
// has to look for the /etc folder above the dll
wxSetEnv( "FONTCONFIG_PATH", PATHS::GetWindowsFontConfigDir() );
#endif
m_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless );
m_background_jobs_monitor = std::make_unique<BACKGROUND_JOBS_MONITOR>();
m_notifications_manager = std::make_unique<NOTIFICATIONS_MANAGER>();

7
include/paths.h

@ -170,6 +170,13 @@ public:
static wxString GetOSXKicadDataDir();
#endif
#ifdef __WXWINDOWS__
/**
* @return The macOS specific bundle data directory for KiCad
*/
static wxString GetWindowsFontConfigDir();
#endif
private:
// we are a static helper
PATHS() {}

Loading…
Cancel
Save