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__
|
||||
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( "/../" ) );
|
||||
|
|
|
@ -479,6 +479,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 );
|
||||
|
||||
// Our unit test mocks break if we continue
|
||||
|
|
|
@ -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…
Reference in New Issue