From 4b99e6a1f11efe66b3fb0aa3b6fa721afe698446 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed <nat@lindenlab.com> Date: Mon, 17 Dec 2018 15:23:57 -0500 Subject: [PATCH] SL-10252: On Windows, use $SystemRoot again, not FOLDERID_Fonts. --- indra/llrender/llfontgl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 9b43680949f..8cd18c5fa19 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -40,6 +40,7 @@ #include "v4color.h" #include "lltexture.h" #include "lldir.h" +#include "llstring.h" // Third party library includes #include <boost/tokenizer.hpp> @@ -1074,6 +1075,14 @@ std::string LLFontGL::getFontPathSystem() return "/System/Library/Fonts/"; #elif LL_WINDOWS + auto system_root = LLStringUtil::getenv("SystemRoot"); + if (! system_root.empty()) + { + std::string fontpath(gDirUtilp->add(system_root, "fonts") + gDirUtilp->getDirDelimiter()); + LL_INFOS() << "from SystemRoot: " << fontpath << LL_ENDL; + return fontpath; + } + wchar_t *pwstr = NULL; HRESULT okay = SHGetKnownFolderPath(FOLDERID_Fonts, 0, NULL, &pwstr); if (SUCCEEDED(okay) && pwstr) @@ -1081,6 +1090,7 @@ std::string LLFontGL::getFontPathSystem() std::string fontpath(ll_convert_wide_to_string(pwstr)); // SHGetKnownFolderPath() contract requires us to free pwstr CoTaskMemFree(pwstr); + LL_INFOS() << "from SHGetKnownFolderPath(): " << fontpath << LL_ENDL; return fontpath; } #endif -- GitLab