Avoid crashing if color emoji failed to load
This commit is contained in:
parent
b3200937da
commit
35c70a16b5
@ -555,8 +555,13 @@ FT_Face FontManager::loadColorEmoji()
|
|||||||
FT_Face face = NULL;
|
FT_Face face = NULL;
|
||||||
const std::string loc = file_manager->getAssetChecked(FileManager::TTF,
|
const std::string loc = file_manager->getAssetChecked(FileManager::TTF,
|
||||||
stk_config->m_color_emoji_ttf.c_str(), true);
|
stk_config->m_color_emoji_ttf.c_str(), true);
|
||||||
font_manager->checkFTError(FT_New_Face(
|
FT_Error err = FT_New_Face(m_ft_library, loc.c_str(), 0, &face);
|
||||||
m_ft_library, loc.c_str(), 0, &face), loc + " is loaded");
|
if (err > 0)
|
||||||
|
{
|
||||||
|
Log::error("FontManager", "Something wrong when loading color emoji! "
|
||||||
|
"The error code was %d.", err);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!FT_HAS_COLOR(face) || face->num_fixed_sizes == 0)
|
if (!FT_HAS_COLOR(face) || face->num_fixed_sizes == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user