| Summary: | TTF_GetFontHinting returns wrong values | ||
|---|---|---|---|
| Product: | SDL_ttf | Reporter: | Tobias Leich <email> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.10 | ||
| Hardware: | All | ||
| OS: | All | ||
This is fixed in source control, thanks! http://hg.libsdl.org/SDL_ttf/rev/346309f53e45 http://hg.libsdl.org/SDL_ttf/rev/25ec85256dca |
Hi, if I do: TTF_SetFontHinting(font, TTF_HINTING_LIGHT); // TTF_HINTING_LIGHT == 1 then: TTF_GetFontHinting(font): returns 65536 instead of TTF_HINTING_LIGHT (1). You do a translation is the Set~ function: void TTF_SetFontHinting( TTF_Font* font, int hinting ) { if (hinting == TTF_HINTING_LIGHT) font->hinting = FT_LOAD_TARGET_LIGHT; else if (hinting == TTF_HINTING_MONO) font->hinting = FT_LOAD_TARGET_MONO; else if (hinting == TTF_HINTING_NONE) font->hinting = FT_LOAD_NO_HINTING; else font->hinting = 0; Flush_Cache( font ); } But none in the Get~ function: int TTF_GetFontHinting( const TTF_Font* font ) { return font->hinting; } The FT_~ constants are not 0..3 like the TTF_~ are (freetype/freetype.h): #define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 ) #define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL ) #define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT ) #define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO ) #define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD ) #define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V ) Cheers