summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-17 11:57:11 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-17 11:57:11 +0100
commit424a16d108104b5f1c1c08ff57e3476ff4aaae2d (patch)
treeea227ee64871bac17ffb83dd48f59724abd16ad8
parentef22b6f75734603ac4ae9e615a1716d53366242d (diff)
parentb11d180a938ba1e543b9712548539f7bc5b05c47 (diff)
Merge pull request #68776 from bruvzg/win_sysfont_case
[Windows] Use case-sensitive file names for the system fonts to avoid warnings.
-rw-r--r--platform/windows/os_windows.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 08897bb190..d8548eb545 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -849,7 +849,19 @@ String OS_Windows::get_system_font_path(const String &p_font_name, bool p_bold,
if (FAILED(hr)) {
continue;
}
- return String::utf16((const char16_t *)&file_path[0]);
+ String fpath = String::utf16((const char16_t *)&file_path[0]);
+
+ WIN32_FIND_DATAW d;
+ HANDLE fnd = FindFirstFileW((LPCWSTR)&file_path[0], &d);
+ if (fnd != INVALID_HANDLE_VALUE) {
+ String fname = String::utf16((const char16_t *)d.cFileName);
+ if (!fname.is_empty()) {
+ fpath = fpath.get_base_dir().path_join(fname);
+ }
+ FindClose(fnd);
+ }
+
+ return fpath;
}
return String();
}