Windows: Validate that the font family name exists before trying to get the font family
I didn't have the first emoji font installed, which led an an exception when calling font_collection->GetFontFamily() no the new rows.
This commit is contained in:
@ -1059,7 +1059,7 @@ String OS_Windows::get_system_font_path(const String &p_font_name, int p_weight,
|
|||||||
UINT32 index = 0;
|
UINT32 index = 0;
|
||||||
BOOL exists = false;
|
BOOL exists = false;
|
||||||
HRESULT hr = font_collection->FindFamilyName((const WCHAR *)font_name.utf16().get_data(), &index, &exists);
|
HRESULT hr = font_collection->FindFamilyName((const WCHAR *)font_name.utf16().get_data(), &index, &exists);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr) || !exists) {
|
||||||
return String();
|
return String();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user