Package: libsdl-ttf2.0-0 Version: 2.0.8-3+b1 Severity: minor Tags: patch I was just bitten by bug 374062 (any word if this will be fixed for etch given that it is fixed upstream?), and found that there is no error message set by sdl-ttf when it is unable to render a glyph, which makes bugs like this a bit more difficult to track down. I would really appreciate it if TTF_GetError() could return a useful message in such situations. The attached patch does just that by duplicating the existing error reporting for calls to Find_Glyph() into the places where it is missing, although it might be nice to know which glyph it was that could not be found...
Thanks, Kevin -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/dash Kernel: Linux 2.6.18.20061209a Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages libsdl-ttf2.0-0 depends on: ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries ii libfreetype6 2.2.1-5 FreeType 2 font engine, shared lib ii libsdl1.2debian 1.2.11-7 Simple DirectMedia Layer ii zlib1g 1:1.2.3-13 compression library - runtime libsdl-ttf2.0-0 recommends no packages. -- no debconf information
--- SDL_ttf.c.orig 2007-01-02 19:01:41.000000000 -0700 +++ SDL_ttf.c 2007-01-02 19:12:24.000000000 -0700 @@ -888,6 +888,7 @@ error = Find_Glyph(font, c, CACHED_METRICS); if ( error ) { + TTF_SetFTError("Couldn't find glyph", error); return -1; } glyph = font->current; @@ -1089,6 +1090,7 @@ error = Find_Glyph(font, c, CACHED_METRICS|CACHED_BITMAP); if( error ) { + TTF_SetFTError("Couldn't find glyph", error); SDL_FreeSurface( textbuf ); return NULL; } @@ -1165,6 +1167,7 @@ /* Get the glyph itself */ error = Find_Glyph(font, ch, CACHED_METRICS|CACHED_BITMAP); if ( error ) { + TTF_SetFTError("Couldn't find glyph", error); return(NULL); } glyph = font->current; @@ -1351,6 +1354,7 @@ error = Find_Glyph(font, c, CACHED_METRICS|CACHED_PIXMAP); if( error ) { + TTF_SetFTError("Couldn't find glyph", error); SDL_FreeSurface( textbuf ); return NULL; } @@ -1433,6 +1437,7 @@ /* Get the glyph itself */ error = Find_Glyph(font, ch, CACHED_METRICS|CACHED_PIXMAP); if( error ) { + TTF_SetFTError("Couldn't find glyph", error); return NULL; } glyph = font->current; @@ -1601,6 +1606,7 @@ } error = Find_Glyph(font, c, CACHED_METRICS|CACHED_PIXMAP); if( error ) { + TTF_SetFTError("Couldn't find glyph", error); SDL_FreeSurface( textbuf ); return NULL; } @@ -1685,6 +1691,7 @@ /* Get the glyph itself */ error = Find_Glyph(font, ch, CACHED_METRICS|CACHED_PIXMAP); if ( error ) { + TTF_SetFTError("Couldn't find glyph", error); return(NULL); } glyph = font->current;