libsdl-org/SDL_ttf

Better error log in Load_Glyph

ericoporto opened this issue · 0 comments

There are 6 different reasons that could lead SDL to log "Couldn't find glyph" when an error occurs in Load_Glyph.

It would be nice if each of those had a specific log of it's own instead.


SDL_ttf/SDL_ttf.c

Lines 2110 to 2113 in 622ccd6

error = FT_Load_Glyph(font->face, cached->index, ft_load);
if (error) {
goto ft_failure;
}

SDL_ttf/SDL_ttf.c

Lines 2243 to 2246 in 622ccd6

error = FT_Get_Glyph(slot, &glyph);
if (error) {
goto ft_failure;
}

SDL_ttf/SDL_ttf.c

Lines 2250 to 2253 in 622ccd6

error = FT_Stroker_New(library, &stroker);
if (error) {
goto ft_failure;
}

SDL_ttf/SDL_ttf.c

Lines 2260 to 2264 in 622ccd6

error = FT_Glyph_To_Bitmap(&glyph, ft_render_mode, 0, 1);
if (error) {
FT_Done_Glyph(glyph);
goto ft_failure;
}

SDL_ttf/SDL_ttf.c

Lines 2275 to 2278 in 622ccd6

error = FT_Render_Glyph(slot, ft_render_mode);
if (error) {
goto ft_failure;
}

SDL_ttf/SDL_ttf.c

Lines 2322 to 2325 in 622ccd6

if (!dst->buffer) {
error = FT_Err_Out_Of_Memory;
goto ft_failure;
}