[SDL] Patch: Expose FreeType hinting preferences in SDL_TTF

Gregory Smith wolfy at treellama.org
Sun Nov 4 09:59:40 PST 2007


Vassilis Virvilis wrote:
> I am not a SDL developer but the patch looks alright to me.
> 
> One more nitpick though, is that I would prefer if you
> used enums instead of defines. This way you can avoid
> namespace pollution if you include SDL_ttf headers from
> a C++ program.
> 
> So instead
> 
> +/* Set and retrieve FreeType hinter settings */
> +#define TTF_HINTING_NORMAL    0
> +#define TTF_HINTING_LIGHT     1
> +#define TTF_HINTING_MONO      2
> +#define TTF_HINTING_NONE      3
> 
> it would be nice to use
> typedef enum {
> 	TTF_HINTING_NORMAL,
> 	TTF_HINTING_LIGHT,
> 	TTF_HINTING_MONO.
> 	TTF_HINTING_NONE
> } ttf_hinting;
> 
> or something like this..

Generally when submitting patches I follow the style of whatever code
I'm modifying, and SDL_TTF uses #defines for other constants. No
argument here that enums are preferable.

Gregory


More information about the SDL mailing list