Force fontconfig to look at the correct path for fonts.conf on windows
(cherry picked from commit 208d146a03
)
This commit is contained in:
parent
e1a2d60672
commit
7ca59e24c6
|
@ -434,6 +434,17 @@ wxString PATHS::GetOSXKicadDataDir()
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WXWINDOWS__
|
#ifdef __WXWINDOWS__
|
||||||
|
wxString PATHS::GetWindowsFontConfigDir()
|
||||||
|
{
|
||||||
|
wxFileName fn;
|
||||||
|
fn.AssignDir( getWindowsKiCadRoot() );
|
||||||
|
fn.AppendDir( wxS( "etc" ) );
|
||||||
|
fn.AppendDir( wxS( "fonts" ) );
|
||||||
|
|
||||||
|
return fn.GetPathWithSep();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString PATHS::getWindowsKiCadRoot()
|
wxString PATHS::getWindowsKiCadRoot()
|
||||||
{
|
{
|
||||||
wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) );
|
wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) );
|
||||||
|
|
|
@ -479,6 +479,13 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
||||||
SetLanguagePath();
|
SetLanguagePath();
|
||||||
SetDefaultLanguage( tmp );
|
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_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless );
|
||||||
|
|
||||||
// Our unit test mocks break if we continue
|
// Our unit test mocks break if we continue
|
||||||
|
|
|
@ -170,6 +170,13 @@ public:
|
||||||
static wxString GetOSXKicadDataDir();
|
static wxString GetOSXKicadDataDir();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXWINDOWS__
|
||||||
|
/**
|
||||||
|
* @return The macOS specific bundle data directory for KiCad
|
||||||
|
*/
|
||||||
|
static wxString GetWindowsFontConfigDir();
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// we are a static helper
|
// we are a static helper
|
||||||
PATHS() {}
|
PATHS() {}
|
||||||
|
|
Loading…
Reference in New Issue