Cut down on code duplication

This commit is contained in:
twinaphex 2021-01-08 23:20:34 +01:00
parent d1d0212684
commit 07db1bbfde

View File

@ -238,8 +238,6 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
goto error;
err = FT_New_Memory_Face(handle->lib, font_data, font_size, 0, &handle->face);
if (err)
goto error;
}
else
#endif
@ -247,10 +245,11 @@ static void *font_renderer_ft_init(const char *font_path, float font_size)
if (!path_is_valid(font_path))
goto error;
err = FT_New_Face(handle->lib, font_path, 0, &handle->face);
if (err)
goto error;
}
if (err)
goto error;
err = FT_Select_Charmap(handle->face, FT_ENCODING_UNICODE);
if (err)
goto error;