| Summary: | TTF_RenderUNICODE_Solid fails when rendering strings containing spaces | ||
|---|---|---|---|
| Product: | SDL_ttf | Reporter: | Sam Lantinga <slouken> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | bernard, phaethon-33f5024c, vapier |
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| URL: | http://bugs.debian.org/374062 | ||
| Attachments: |
main.c
font.ttf |
||
|
Description
Sam Lantinga
2006-06-20 02:03:48 UTC
Created attachment 137 [details]
main.c
Created attachment 138 [details]
font.ttf
I blame freetype. I ran into this bug when I returned to working on a text-heavy pygame program. With freetype 2.1.10 active (via LD_LIBRARY_PATH), bug does not occur; with freetype 2.2.1 active, the bug occurs. Many many printf()'s led me to a one-line change in freetype/src/raster/ftrend1.c:178 between v2.1.10 and v2.2.1. In freetype-2.1.10 (no bug), this lines reads: if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) and in freetype-2.2.1 (buggy), it reads: if ( FT_ALLOC_MULT( bitmap->buffer, pitch, height ) ) The space character (ASCII 32) yields pitch=0 height=0. From what I can tell, FT_ALLOC_MULT leads to a realloc()-style call that flags 0-size resizes as an error in the name of security (src/base/ftutil.c:123), whereas FT_ALLOC leads to a simple alloc()-style call which flags only negative sizes as a risk (src/base/ftutil.c:80). I can't find a ready explanation for the DPMSDisable message, even though I suffer it myself. A workaround for me was to always enable anti-aliasing, which apparently kicks in grayscale mode (instead of monochrome), and thus the 'smooth' renderer, which still uses the FT_ALLOC macro. this is def a freetype bug ... i just finished debugging this crap for Gentoo ;) http://bugs.gentoo.org/142453 http://lists.gnu.org/archive/html/freetype/2006-07/msg00009.html the freetype-2.2.1 release has this bug but latest cvs works for me ... so i'd just close this as 'INVALID:BUG_IN_FREETYPE' Closing as INVALID, bug in Freetype. The experts have spoken. :) Thanks to everyone that researched this! --ryan. |