diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-17 09:39:31 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-17 09:39:31 +0200 |
commit | b11d180a938ba1e543b9712548539f7bc5b05c47 (patch) | |
tree | bb6de65a152d80aa753e552534a020700635dd8f /platform/windows | |
parent | 966785751f156c9b75be5aabf64bc52390c4b050 (diff) |
[Windows] Use case-sensitive file names for the system fonts to avoid warnings.
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 14 |
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(); } |